Loading packages/SystemUI/src/com/android/keyguard/ClockEventController.kt +5 −5 Original line number Diff line number Diff line Loading @@ -69,7 +69,7 @@ open class ClockEventController @Inject constructor( private var isCharging = false private var dozeAmount = 0f private var isKeyguardShowing = false private var isKeyguardVisible = false private val regionSamplingEnabled = featureFlags.isEnabled(com.android.systemui.flags.Flags.REGION_SAMPLING) Loading Loading @@ -145,7 +145,7 @@ open class ClockEventController @Inject constructor( private val batteryCallback = object : BatteryStateChangeCallback { override fun onBatteryLevelChanged(level: Int, pluggedIn: Boolean, charging: Boolean) { if (isKeyguardShowing && !isCharging && charging) { if (isKeyguardVisible && !isCharging && charging) { clock?.animations?.charge() } isCharging = charging Loading @@ -168,9 +168,9 @@ open class ClockEventController @Inject constructor( } private val keyguardUpdateMonitorCallback = object : KeyguardUpdateMonitorCallback() { override fun onKeyguardVisibilityChanged(showing: Boolean) { isKeyguardShowing = showing if (!isKeyguardShowing) { override fun onKeyguardVisibilityChanged(visible: Boolean) { isKeyguardVisible = visible if (!isKeyguardVisible) { clock?.animations?.doze(if (isDozing) 1f else 0f) } } Loading packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java +3 −3 Original line number Diff line number Diff line Loading @@ -212,9 +212,9 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV } @Override public void onKeyguardVisibilityChanged(boolean showing) { if (showing) { if (DEBUG) Slog.v(TAG, "refresh statusview showing:" + showing); public void onKeyguardVisibilityChanged(boolean visible) { if (visible) { if (DEBUG) Slog.v(TAG, "refresh statusview visible:true"); refreshTime(); } } Loading packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +47 −33 Original line number Diff line number Diff line Loading @@ -308,7 +308,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab HashMap<Integer, ServiceState> mServiceStates = new HashMap<>(); private int mPhoneState; private boolean mKeyguardIsVisible; private boolean mKeyguardShowing; private boolean mKeyguardOccluded; private boolean mCredentialAttempted; private boolean mKeyguardGoingAway; private boolean mGoingToSleep; Loading @@ -318,7 +319,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab private boolean mAuthInterruptActive; private boolean mNeedsSlowUnlockTransition; private boolean mAssistantVisible; private boolean mKeyguardOccluded; private boolean mOccludingAppRequestingFp; private boolean mOccludingAppRequestingFace; private boolean mSecureCameraLaunched; Loading Loading @@ -681,14 +681,42 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab } /** * Updates KeyguardUpdateMonitor's internal state to know if keyguard is occluded * Updates KeyguardUpdateMonitor's internal state to know if keyguard is showing and if * its occluded. The keyguard is considered visible if its showing and NOT occluded. */ public void setKeyguardOccluded(boolean occluded) { public void setKeyguardShowing(boolean showing, boolean occluded) { final boolean occlusionChanged = mKeyguardOccluded != occluded; final boolean showingChanged = mKeyguardShowing != showing; if (!occlusionChanged && !showingChanged) { return; } final boolean wasKeyguardVisible = isKeyguardVisible(); mKeyguardShowing = showing; mKeyguardOccluded = occluded; final boolean isKeyguardVisible = isKeyguardVisible(); mLogger.logKeyguardShowingChanged(showing, occluded, isKeyguardVisible); if (isKeyguardVisible != wasKeyguardVisible) { if (isKeyguardVisible) { mSecureCameraLaunched = false; } for (int i = 0; i < mCallbacks.size(); i++) { KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get(); if (cb != null) { cb.onKeyguardVisibilityChanged(isKeyguardVisible); } } } if (occlusionChanged) { updateBiometricListeningState(BIOMETRIC_ACTION_UPDATE, FACE_AUTH_UPDATED_KEYGUARD_OCCLUSION_CHANGED); } else if (showingChanged) { updateBiometricListeningState(BIOMETRIC_ACTION_UPDATE, FACE_AUTH_UPDATED_KEYGUARD_VISIBILITY_CHANGED); } } /** * Request to listen for face authentication when an app is occluding keyguard. Loading Loading @@ -2442,7 +2470,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab // Triggers: final boolean triggerActiveUnlockForAssistant = shouldTriggerActiveUnlockForAssistant(); final boolean awakeKeyguard = mBouncerFullyShown || mUdfpsBouncerShowing || (mKeyguardIsVisible && !mGoingToSleep || (isKeyguardVisible() && !mGoingToSleep && mStatusBarState != StatusBarState.SHADE_LOCKED); // Gates: Loading Loading @@ -2518,7 +2546,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab final boolean userDoesNotHaveTrust = !getUserHasTrust(user); final boolean shouldListenForFingerprintAssistant = shouldListenForFingerprintAssistant(); final boolean shouldListenKeyguardState = mKeyguardIsVisible isKeyguardVisible() || !mDeviceInteractive || (mBouncerIsOrWillBeShowing && !mKeyguardGoingAway) || mGoingToSleep Loading Loading @@ -2567,7 +2595,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab mFingerprintLockedOut, mGoingToSleep, mKeyguardGoingAway, mKeyguardIsVisible, isKeyguardVisible(), mKeyguardOccluded, mOccludingAppRequestingFp, mIsPrimaryUser, Loading @@ -2589,7 +2617,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab } final boolean statusBarShadeLocked = mStatusBarState == StatusBarState.SHADE_LOCKED; final boolean awakeKeyguard = mKeyguardIsVisible && mDeviceInteractive final boolean awakeKeyguard = isKeyguardVisible() && mDeviceInteractive && !statusBarShadeLocked; final int user = getCurrentUser(); final int strongAuth = mStrongAuthTracker.getStrongAuthForUser(user); Loading Loading @@ -3146,32 +3174,18 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab callbacksRefreshCarrierInfo(); } /** * Whether the keyguard is showing and not occluded. */ public boolean isKeyguardVisible() { return mKeyguardIsVisible; return isKeyguardShowing() && !mKeyguardOccluded; } /** * Notifies that the visibility state of Keyguard has changed. * * <p>Needs to be called from the main thread. * Whether the keyguard is showing. It may still be occluded and not visible. */ public void onKeyguardVisibilityChanged(boolean showing) { Assert.isMainThread(); mLogger.logKeyguardVisibilityChanged(showing); mKeyguardIsVisible = showing; if (showing) { mSecureCameraLaunched = false; } for (int i = 0; i < mCallbacks.size(); i++) { KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get(); if (cb != null) { cb.onKeyguardVisibilityChangedRaw(showing); } } updateBiometricListeningState(BIOMETRIC_ACTION_UPDATE, FACE_AUTH_UPDATED_KEYGUARD_VISIBILITY_CHANGED); public boolean isKeyguardShowing() { return mKeyguardShowing; } /** Loading Loading @@ -3380,7 +3394,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab callback.onTimeChanged(); callback.onPhoneStateChanged(mPhoneState); callback.onRefreshCarrierInfo(); callback.onKeyguardVisibilityChangedRaw(mKeyguardIsVisible); callback.onKeyguardVisibilityChanged(isKeyguardVisible()); callback.onTelephonyCapable(mTelephonyCapable); for (Entry<Integer, SimData> data : mSimDatas.entrySet()) { Loading packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java +6 −20 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.keyguard; import android.hardware.biometrics.BiometricSourceType; import android.os.SystemClock; import android.telephony.TelephonyManager; import android.view.WindowManagerPolicyConstants; Loading @@ -32,10 +31,6 @@ import java.util.TimeZone; */ public class KeyguardUpdateMonitorCallback { private static final long VISIBILITY_CHANGED_COLLAPSE_MS = 1000; private long mVisibilityChangedCalled; private boolean mShowing; /** * Called when the battery status changes, e.g. when plugged in or unplugged, charge * level, etc. changes. Loading Loading @@ -74,21 +69,6 @@ public class KeyguardUpdateMonitorCallback { */ public void onPhoneStateChanged(int phoneState) { } /** * Called when the visibility of the keyguard changes. * @param showing Indicates if the keyguard is now visible. */ public void onKeyguardVisibilityChanged(boolean showing) { } public void onKeyguardVisibilityChangedRaw(boolean showing) { final long now = SystemClock.elapsedRealtime(); if (showing == mShowing && (now - mVisibilityChangedCalled) < VISIBILITY_CHANGED_COLLAPSE_MS) return; onKeyguardVisibilityChanged(showing); mVisibilityChangedCalled = now; mShowing = showing; } /** * Called when the keyguard enters or leaves bouncer mode. * @param bouncerIsOrWillBeShowing if true, keyguard is showing the bouncer or transitioning Loading @@ -96,6 +76,12 @@ public class KeyguardUpdateMonitorCallback { */ public void onKeyguardBouncerStateChanged(boolean bouncerIsOrWillBeShowing) { } /** * Called when the keyguard visibility changes. * @param visible whether the keyguard is showing and is NOT occluded */ public void onKeyguardVisibilityChanged(boolean visible) { } /** * Called when the keyguard fully transitions to the bouncer or is no longer the bouncer * @param bouncerIsFullyShowing if true, keyguard is fully showing the bouncer Loading packages/SystemUI/src/com/android/keyguard/LockIconViewController.java +5 −8 Original line number Diff line number Diff line Loading @@ -446,14 +446,6 @@ public class LockIconViewController extends ViewController<LockIconView> impleme private final KeyguardUpdateMonitorCallback mKeyguardUpdateMonitorCallback = new KeyguardUpdateMonitorCallback() { @Override public void onKeyguardVisibilityChanged(boolean showing) { // reset mIsBouncerShowing state in case it was preemptively set // onLongPress mIsBouncerShowing = mKeyguardViewController.isBouncerShowing(); updateVisibility(); } @Override public void onKeyguardBouncerStateChanged(boolean bouncer) { mIsBouncerShowing = bouncer; Loading Loading @@ -507,6 +499,11 @@ public class LockIconViewController extends ViewController<LockIconView> impleme // If biometrics were removed, local vars mCanDismissLockScreen and // mUserUnlockedWithBiometric may not be updated. mCanDismissLockScreen = mKeyguardStateController.canDismissLockScreen(); // reset mIsBouncerShowing state in case it was preemptively set // onLongPress mIsBouncerShowing = mKeyguardViewController.isBouncerShowing(); updateKeyguardShowing(); if (mIsKeyguardShowing) { mUserUnlockedWithBiometric = Loading Loading
packages/SystemUI/src/com/android/keyguard/ClockEventController.kt +5 −5 Original line number Diff line number Diff line Loading @@ -69,7 +69,7 @@ open class ClockEventController @Inject constructor( private var isCharging = false private var dozeAmount = 0f private var isKeyguardShowing = false private var isKeyguardVisible = false private val regionSamplingEnabled = featureFlags.isEnabled(com.android.systemui.flags.Flags.REGION_SAMPLING) Loading Loading @@ -145,7 +145,7 @@ open class ClockEventController @Inject constructor( private val batteryCallback = object : BatteryStateChangeCallback { override fun onBatteryLevelChanged(level: Int, pluggedIn: Boolean, charging: Boolean) { if (isKeyguardShowing && !isCharging && charging) { if (isKeyguardVisible && !isCharging && charging) { clock?.animations?.charge() } isCharging = charging Loading @@ -168,9 +168,9 @@ open class ClockEventController @Inject constructor( } private val keyguardUpdateMonitorCallback = object : KeyguardUpdateMonitorCallback() { override fun onKeyguardVisibilityChanged(showing: Boolean) { isKeyguardShowing = showing if (!isKeyguardShowing) { override fun onKeyguardVisibilityChanged(visible: Boolean) { isKeyguardVisible = visible if (!isKeyguardVisible) { clock?.animations?.doze(if (isDozing) 1f else 0f) } } Loading
packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java +3 −3 Original line number Diff line number Diff line Loading @@ -212,9 +212,9 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV } @Override public void onKeyguardVisibilityChanged(boolean showing) { if (showing) { if (DEBUG) Slog.v(TAG, "refresh statusview showing:" + showing); public void onKeyguardVisibilityChanged(boolean visible) { if (visible) { if (DEBUG) Slog.v(TAG, "refresh statusview visible:true"); refreshTime(); } } Loading
packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +47 −33 Original line number Diff line number Diff line Loading @@ -308,7 +308,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab HashMap<Integer, ServiceState> mServiceStates = new HashMap<>(); private int mPhoneState; private boolean mKeyguardIsVisible; private boolean mKeyguardShowing; private boolean mKeyguardOccluded; private boolean mCredentialAttempted; private boolean mKeyguardGoingAway; private boolean mGoingToSleep; Loading @@ -318,7 +319,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab private boolean mAuthInterruptActive; private boolean mNeedsSlowUnlockTransition; private boolean mAssistantVisible; private boolean mKeyguardOccluded; private boolean mOccludingAppRequestingFp; private boolean mOccludingAppRequestingFace; private boolean mSecureCameraLaunched; Loading Loading @@ -681,14 +681,42 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab } /** * Updates KeyguardUpdateMonitor's internal state to know if keyguard is occluded * Updates KeyguardUpdateMonitor's internal state to know if keyguard is showing and if * its occluded. The keyguard is considered visible if its showing and NOT occluded. */ public void setKeyguardOccluded(boolean occluded) { public void setKeyguardShowing(boolean showing, boolean occluded) { final boolean occlusionChanged = mKeyguardOccluded != occluded; final boolean showingChanged = mKeyguardShowing != showing; if (!occlusionChanged && !showingChanged) { return; } final boolean wasKeyguardVisible = isKeyguardVisible(); mKeyguardShowing = showing; mKeyguardOccluded = occluded; final boolean isKeyguardVisible = isKeyguardVisible(); mLogger.logKeyguardShowingChanged(showing, occluded, isKeyguardVisible); if (isKeyguardVisible != wasKeyguardVisible) { if (isKeyguardVisible) { mSecureCameraLaunched = false; } for (int i = 0; i < mCallbacks.size(); i++) { KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get(); if (cb != null) { cb.onKeyguardVisibilityChanged(isKeyguardVisible); } } } if (occlusionChanged) { updateBiometricListeningState(BIOMETRIC_ACTION_UPDATE, FACE_AUTH_UPDATED_KEYGUARD_OCCLUSION_CHANGED); } else if (showingChanged) { updateBiometricListeningState(BIOMETRIC_ACTION_UPDATE, FACE_AUTH_UPDATED_KEYGUARD_VISIBILITY_CHANGED); } } /** * Request to listen for face authentication when an app is occluding keyguard. Loading Loading @@ -2442,7 +2470,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab // Triggers: final boolean triggerActiveUnlockForAssistant = shouldTriggerActiveUnlockForAssistant(); final boolean awakeKeyguard = mBouncerFullyShown || mUdfpsBouncerShowing || (mKeyguardIsVisible && !mGoingToSleep || (isKeyguardVisible() && !mGoingToSleep && mStatusBarState != StatusBarState.SHADE_LOCKED); // Gates: Loading Loading @@ -2518,7 +2546,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab final boolean userDoesNotHaveTrust = !getUserHasTrust(user); final boolean shouldListenForFingerprintAssistant = shouldListenForFingerprintAssistant(); final boolean shouldListenKeyguardState = mKeyguardIsVisible isKeyguardVisible() || !mDeviceInteractive || (mBouncerIsOrWillBeShowing && !mKeyguardGoingAway) || mGoingToSleep Loading Loading @@ -2567,7 +2595,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab mFingerprintLockedOut, mGoingToSleep, mKeyguardGoingAway, mKeyguardIsVisible, isKeyguardVisible(), mKeyguardOccluded, mOccludingAppRequestingFp, mIsPrimaryUser, Loading @@ -2589,7 +2617,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab } final boolean statusBarShadeLocked = mStatusBarState == StatusBarState.SHADE_LOCKED; final boolean awakeKeyguard = mKeyguardIsVisible && mDeviceInteractive final boolean awakeKeyguard = isKeyguardVisible() && mDeviceInteractive && !statusBarShadeLocked; final int user = getCurrentUser(); final int strongAuth = mStrongAuthTracker.getStrongAuthForUser(user); Loading Loading @@ -3146,32 +3174,18 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab callbacksRefreshCarrierInfo(); } /** * Whether the keyguard is showing and not occluded. */ public boolean isKeyguardVisible() { return mKeyguardIsVisible; return isKeyguardShowing() && !mKeyguardOccluded; } /** * Notifies that the visibility state of Keyguard has changed. * * <p>Needs to be called from the main thread. * Whether the keyguard is showing. It may still be occluded and not visible. */ public void onKeyguardVisibilityChanged(boolean showing) { Assert.isMainThread(); mLogger.logKeyguardVisibilityChanged(showing); mKeyguardIsVisible = showing; if (showing) { mSecureCameraLaunched = false; } for (int i = 0; i < mCallbacks.size(); i++) { KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get(); if (cb != null) { cb.onKeyguardVisibilityChangedRaw(showing); } } updateBiometricListeningState(BIOMETRIC_ACTION_UPDATE, FACE_AUTH_UPDATED_KEYGUARD_VISIBILITY_CHANGED); public boolean isKeyguardShowing() { return mKeyguardShowing; } /** Loading Loading @@ -3380,7 +3394,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab callback.onTimeChanged(); callback.onPhoneStateChanged(mPhoneState); callback.onRefreshCarrierInfo(); callback.onKeyguardVisibilityChangedRaw(mKeyguardIsVisible); callback.onKeyguardVisibilityChanged(isKeyguardVisible()); callback.onTelephonyCapable(mTelephonyCapable); for (Entry<Integer, SimData> data : mSimDatas.entrySet()) { Loading
packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java +6 −20 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.keyguard; import android.hardware.biometrics.BiometricSourceType; import android.os.SystemClock; import android.telephony.TelephonyManager; import android.view.WindowManagerPolicyConstants; Loading @@ -32,10 +31,6 @@ import java.util.TimeZone; */ public class KeyguardUpdateMonitorCallback { private static final long VISIBILITY_CHANGED_COLLAPSE_MS = 1000; private long mVisibilityChangedCalled; private boolean mShowing; /** * Called when the battery status changes, e.g. when plugged in or unplugged, charge * level, etc. changes. Loading Loading @@ -74,21 +69,6 @@ public class KeyguardUpdateMonitorCallback { */ public void onPhoneStateChanged(int phoneState) { } /** * Called when the visibility of the keyguard changes. * @param showing Indicates if the keyguard is now visible. */ public void onKeyguardVisibilityChanged(boolean showing) { } public void onKeyguardVisibilityChangedRaw(boolean showing) { final long now = SystemClock.elapsedRealtime(); if (showing == mShowing && (now - mVisibilityChangedCalled) < VISIBILITY_CHANGED_COLLAPSE_MS) return; onKeyguardVisibilityChanged(showing); mVisibilityChangedCalled = now; mShowing = showing; } /** * Called when the keyguard enters or leaves bouncer mode. * @param bouncerIsOrWillBeShowing if true, keyguard is showing the bouncer or transitioning Loading @@ -96,6 +76,12 @@ public class KeyguardUpdateMonitorCallback { */ public void onKeyguardBouncerStateChanged(boolean bouncerIsOrWillBeShowing) { } /** * Called when the keyguard visibility changes. * @param visible whether the keyguard is showing and is NOT occluded */ public void onKeyguardVisibilityChanged(boolean visible) { } /** * Called when the keyguard fully transitions to the bouncer or is no longer the bouncer * @param bouncerIsFullyShowing if true, keyguard is fully showing the bouncer Loading
packages/SystemUI/src/com/android/keyguard/LockIconViewController.java +5 −8 Original line number Diff line number Diff line Loading @@ -446,14 +446,6 @@ public class LockIconViewController extends ViewController<LockIconView> impleme private final KeyguardUpdateMonitorCallback mKeyguardUpdateMonitorCallback = new KeyguardUpdateMonitorCallback() { @Override public void onKeyguardVisibilityChanged(boolean showing) { // reset mIsBouncerShowing state in case it was preemptively set // onLongPress mIsBouncerShowing = mKeyguardViewController.isBouncerShowing(); updateVisibility(); } @Override public void onKeyguardBouncerStateChanged(boolean bouncer) { mIsBouncerShowing = bouncer; Loading Loading @@ -507,6 +499,11 @@ public class LockIconViewController extends ViewController<LockIconView> impleme // If biometrics were removed, local vars mCanDismissLockScreen and // mUserUnlockedWithBiometric may not be updated. mCanDismissLockScreen = mKeyguardStateController.canDismissLockScreen(); // reset mIsBouncerShowing state in case it was preemptively set // onLongPress mIsBouncerShowing = mKeyguardViewController.isBouncerShowing(); updateKeyguardShowing(); if (mIsKeyguardShowing) { mUserUnlockedWithBiometric = Loading