Merge "Do not report AOD as showing when fading away" into qt-r1-dev

This commit is contained in:
TreeHugger Robot
2019-07-11 16:03:26 +00:00
committed by Android (Google) Code Review
2 changed files with 29 additions and 21 deletions

View File

@@ -210,6 +210,7 @@ public class KeyguardViewMediator extends SystemUI {
private boolean mBootCompleted; private boolean mBootCompleted;
private boolean mBootSendUserPresent; private boolean mBootSendUserPresent;
private boolean mShuttingDown; private boolean mShuttingDown;
private boolean mDozing;
/** High level access to the power manager for WakeLocks */ /** High level access to the power manager for WakeLocks */
private PowerManager mPM; private PowerManager mPM;
@@ -713,11 +714,10 @@ public class KeyguardViewMediator extends SystemUI {
com.android.keyguard.R.bool.config_enableKeyguardService)) { com.android.keyguard.R.bool.config_enableKeyguardService)) {
setShowingLocked(!shouldWaitForProvisioning() setShowingLocked(!shouldWaitForProvisioning()
&& !mLockPatternUtils.isLockScreenDisabled( && !mLockPatternUtils.isLockScreenDisabled(
KeyguardUpdateMonitor.getCurrentUser()), KeyguardUpdateMonitor.getCurrentUser()), true /* forceCallbacks */);
mAodShowing, true /* forceCallbacks */);
} else { } else {
// The system's keyguard is disabled or missing. // The system's keyguard is disabled or missing.
setShowingLocked(false, mAodShowing, true); setShowingLocked(false /* showing */, true /* forceCallbacks */);
} }
mStatusBarKeyguardViewManager = mStatusBarKeyguardViewManager =
@@ -1326,7 +1326,7 @@ public class KeyguardViewMediator extends SystemUI {
if (mLockPatternUtils.checkVoldPassword(KeyguardUpdateMonitor.getCurrentUser())) { if (mLockPatternUtils.checkVoldPassword(KeyguardUpdateMonitor.getCurrentUser())) {
if (DEBUG) Log.d(TAG, "Not showing lock screen since just decrypted"); if (DEBUG) Log.d(TAG, "Not showing lock screen since just decrypted");
// Without this, settings is not enabled until the lock screen first appears // Without this, settings is not enabled until the lock screen first appears
setShowingLocked(false, mAodShowing); setShowingLocked(false);
hideLocked(); hideLocked();
return; return;
} }
@@ -1742,6 +1742,9 @@ public class KeyguardViewMediator extends SystemUI {
private void updateActivityLockScreenState(boolean showing, boolean aodShowing) { private void updateActivityLockScreenState(boolean showing, boolean aodShowing) {
mUiOffloadThread.submit(() -> { mUiOffloadThread.submit(() -> {
if (DEBUG) {
Log.d(TAG, "updateActivityLockScreenState(" + showing + ", " + aodShowing + ")");
}
try { try {
ActivityTaskManager.getService().setLockScreenShown(showing, aodShowing); ActivityTaskManager.getService().setLockScreenShown(showing, aodShowing);
} catch (RemoteException e) { } catch (RemoteException e) {
@@ -1767,10 +1770,10 @@ public class KeyguardViewMediator extends SystemUI {
if (DEBUG) Log.d(TAG, "handleShow"); if (DEBUG) Log.d(TAG, "handleShow");
} }
setShowingLocked(true, mAodShowing);
mStatusBarKeyguardViewManager.show(options);
mHiding = false; mHiding = false;
mWakeAndUnlocking = false; mWakeAndUnlocking = false;
setShowingLocked(true);
mStatusBarKeyguardViewManager.show(options);
resetKeyguardDonePendingLocked(); resetKeyguardDonePendingLocked();
mHideAnimationRun = false; mHideAnimationRun = false;
adjustStatusBarLocked(); adjustStatusBarLocked();
@@ -1877,7 +1880,7 @@ public class KeyguardViewMediator extends SystemUI {
if (!mHiding) { if (!mHiding) {
// Tell ActivityManager that we canceled the keyguardExitAnimation. // Tell ActivityManager that we canceled the keyguardExitAnimation.
setShowingLocked(mShowing, mAodShowing, true /* force */); setShowingLocked(mShowing, true /* force */);
return; return;
} }
mHiding = false; mHiding = false;
@@ -1898,8 +1901,8 @@ public class KeyguardViewMediator extends SystemUI {
playSounds(false); playSounds(false);
} }
setShowingLocked(false);
mWakeAndUnlocking = false; mWakeAndUnlocking = false;
setShowingLocked(false, mAodShowing);
mDismissCallbackRegistry.notifyDismissSucceeded(); mDismissCallbackRegistry.notifyDismissSucceeded();
mStatusBarKeyguardViewManager.hide(startTime, fadeoutDuration); mStatusBarKeyguardViewManager.hide(startTime, fadeoutDuration);
resetKeyguardDonePendingLocked(); resetKeyguardDonePendingLocked();
@@ -1959,7 +1962,7 @@ public class KeyguardViewMediator extends SystemUI {
Trace.beginSection("KeyguardViewMediator#handleVerifyUnlock"); Trace.beginSection("KeyguardViewMediator#handleVerifyUnlock");
synchronized (KeyguardViewMediator.this) { synchronized (KeyguardViewMediator.this) {
if (DEBUG) Log.d(TAG, "handleVerifyUnlock"); if (DEBUG) Log.d(TAG, "handleVerifyUnlock");
setShowingLocked(true, mAodShowing); setShowingLocked(true);
mStatusBarKeyguardViewManager.dismissAndCollapse(); mStatusBarKeyguardViewManager.dismissAndCollapse();
} }
Trace.endSection(); Trace.endSection();
@@ -2106,6 +2109,8 @@ public class KeyguardViewMediator extends SystemUI {
pw.print(" mDeviceInteractive: "); pw.println(mDeviceInteractive); pw.print(" mDeviceInteractive: "); pw.println(mDeviceInteractive);
pw.print(" mGoingToSleep: "); pw.println(mGoingToSleep); pw.print(" mGoingToSleep: "); pw.println(mGoingToSleep);
pw.print(" mHiding: "); pw.println(mHiding); pw.print(" mHiding: "); pw.println(mHiding);
pw.print(" mDozing: "); pw.println(mDozing);
pw.print(" mAodShowing: "); pw.println(mAodShowing);
pw.print(" mWaitingUntilKeyguardVisible: "); pw.println(mWaitingUntilKeyguardVisible); pw.print(" mWaitingUntilKeyguardVisible: "); pw.println(mWaitingUntilKeyguardVisible);
pw.print(" mKeyguardDonePending: "); pw.println(mKeyguardDonePending); pw.print(" mKeyguardDonePending: "); pw.println(mKeyguardDonePending);
pw.print(" mHideAnimationRun: "); pw.println(mHideAnimationRun); pw.print(" mHideAnimationRun: "); pw.println(mHideAnimationRun);
@@ -2116,10 +2121,14 @@ public class KeyguardViewMediator extends SystemUI {
} }
/** /**
* @param aodShowing true when AOD - or ambient mode - is showing. * @param dozing true when AOD - or ambient mode - is showing.
*/ */
public void setAodShowing(boolean aodShowing) { public void setDozing(boolean dozing) {
setShowingLocked(mShowing, aodShowing); if (dozing == mDozing) {
return;
}
mDozing = dozing;
setShowingLocked(mShowing);
} }
/** /**
@@ -2140,19 +2149,18 @@ public class KeyguardViewMediator extends SystemUI {
} }
} }
private void setShowingLocked(boolean showing, boolean aodShowing) { private void setShowingLocked(boolean showing) {
setShowingLocked(showing, aodShowing, false /* forceCallbacks */); setShowingLocked(showing, false /* forceCallbacks */);
} }
private void setShowingLocked(boolean showing, boolean aodShowing, boolean forceCallbacks) { private void setShowingLocked(boolean showing, boolean forceCallbacks) {
final boolean aodShowing = mDozing && !mWakeAndUnlocking;
final boolean notifyDefaultDisplayCallbacks = showing != mShowing final boolean notifyDefaultDisplayCallbacks = showing != mShowing
|| aodShowing != mAodShowing || forceCallbacks; || aodShowing != mAodShowing || forceCallbacks;
mShowing = showing;
mAodShowing = aodShowing;
if (notifyDefaultDisplayCallbacks) { if (notifyDefaultDisplayCallbacks) {
mShowing = showing; notifyDefaultDisplayCallbacks(showing);
mAodShowing = aodShowing;
if (notifyDefaultDisplayCallbacks) {
notifyDefaultDisplayCallbacks(showing);
}
updateActivityLockScreenState(showing, aodShowing); updateActivityLockScreenState(showing, aodShowing);
} }
} }

View File

@@ -3436,7 +3436,7 @@ public class StatusBar extends SystemUI implements DemoMode,
mNotificationPanel.resetViews(dozingAnimated); mNotificationPanel.resetViews(dozingAnimated);
updateQsExpansionEnabled(); updateQsExpansionEnabled();
mKeyguardViewMediator.setAodShowing(mDozing); mKeyguardViewMediator.setDozing(mDozing);
mEntryManager.updateNotifications(); mEntryManager.updateNotifications();
updateDozingState(); updateDozingState();