Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4d2514cc authored by Chandru S's avatar Chandru S Committed by Android (Google) Code Review
Browse files

Merge "Add SideFpsProgressBar to show a progress bar when rest_to_unlock...

Merge "Add SideFpsProgressBar to show a progress bar when rest_to_unlock feature is enabled" into main
parents 705e7fa0 33a8cb74
Loading
Loading
Loading
Loading
+45 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2023 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
    android:paddingMode="stack">
    <item
        android:id="@android:id/background"
        android:gravity="center_vertical|fill_horizontal">
        <shape
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:shape="rectangle">
            <corners android:radius="30dp" />
            <solid android:color="?androidprv:attr/materialColorSurfaceContainerHighest" />
        </shape>
    </item>
    <item
        android:id="@android:id/progress"
        android:gravity="center_vertical|fill_horizontal">
        <clip>
            <shape
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:shape="rectangle">
                <corners android:radius="30dp" />
                <solid android:color="?androidprv:attr/textColorPrimary" />
            </shape>
        </clip>
    </item>
</layer-list>
 No newline at end of file
+32 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?><!--
  ~ Copyright (C) 2023 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  ~
  -->

<LinearLayout android:layout_height="match_parent"
    android:layout_width="match_parent"
    android:orientation="vertical"
    android:layoutDirection="ltr"
    android:gravity="center"
    xmlns:android="http://schemas.android.com/apk/res/android">
    <ProgressBar
        android:id="@+id/side_fps_progress_bar"
        android:layout_width="55dp"
        android:layout_height="10dp"
        android:indeterminateOnly="false"
        android:min="0"
        android:max="100"
        android:progressDrawable="@drawable/progress_bar" />
</LinearLayout>
+2 −1
Original line number Diff line number Diff line
@@ -153,7 +153,6 @@ import com.android.settingslib.Utils;
import com.android.settingslib.WirelessUtils;
import com.android.settingslib.fuelgauge.BatteryStatus;
import com.android.systemui.Dumpable;
import com.android.systemui.res.R;
import com.android.systemui.biometrics.AuthController;
import com.android.systemui.biometrics.FingerprintInteractiveToAuthProvider;
import com.android.systemui.broadcast.BroadcastDispatcher;
@@ -177,6 +176,7 @@ import com.android.systemui.keyguard.shared.model.SysUiFaceAuthenticateOptions;
import com.android.systemui.log.SessionTracker;
import com.android.systemui.plugins.WeatherData;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.res.R;
import com.android.systemui.settings.DisplayTracker;
import com.android.systemui.settings.UserTracker;
import com.android.systemui.shared.system.TaskStackChangeListener;
@@ -1984,6 +1984,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
                @Override
                public void onAuthenticationAcquired(int acquireInfo) {
                    Trace.beginSection("KeyguardUpdateMonitor#onAuthenticationAcquired");
                    mLogger.logFingerprintAcquired(acquireInfo);
                    handleFingerprintAcquired(acquireInfo);
                    Trace.endSection();
                }
+34 −7
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ import com.google.errorprone.annotations.CompileTimeConstant
import javax.inject.Inject

private const val TAG = "KeyguardUpdateMonitorLog"
private const val FP_LOG_TAG = "KeyguardFingerprintLog"

/** Helper class for logging for [com.android.keyguard.KeyguardUpdateMonitor] */
class KeyguardUpdateMonitorLogger
@@ -157,7 +158,7 @@ constructor(@KeyguardUpdateMonitorLog private val logBuffer: LogBuffer) {

    fun logFingerprintAuthForWrongUser(authUserId: Int) {
        logBuffer.log(
            TAG,
            FP_LOG_TAG,
            DEBUG,
            { int1 = authUserId },
            { "Fingerprint authenticated for wrong user: $int1" }
@@ -166,7 +167,7 @@ constructor(@KeyguardUpdateMonitorLog private val logBuffer: LogBuffer) {

    fun logFingerprintDisabledForUser(userId: Int) {
        logBuffer.log(
            TAG,
            FP_LOG_TAG,
            DEBUG,
            { int1 = userId },
            { "Fingerprint disabled by DPM for userId: $int1" }
@@ -174,12 +175,17 @@ constructor(@KeyguardUpdateMonitorLog private val logBuffer: LogBuffer) {
    }

    fun logFingerprintLockoutReset(@LockoutMode mode: Int) {
        logBuffer.log(TAG, DEBUG, { int1 = mode }, { "handleFingerprintLockoutReset: $int1" })
        logBuffer.log(
            FP_LOG_TAG,
            DEBUG,
            { int1 = mode },
            { "handleFingerprintLockoutReset: $int1" }
        )
    }

    fun logFingerprintRunningState(fingerprintRunningState: Int) {
        logBuffer.log(
            TAG,
            FP_LOG_TAG,
            DEBUG,
            { int1 = fingerprintRunningState },
            { "fingerprintRunningState: $int1" }
@@ -188,7 +194,7 @@ constructor(@KeyguardUpdateMonitorLog private val logBuffer: LogBuffer) {

    fun logFingerprintSuccess(userId: Int, isStrongBiometric: Boolean) {
        logBuffer.log(
            TAG,
            FP_LOG_TAG,
            DEBUG,
            {
                int1 = userId
@@ -212,7 +218,7 @@ constructor(@KeyguardUpdateMonitorLog private val logBuffer: LogBuffer) {

    fun logFingerprintDetected(userId: Int, isStrongBiometric: Boolean) {
        logBuffer.log(
            TAG,
            FP_LOG_TAG,
            DEBUG,
            {
                int1 = userId
@@ -224,7 +230,7 @@ constructor(@KeyguardUpdateMonitorLog private val logBuffer: LogBuffer) {

    fun logFingerprintError(msgId: Int, originalErrMsg: String) {
        logBuffer.log(
            TAG,
            FP_LOG_TAG,
            DEBUG,
            {
                str1 = originalErrMsg
@@ -751,4 +757,25 @@ constructor(@KeyguardUpdateMonitorLog private val logBuffer: LogBuffer) {
            { "userSwitchComplete: $str1, userId: $int1" }
        )
    }

    fun logFingerprintHelp(helpMsgId: Int, helpString: CharSequence) {
        logBuffer.log(
            FP_LOG_TAG,
            DEBUG,
            {
                int1 = helpMsgId
                str1 = "$helpString"
            },
            { "fingerprint help message: $int1, $str1" }
        )
    }

    fun logFingerprintAcquired(acquireInfo: Int) {
        logBuffer.log(
            FP_LOG_TAG,
            DEBUG,
            { int1 = acquireInfo },
            { "fingerprint acquire message: $int1" }
        )
    }
}
+22 −2
Original line number Diff line number Diff line
@@ -41,6 +41,8 @@ import android.view.LayoutInflater
import android.view.Surface
import android.view.View
import android.view.View.AccessibilityDelegate
import android.view.View.INVISIBLE
import android.view.View.VISIBLE
import android.view.ViewPropertyAnimator
import android.view.WindowManager
import android.view.WindowManager.LayoutParams.PRIVATE_FLAG_NO_MOVE_ANIMATION
@@ -54,13 +56,13 @@ import com.android.app.animation.Interpolators
import com.android.internal.annotations.VisibleForTesting
import com.android.keyguard.KeyguardPINView
import com.android.systemui.Dumpable
import com.android.systemui.res.R
import com.android.systemui.biometrics.domain.interactor.DisplayStateInteractor
import com.android.systemui.bouncer.domain.interactor.AlternateBouncerInteractor
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.dump.DumpManager
import com.android.systemui.res.R
import com.android.systemui.util.boundsOnScreen
import com.android.systemui.util.concurrency.DelayableExecutor
import com.android.systemui.util.traceSection
@@ -229,6 +231,20 @@ constructor(
        }
    }

    /** Hide the arrow indicator. */
    fun hideIndicator() {
        val lottieAnimationView =
            overlayView?.findViewById(R.id.sidefps_animation) as LottieAnimationView?
        lottieAnimationView?.visibility = INVISIBLE
    }

    /** Show the arrow indicator. */
    fun showIndicator() {
        val lottieAnimationView =
            overlayView?.findViewById(R.id.sidefps_animation) as LottieAnimationView?
        lottieAnimationView?.visibility = VISIBLE
    }

    override fun dump(pw: PrintWriter, args: Array<out String>) {
        pw.println("requests:")
        for (requestSource in requests) {
@@ -247,6 +263,10 @@ constructor(
        pw.println("     displayId=${displayInfo.uniqueId}")
        pw.println("     sensorType=${sensorProps?.sensorType}")
        pw.println("     location=${sensorProps?.getLocation(displayInfo.uniqueId)}")
        pw.println("lottieAnimationView:")
        pw.println(
            "     visibility=${overlayView?.findViewById<View>(R.id.sidefps_animation)?.visibility}"
        )

        pw.println("overlayOffsets=$overlayOffsets")
        pw.println("isReverseDefaultRotation=$isReverseDefaultRotation")
@@ -498,5 +518,5 @@ enum class SideFpsUiRequestSource {
    AUTO_SHOW,
    /** Pin, pattern or password bouncer */
    PRIMARY_BOUNCER,
    ALTERNATE_BOUNCER
    ALTERNATE_BOUNCER,
}
Loading