Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +82 −71 Original line number Diff line number Diff line Loading @@ -175,6 +175,8 @@ import com.android.systemui.doze.DozeLog; import com.android.systemui.fragments.ExtensionFragmentListener; import com.android.systemui.fragments.FragmentHostManager; import com.android.systemui.keyguard.KeyguardViewMediator; import com.android.systemui.keyguard.ScreenLifecycle; import com.android.systemui.keyguard.WakefulnessLifecycle; import com.android.systemui.plugins.ActivityStarter; import com.android.systemui.plugins.qs.QS; import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin.MenuItem; Loading Loading @@ -423,8 +425,6 @@ public class StatusBar extends SystemUI implements DemoMode, private DozeServiceHost mDozeServiceHost; private boolean mWakeUpComingFromTouch; private PointF mWakeUpTouchLocation; private boolean mScreenTurningOn; private boolean mScreenFullyOff; int mPixelFormat; Object mQueueLock = new Object(); Loading Loading @@ -635,11 +635,6 @@ public class StatusBar extends SystemUI implements DemoMode, // Fingerprint (as computed by getLoggingFingerprint() of the last logged state. private int mLastLoggedStateFingerprint; /** * If set, the device has started going to sleep but isn't fully non-interactive yet. */ protected boolean mStartedGoingToSleep; private final OnChildLocationsChangedListener mNotificationLocationsChangedListener = new OnChildLocationsChangedListener() { @Override Loading Loading @@ -738,6 +733,8 @@ public class StatusBar extends SystemUI implements DemoMode, private String mKeyToRemoveOnGutsClosed; private SysuiColorExtractor mColorExtractor; private ForegroundServiceController mForegroundServiceController; private ScreenLifecycle mScreenLifecycle; private WakefulnessLifecycle mWakefulnessLifecycle; private void recycleAllVisibilityObjects(ArraySet<NotificationVisibility> array) { final int N = array.size(); Loading Loading @@ -776,6 +773,10 @@ public class StatusBar extends SystemUI implements DemoMode, mNetworkController = Dependency.get(NetworkController.class); mUserSwitcherController = Dependency.get(UserSwitcherController.class); mKeyguardMonitor = (KeyguardMonitorImpl) Dependency.get(KeyguardMonitor.class); mScreenLifecycle = Dependency.get(ScreenLifecycle.class); mScreenLifecycle.addObserver(mScreenObserver); mWakefulnessLifecycle = Dependency.get(WakefulnessLifecycle.class); mWakefulnessLifecycle.addObserver(mWakefulnessObserver); mBatteryController = Dependency.get(BatteryController.class); mAssistManager = Dependency.get(AssistManager.class); mDeviceProvisionedController = Dependency.get(DeviceProvisionedController.class); Loading Loading @@ -2832,12 +2833,6 @@ public class StatusBar extends SystemUI implements DemoMode, mRemoteInputEntriesToRemoveOnCollapse.clear(); } public void onScreenTurnedOff() { mScreenFullyOff = true; mFalsingManager.onScreenOff(); updateIsKeyguard(); } public NotificationStackScrollLayout getNotificationScrollLayout() { return mStackScroller; } Loading Loading @@ -4232,7 +4227,7 @@ public class StatusBar extends SystemUI implements DemoMode, // late in the transition, so we also allow the device to start dozing once the screen has // turned off fully. boolean keyguardForDozing = mDozingRequested && (!mDeviceInteractive || mStartedGoingToSleep && (mScreenFullyOff || mIsKeyguard)); (!mDeviceInteractive || isGoingToSleep() && (isScreenFullyOff() || mIsKeyguard)); boolean shouldBeKeyguard = mKeyguardRequested || keyguardForDozing; if (keyguardForDozing) { updatePanelExpansionForKeyguard(); Loading Loading @@ -5121,15 +5116,12 @@ public class StatusBar extends SystemUI implements DemoMode, recomputeDisableFlags(true /* animate */); } public void onStartedGoingToSleep() { mStartedGoingToSleep = true; } WakefulnessLifecycle.Observer mWakefulnessObserver = new WakefulnessLifecycle.Observer() { @Override public void onFinishedGoingToSleep() { mNotificationPanel.onAffordanceLaunchEnded(); releaseGestureWakeLock(); mLaunchCameraOnScreenTurningOn = false; mStartedGoingToSleep = false; mDeviceInteractive = false; mWakeUpComingFromTouch = false; mWakeUpTouchLocation = null; Loading Loading @@ -5157,6 +5149,7 @@ public class StatusBar extends SystemUI implements DemoMode, updateIsKeyguard(); } @Override public void onStartedWakingUp() { mDeviceInteractive = true; mStackScroller.setAnimationsEnabled(true); Loading @@ -5165,10 +5158,11 @@ public class StatusBar extends SystemUI implements DemoMode, updateVisibleToUser(); updateIsKeyguard(); } }; ScreenLifecycle.Observer mScreenObserver = new ScreenLifecycle.Observer() { @Override public void onScreenTurningOn() { mScreenFullyOff = false; mScreenTurningOn = true; mFalsingManager.onScreenTurningOn(); mNotificationPanel.onScreenTurningOn(); if (mLaunchCameraOnScreenTurningOn) { Loading @@ -5177,22 +5171,29 @@ public class StatusBar extends SystemUI implements DemoMode, } } @Override public void onScreenTurnedOn() { mDozeScrimController.onScreenTurnedOn(); } @Override public void onScreenTurnedOff() { mFalsingManager.onScreenOff(); updateIsKeyguard(); } }; private void vibrateForCameraGesture() { // Make sure to pass -1 for repeat so VibratorService doesn't stop us when going to sleep. mVibrator.vibrate(mCameraLaunchGestureVibePattern, -1 /* repeat */); } public void onScreenTurnedOn() { mScreenTurningOn = false; mDozeScrimController.onScreenTurnedOn(); } /** * @return true if the screen is currently fully off, i.e. has finished turning off and has * since not started turning on. */ public boolean isScreenFullyOff() { return mScreenFullyOff; return mScreenLifecycle.getScreenState() == ScreenLifecycle.SCREEN_OFF; } @Override Loading Loading @@ -5239,7 +5240,7 @@ public class StatusBar extends SystemUI implements DemoMode, @Override public void onCameraLaunchGestureDetected(int source) { mLastCameraLaunchSource = source; if (mStartedGoingToSleep) { if (isGoingToSleep()) { if (DEBUG_CAMERA_LIFT) Slog.d(TAG, "Finish going to sleep before launching camera"); mLaunchCameraOnFinishedGoingToSleep = true; return; Loading @@ -5266,7 +5267,7 @@ public class StatusBar extends SystemUI implements DemoMode, mScrimController.dontAnimateBouncerChangesUntilNextFrame(); mGestureWakeLock.acquire(LAUNCH_TRANSITION_TIMEOUT_MS + 1000L); } if (mScreenTurningOn || mStatusBarKeyguardViewManager.isScreenTurnedOn()) { if (isScreenTurningOnOrOn()) { if (DEBUG_CAMERA_LIFT) Slog.d(TAG, "Launching camera"); mNotificationPanel.launchCamera(mDeviceInteractive /* animate */, source); } else { Loading @@ -5292,6 +5293,16 @@ public class StatusBar extends SystemUI implements DemoMode, return true; } private boolean isGoingToSleep() { return mWakefulnessLifecycle.getWakefulness() == WakefulnessLifecycle.WAKEFULNESS_GOING_TO_SLEEP; } private boolean isScreenTurningOnOrOn() { return mScreenLifecycle.getScreenState() == ScreenLifecycle.SCREEN_TURNING_ON || mScreenLifecycle.getScreenState() == ScreenLifecycle.SCREEN_ON; } public void notifyFpAuthModeChanged() { updateDozing(); } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +4 −20 Original line number Diff line number Diff line Loading @@ -80,7 +80,6 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb private ViewGroup mContainer; private boolean mDeviceInteractive = false; private boolean mScreenTurnedOn; protected KeyguardBouncer mBouncer; protected boolean mShowing; Loading @@ -100,7 +99,6 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb private OnDismissAction mAfterKeyguardGoneAction; private final ArrayList<Runnable> mAfterKeyguardGoneRunnables = new ArrayList<>(); private boolean mDeviceWillWakeUp; private boolean mDeferScrimFadeOut; private final KeyguardUpdateMonitorCallback mUpdateMonitorCallback = Loading Loading @@ -213,31 +211,19 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb } public void onStartedGoingToSleep() { mStatusBar.onStartedGoingToSleep(); // TODO: remove } public void onFinishedGoingToSleep() { mDeviceInteractive = false; mStatusBar.onFinishedGoingToSleep(); mBouncer.onScreenTurnedOff(); } public void onStartedWakingUp() { Trace.beginSection("StatusBarKeyguardViewManager#onStartedWakingUp"); mDeviceInteractive = true; mDeviceWillWakeUp = false; mStatusBar.onStartedWakingUp(); Trace.endSection(); // TODO: remove } public void onScreenTurningOn() { Trace.beginSection("StatusBarKeyguardViewManager#onScreenTurningOn"); mStatusBar.onScreenTurningOn(); Trace.endSection(); } public boolean isScreenTurnedOn() { return mScreenTurnedOn; // TODO: remove } public void onScreenTurnedOn() { Loading @@ -249,7 +235,6 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb true /* skipFirstFrame */); updateStates(); } mStatusBar.onScreenTurnedOn(); Trace.endSection(); } Loading @@ -269,11 +254,10 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb public void onScreenTurnedOff() { mScreenTurnedOn = false; mStatusBar.onScreenTurnedOff(); } public void notifyDeviceWakeUpRequested() { mDeviceWillWakeUp = !mDeviceInteractive; // TODO: remove } public void setNeedsInput(boolean needsInput) { Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +82 −71 Original line number Diff line number Diff line Loading @@ -175,6 +175,8 @@ import com.android.systemui.doze.DozeLog; import com.android.systemui.fragments.ExtensionFragmentListener; import com.android.systemui.fragments.FragmentHostManager; import com.android.systemui.keyguard.KeyguardViewMediator; import com.android.systemui.keyguard.ScreenLifecycle; import com.android.systemui.keyguard.WakefulnessLifecycle; import com.android.systemui.plugins.ActivityStarter; import com.android.systemui.plugins.qs.QS; import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin.MenuItem; Loading Loading @@ -423,8 +425,6 @@ public class StatusBar extends SystemUI implements DemoMode, private DozeServiceHost mDozeServiceHost; private boolean mWakeUpComingFromTouch; private PointF mWakeUpTouchLocation; private boolean mScreenTurningOn; private boolean mScreenFullyOff; int mPixelFormat; Object mQueueLock = new Object(); Loading Loading @@ -635,11 +635,6 @@ public class StatusBar extends SystemUI implements DemoMode, // Fingerprint (as computed by getLoggingFingerprint() of the last logged state. private int mLastLoggedStateFingerprint; /** * If set, the device has started going to sleep but isn't fully non-interactive yet. */ protected boolean mStartedGoingToSleep; private final OnChildLocationsChangedListener mNotificationLocationsChangedListener = new OnChildLocationsChangedListener() { @Override Loading Loading @@ -738,6 +733,8 @@ public class StatusBar extends SystemUI implements DemoMode, private String mKeyToRemoveOnGutsClosed; private SysuiColorExtractor mColorExtractor; private ForegroundServiceController mForegroundServiceController; private ScreenLifecycle mScreenLifecycle; private WakefulnessLifecycle mWakefulnessLifecycle; private void recycleAllVisibilityObjects(ArraySet<NotificationVisibility> array) { final int N = array.size(); Loading Loading @@ -776,6 +773,10 @@ public class StatusBar extends SystemUI implements DemoMode, mNetworkController = Dependency.get(NetworkController.class); mUserSwitcherController = Dependency.get(UserSwitcherController.class); mKeyguardMonitor = (KeyguardMonitorImpl) Dependency.get(KeyguardMonitor.class); mScreenLifecycle = Dependency.get(ScreenLifecycle.class); mScreenLifecycle.addObserver(mScreenObserver); mWakefulnessLifecycle = Dependency.get(WakefulnessLifecycle.class); mWakefulnessLifecycle.addObserver(mWakefulnessObserver); mBatteryController = Dependency.get(BatteryController.class); mAssistManager = Dependency.get(AssistManager.class); mDeviceProvisionedController = Dependency.get(DeviceProvisionedController.class); Loading Loading @@ -2832,12 +2833,6 @@ public class StatusBar extends SystemUI implements DemoMode, mRemoteInputEntriesToRemoveOnCollapse.clear(); } public void onScreenTurnedOff() { mScreenFullyOff = true; mFalsingManager.onScreenOff(); updateIsKeyguard(); } public NotificationStackScrollLayout getNotificationScrollLayout() { return mStackScroller; } Loading Loading @@ -4232,7 +4227,7 @@ public class StatusBar extends SystemUI implements DemoMode, // late in the transition, so we also allow the device to start dozing once the screen has // turned off fully. boolean keyguardForDozing = mDozingRequested && (!mDeviceInteractive || mStartedGoingToSleep && (mScreenFullyOff || mIsKeyguard)); (!mDeviceInteractive || isGoingToSleep() && (isScreenFullyOff() || mIsKeyguard)); boolean shouldBeKeyguard = mKeyguardRequested || keyguardForDozing; if (keyguardForDozing) { updatePanelExpansionForKeyguard(); Loading Loading @@ -5121,15 +5116,12 @@ public class StatusBar extends SystemUI implements DemoMode, recomputeDisableFlags(true /* animate */); } public void onStartedGoingToSleep() { mStartedGoingToSleep = true; } WakefulnessLifecycle.Observer mWakefulnessObserver = new WakefulnessLifecycle.Observer() { @Override public void onFinishedGoingToSleep() { mNotificationPanel.onAffordanceLaunchEnded(); releaseGestureWakeLock(); mLaunchCameraOnScreenTurningOn = false; mStartedGoingToSleep = false; mDeviceInteractive = false; mWakeUpComingFromTouch = false; mWakeUpTouchLocation = null; Loading Loading @@ -5157,6 +5149,7 @@ public class StatusBar extends SystemUI implements DemoMode, updateIsKeyguard(); } @Override public void onStartedWakingUp() { mDeviceInteractive = true; mStackScroller.setAnimationsEnabled(true); Loading @@ -5165,10 +5158,11 @@ public class StatusBar extends SystemUI implements DemoMode, updateVisibleToUser(); updateIsKeyguard(); } }; ScreenLifecycle.Observer mScreenObserver = new ScreenLifecycle.Observer() { @Override public void onScreenTurningOn() { mScreenFullyOff = false; mScreenTurningOn = true; mFalsingManager.onScreenTurningOn(); mNotificationPanel.onScreenTurningOn(); if (mLaunchCameraOnScreenTurningOn) { Loading @@ -5177,22 +5171,29 @@ public class StatusBar extends SystemUI implements DemoMode, } } @Override public void onScreenTurnedOn() { mDozeScrimController.onScreenTurnedOn(); } @Override public void onScreenTurnedOff() { mFalsingManager.onScreenOff(); updateIsKeyguard(); } }; private void vibrateForCameraGesture() { // Make sure to pass -1 for repeat so VibratorService doesn't stop us when going to sleep. mVibrator.vibrate(mCameraLaunchGestureVibePattern, -1 /* repeat */); } public void onScreenTurnedOn() { mScreenTurningOn = false; mDozeScrimController.onScreenTurnedOn(); } /** * @return true if the screen is currently fully off, i.e. has finished turning off and has * since not started turning on. */ public boolean isScreenFullyOff() { return mScreenFullyOff; return mScreenLifecycle.getScreenState() == ScreenLifecycle.SCREEN_OFF; } @Override Loading Loading @@ -5239,7 +5240,7 @@ public class StatusBar extends SystemUI implements DemoMode, @Override public void onCameraLaunchGestureDetected(int source) { mLastCameraLaunchSource = source; if (mStartedGoingToSleep) { if (isGoingToSleep()) { if (DEBUG_CAMERA_LIFT) Slog.d(TAG, "Finish going to sleep before launching camera"); mLaunchCameraOnFinishedGoingToSleep = true; return; Loading @@ -5266,7 +5267,7 @@ public class StatusBar extends SystemUI implements DemoMode, mScrimController.dontAnimateBouncerChangesUntilNextFrame(); mGestureWakeLock.acquire(LAUNCH_TRANSITION_TIMEOUT_MS + 1000L); } if (mScreenTurningOn || mStatusBarKeyguardViewManager.isScreenTurnedOn()) { if (isScreenTurningOnOrOn()) { if (DEBUG_CAMERA_LIFT) Slog.d(TAG, "Launching camera"); mNotificationPanel.launchCamera(mDeviceInteractive /* animate */, source); } else { Loading @@ -5292,6 +5293,16 @@ public class StatusBar extends SystemUI implements DemoMode, return true; } private boolean isGoingToSleep() { return mWakefulnessLifecycle.getWakefulness() == WakefulnessLifecycle.WAKEFULNESS_GOING_TO_SLEEP; } private boolean isScreenTurningOnOrOn() { return mScreenLifecycle.getScreenState() == ScreenLifecycle.SCREEN_TURNING_ON || mScreenLifecycle.getScreenState() == ScreenLifecycle.SCREEN_ON; } public void notifyFpAuthModeChanged() { updateDozing(); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +4 −20 Original line number Diff line number Diff line Loading @@ -80,7 +80,6 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb private ViewGroup mContainer; private boolean mDeviceInteractive = false; private boolean mScreenTurnedOn; protected KeyguardBouncer mBouncer; protected boolean mShowing; Loading @@ -100,7 +99,6 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb private OnDismissAction mAfterKeyguardGoneAction; private final ArrayList<Runnable> mAfterKeyguardGoneRunnables = new ArrayList<>(); private boolean mDeviceWillWakeUp; private boolean mDeferScrimFadeOut; private final KeyguardUpdateMonitorCallback mUpdateMonitorCallback = Loading Loading @@ -213,31 +211,19 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb } public void onStartedGoingToSleep() { mStatusBar.onStartedGoingToSleep(); // TODO: remove } public void onFinishedGoingToSleep() { mDeviceInteractive = false; mStatusBar.onFinishedGoingToSleep(); mBouncer.onScreenTurnedOff(); } public void onStartedWakingUp() { Trace.beginSection("StatusBarKeyguardViewManager#onStartedWakingUp"); mDeviceInteractive = true; mDeviceWillWakeUp = false; mStatusBar.onStartedWakingUp(); Trace.endSection(); // TODO: remove } public void onScreenTurningOn() { Trace.beginSection("StatusBarKeyguardViewManager#onScreenTurningOn"); mStatusBar.onScreenTurningOn(); Trace.endSection(); } public boolean isScreenTurnedOn() { return mScreenTurnedOn; // TODO: remove } public void onScreenTurnedOn() { Loading @@ -249,7 +235,6 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb true /* skipFirstFrame */); updateStates(); } mStatusBar.onScreenTurnedOn(); Trace.endSection(); } Loading @@ -269,11 +254,10 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb public void onScreenTurnedOff() { mScreenTurnedOn = false; mStatusBar.onScreenTurnedOff(); } public void notifyDeviceWakeUpRequested() { mDeviceWillWakeUp = !mDeviceInteractive; // TODO: remove } public void setNeedsInput(boolean needsInput) { Loading