Merge "Fix issue where AOD would not start" into rvc-dev

This commit is contained in:
Lucas Dupin
2020-04-02 18:02:12 +00:00
committed by Android (Google) Code Review
4 changed files with 13 additions and 37 deletions

View File

@@ -57,27 +57,27 @@ public interface KeyguardViewController {
/** /**
* Called when the device started going to sleep. * Called when the device started going to sleep.
*/ */
void onStartedGoingToSleep(); default void onStartedGoingToSleep() {};
/** /**
* Called when the device has finished going to sleep. * Called when the device has finished going to sleep.
*/ */
void onFinishedGoingToSleep(); default void onFinishedGoingToSleep() {};
/** /**
* Called when the device started waking up. * Called when the device started waking up.
*/ */
void onStartedWakingUp(); default void onStartedWakingUp() {};
/** /**
* Called when the device started turning on. * Called when the device started turning on.
*/ */
void onScreenTurningOn(); default void onScreenTurningOn() {};
/** /**
* Called when the device has finished turning on. * Called when the device has finished turning on.
*/ */
void onScreenTurnedOn(); default void onScreenTurnedOn() {};
/** /**
* Sets whether the Keyguard needs input. * Sets whether the Keyguard needs input.

View File

@@ -16,6 +16,9 @@
package com.android.systemui.doze; package com.android.systemui.doze;
import static com.android.systemui.keyguard.WakefulnessLifecycle.WAKEFULNESS_AWAKE;
import static com.android.systemui.keyguard.WakefulnessLifecycle.WAKEFULNESS_WAKING;
import android.annotation.MainThread; import android.annotation.MainThread;
import android.hardware.display.AmbientDisplayConfiguration; import android.hardware.display.AmbientDisplayConfiguration;
import android.os.Trace; import android.os.Trace;
@@ -368,8 +371,8 @@ public class DozeMachine {
case DOZE_PULSE_DONE: case DOZE_PULSE_DONE:
final State nextState; final State nextState;
@Wakefulness int wakefulness = mWakefulnessLifecycle.getWakefulness(); @Wakefulness int wakefulness = mWakefulnessLifecycle.getWakefulness();
if (wakefulness == WakefulnessLifecycle.WAKEFULNESS_AWAKE if (state != State.INITIALIZED && (wakefulness == WAKEFULNESS_AWAKE
|| wakefulness == WakefulnessLifecycle.WAKEFULNESS_WAKING) { || wakefulness == WAKEFULNESS_WAKING)) {
nextState = State.FINISH; nextState = State.FINISH;
} else if (mDockManager.isDocked()) { } else if (mDockManager.isDocked()) {
nextState = mDockManager.isHidden() ? State.DOZE : State.DOZE_AOD_DOCKED; nextState = mDockManager.isHidden() ? State.DOZE : State.DOZE_AOD_DOCKED;

View File

@@ -3338,12 +3338,12 @@ public class StatusBar extends SystemUI implements DemoMode,
Trace.traceCounter(Trace.TRACE_TAG_APP, "dozing", mDozing ? 1 : 0); Trace.traceCounter(Trace.TRACE_TAG_APP, "dozing", mDozing ? 1 : 0);
Trace.beginSection("StatusBar#updateDozingState"); Trace.beginSection("StatusBar#updateDozingState");
boolean sleepingFromKeyguard = boolean visibleNotOccluded = mStatusBarKeyguardViewManager.isShowing()
mStatusBarKeyguardViewManager.isGoingToSleepVisibleNotOccluded(); && !mStatusBarKeyguardViewManager.isOccluded();
boolean wakeAndUnlock = mBiometricUnlockController.getMode() boolean wakeAndUnlock = mBiometricUnlockController.getMode()
== BiometricUnlockController.MODE_WAKE_AND_UNLOCK; == BiometricUnlockController.MODE_WAKE_AND_UNLOCK;
boolean animate = (!mDozing && mDozeServiceHost.shouldAnimateWakeup() && !wakeAndUnlock) boolean animate = (!mDozing && mDozeServiceHost.shouldAnimateWakeup() && !wakeAndUnlock)
|| (mDozing && mDozeServiceHost.shouldAnimateScreenOff() && sleepingFromKeyguard); || (mDozing && mDozeServiceHost.shouldAnimateScreenOff() && visibleNotOccluded);
mNotificationPanelViewController.setDozing(mDozing, animate, mWakeUpTouchLocation); mNotificationPanelViewController.setDozing(mDozing, animate, mWakeUpTouchLocation);
updateQsExpansionEnabled(); updateQsExpansionEnabled();

View File

@@ -168,7 +168,6 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
private boolean mLastIsDocked; private boolean mLastIsDocked;
private boolean mLastPulsing; private boolean mLastPulsing;
private int mLastBiometricMode; private int mLastBiometricMode;
private boolean mGoingToSleepVisibleNotOccluded;
private boolean mLastLockVisible; private boolean mLastLockVisible;
private OnDismissAction mAfterKeyguardGoneAction; private OnDismissAction mAfterKeyguardGoneAction;
@@ -450,36 +449,11 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
} }
} }
public boolean isGoingToSleepVisibleNotOccluded() {
return mGoingToSleepVisibleNotOccluded;
}
@Override
public void onStartedGoingToSleep() {
mGoingToSleepVisibleNotOccluded = isShowing() && !isOccluded();
}
@Override @Override
public void onFinishedGoingToSleep() { public void onFinishedGoingToSleep() {
mGoingToSleepVisibleNotOccluded = false;
mBouncer.onScreenTurnedOff(); mBouncer.onScreenTurnedOff();
} }
@Override
public void onStartedWakingUp() {
// TODO: remove
}
@Override
public void onScreenTurningOn() {
// TODO: remove
}
@Override
public void onScreenTurnedOn() {
// TODO: remove
}
@Override @Override
public void onRemoteInputActive(boolean active) { public void onRemoteInputActive(boolean active) {
mRemoteInputActive = active; mRemoteInputActive = active;
@@ -999,7 +973,6 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
pw.println(" mOccluded: " + mOccluded); pw.println(" mOccluded: " + mOccluded);
pw.println(" mRemoteInputActive: " + mRemoteInputActive); pw.println(" mRemoteInputActive: " + mRemoteInputActive);
pw.println(" mDozing: " + mDozing); pw.println(" mDozing: " + mDozing);
pw.println(" mGoingToSleepVisibleNotOccluded: " + mGoingToSleepVisibleNotOccluded);
pw.println(" mAfterKeyguardGoneAction: " + mAfterKeyguardGoneAction); pw.println(" mAfterKeyguardGoneAction: " + mAfterKeyguardGoneAction);
pw.println(" mAfterKeyguardGoneRunnables: " + mAfterKeyguardGoneRunnables); pw.println(" mAfterKeyguardGoneRunnables: " + mAfterKeyguardGoneRunnables);
pw.println(" mPendingWakeupAction: " + mPendingWakeupAction); pw.println(" mPendingWakeupAction: " + mPendingWakeupAction);