blob: 0c47d1468a7f96b458c3d3c5ef1b27125dfda243 [file] [log] [blame]
Jorim Jaggi5cf17872014-03-26 18:31:48 +01001/*
2 * Copyright (C) 2014 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License
15 */
16
17package com.android.systemui.statusbar.phone;
18
Jason Monk297c04e2018-08-23 17:16:59 -040019import static com.android.systemui.plugins.ActivityStarter.OnDismissAction;
Selim Cinek06c12d62019-07-01 19:44:18 -070020import static com.android.systemui.statusbar.phone.BiometricUnlockController.MODE_UNLOCK_FADING;
Gilad Brettercb51b8b2018-03-22 17:04:51 +020021import static com.android.systemui.statusbar.phone.BiometricUnlockController.MODE_WAKE_AND_UNLOCK;
22import static com.android.systemui.statusbar.phone.BiometricUnlockController.MODE_WAKE_AND_UNLOCK_PULSING;
Jorim Jaggif5304ad2017-07-17 18:31:13 +020023
Jorim Jaggi786afcb2014-09-25 02:41:29 +020024import android.content.ComponentCallbacks2;
Jorim Jaggi5cf17872014-03-26 18:31:48 +010025import android.content.Context;
Jason Chang1e4a4bd2018-05-22 17:30:19 +080026import android.content.res.ColorStateList;
Jorim Jaggi5cf17872014-03-26 18:31:48 +010027import android.os.Bundle;
Jorim Jaggie29b2db2014-05-30 23:17:03 +020028import android.os.SystemClock;
Tej Singhdd7bd352018-02-09 19:33:15 -080029import android.util.StatsLog;
Jorim Jaggidf993512014-05-13 23:06:35 +020030import android.view.KeyEvent;
Jorim Jaggi5cf17872014-03-26 18:31:48 +010031import android.view.View;
32import android.view.ViewGroup;
Jorim Jaggib774e552015-08-24 14:52:45 -070033import android.view.ViewRootImpl;
Jorim Jaggi786afcb2014-09-25 02:41:29 +020034import android.view.WindowManagerGlobal;
Jorim Jaggi5cf17872014-03-26 18:31:48 +010035
Lucas Dupinbc9aac12018-03-04 20:18:15 -080036import com.android.internal.util.LatencyTracker;
Jorim Jaggi5cf17872014-03-26 18:31:48 +010037import com.android.internal.widget.LockPatternUtils;
Adrian Roosb6011622014-05-14 15:52:53 +020038import com.android.keyguard.KeyguardUpdateMonitor;
Jorim Jaggia9d7fcd2017-05-18 01:08:12 +020039import com.android.keyguard.KeyguardUpdateMonitorCallback;
Jorim Jaggi5cf17872014-03-26 18:31:48 +010040import com.android.keyguard.ViewMediatorCallback;
Lucas Dupin2e838ac2019-04-17 16:50:58 -070041import com.android.settingslib.animation.AppearAnimationUtils;
Jorim Jaggi8adb30c2016-09-13 15:02:22 -070042import com.android.systemui.DejankUtils;
Jason Monk421a9412017-02-06 09:15:21 -080043import com.android.systemui.Dependency;
Xiyuan Xia1b30f792016-01-06 08:50:30 -080044import com.android.systemui.SystemUIFactory;
Lucas Dupinafffbf92019-04-09 19:52:26 -070045import com.android.systemui.dock.DockManager;
Jorim Jaggi241ae102016-11-02 21:57:33 -070046import com.android.systemui.keyguard.DismissCallbackRegistry;
Dave Mankoff2339f592019-06-28 16:33:25 -040047import com.android.systemui.plugins.FalsingManager;
Beverly8fdb5332019-02-04 14:29:49 -050048import com.android.systemui.plugins.statusbar.StatusBarStateController;
Lucas Dupinafffbf92019-04-09 19:52:26 -070049import com.android.systemui.shared.system.QuickStepContract;
Jim Miller25d7e512015-03-03 17:12:09 -080050import com.android.systemui.statusbar.CommandQueue;
Lucas Dupin269feda2019-04-29 17:11:02 -070051import com.android.systemui.statusbar.CrossFadeHelper;
Jason Monk297c04e2018-08-23 17:16:59 -040052import com.android.systemui.statusbar.NotificationMediaManager;
Adrian Roosd28ccd72016-01-06 15:23:14 +010053import com.android.systemui.statusbar.RemoteInputController;
Lucas Dupin2e838ac2019-04-17 16:50:58 -070054import com.android.systemui.statusbar.StatusBarState;
Beverly8fdb5332019-02-04 14:29:49 -050055import com.android.systemui.statusbar.SysuiStatusBarStateController;
Selim Cinek06c12d62019-07-01 19:44:18 -070056import com.android.systemui.statusbar.notification.ViewGroupFadeHelper;
Lucas Dupin15a6b6c2018-04-16 14:50:20 +080057import com.android.systemui.statusbar.phone.KeyguardBouncer.BouncerExpansionCallback;
Lucas Dupinafffbf92019-04-09 19:52:26 -070058import com.android.systemui.statusbar.policy.ConfigurationController;
Jason Monk1fd3fc32018-08-14 17:20:09 -040059import com.android.systemui.statusbar.policy.KeyguardMonitor;
Evan Laird2d620fa2018-10-30 13:03:31 -040060import com.android.systemui.statusbar.policy.KeyguardMonitorImpl;
Jorim Jaggi5cf17872014-03-26 18:31:48 +010061
Lucas Dupin15a6b6c2018-04-16 14:50:20 +080062import java.io.PrintWriter;
Jorim Jaggibcbe9482016-11-23 17:37:49 +010063import java.util.ArrayList;
64
Jorim Jaggi5cf17872014-03-26 18:31:48 +010065/**
66 * Manages creating, showing, hiding and resetting the keyguard within the status bar. Calls back
67 * via {@link ViewMediatorCallback} to poke the wake lock and report that the keyguard is done,
68 * which is in turn, reported to this class by the current
69 * {@link com.android.keyguard.KeyguardViewBase}.
70 */
Evan Laird878c8532018-10-15 15:54:29 -040071public class StatusBarKeyguardViewManager implements RemoteInputController.Callback,
Lucas Dupin2e838ac2019-04-17 16:50:58 -070072 StatusBarStateController.StateListener, ConfigurationController.ConfigurationListener,
Selim Cineka678b0e2019-07-23 13:12:55 -070073 PanelExpansionListener, NavigationModeController.ModeChangedListener {
Jorim Jaggi76a16232014-08-08 17:00:47 +020074
75 // When hiding the Keyguard with timing supplied from WindowManager, better be early than late.
Jorim Jaggi56fd70c2016-10-27 19:57:08 -070076 private static final long HIDE_TIMING_CORRECTION_MS = - 16 * 3;
Jorim Jaggi76a16232014-08-08 17:00:47 +020077
Jorim Jaggi416493b2014-09-13 03:57:32 +020078 // Delay for showing the navigation bar when the bouncer appears. This should be kept in sync
79 // with the appear animations of the PIN/pattern/password views.
80 private static final long NAV_BAR_SHOW_DELAY_BOUNCER = 320;
81
Jorim Jaggi007f0e82015-08-14 13:56:01 -070082 private static final long WAKE_AND_UNLOCK_SCRIM_FADEOUT_DURATION_MS = 200;
83
Jorim Jaggie8fde5d2016-06-30 23:41:37 -070084 // Duration of the Keyguard dismissal animation in case the user is currently locked. This is to
85 // make everything a bit slower to bridge a gap until the user is unlocked and home screen has
86 // dranw its first frame.
87 private static final long KEYGUARD_DISMISS_DURATION_LOCKED = 2000;
88
Jorim Jaggi5cf17872014-03-26 18:31:48 +010089 private static String TAG = "StatusBarKeyguardViewManager";
90
Xiyuan Xia1b30f792016-01-06 08:50:30 -080091 protected final Context mContext;
Lucas Dupin1a8588d2018-08-21 12:18:47 -070092 private final StatusBarWindowController mStatusBarWindowController;
Lucas Dupin15a6b6c2018-04-16 14:50:20 +080093 private final BouncerExpansionCallback mExpansionCallback = new BouncerExpansionCallback() {
94 @Override
95 public void onFullyShown() {
96 updateStates();
Lucas Dupin3cfd6882019-03-19 15:22:03 -070097 mStatusBar.wakeUpIfDozing(SystemClock.uptimeMillis(), mContainer, "BOUNCER_VISIBLE");
Lucas Dupin2e838ac2019-04-17 16:50:58 -070098 updateLockIcon();
Lucas Dupin15a6b6c2018-04-16 14:50:20 +080099 }
100
101 @Override
Lucas Dupin84993542018-10-11 19:23:45 -0700102 public void onStartingToHide() {
103 updateStates();
104 }
105
106 @Override
Lucas Dupin2e838ac2019-04-17 16:50:58 -0700107 public void onStartingToShow() {
108 updateLockIcon();
Lucas Dupin15a6b6c2018-04-16 14:50:20 +0800109 }
Lucas Dupin27321c42019-03-20 16:22:24 -0700110
111 @Override
Lucas Dupin2e838ac2019-04-17 16:50:58 -0700112 public void onFullyHidden() {
113 updateStates();
114 updateLockIcon();
Lucas Dupin27321c42019-03-20 16:22:24 -0700115 }
Lucas Dupin15a6b6c2018-04-16 14:50:20 +0800116 };
Lucas Dupinafffbf92019-04-09 19:52:26 -0700117 private final DockManager.DockEventListener mDockEventListener =
118 new DockManager.DockEventListener() {
119 @Override
120 public void onEvent(int event) {
121 boolean isDocked = mDockManager.isDocked();
122 if (isDocked == mIsDocked) {
123 return;
124 }
125 mIsDocked = isDocked;
126 updateStates();
127 }
128 };
Jorim Jaggi5cf17872014-03-26 18:31:48 +0100129
Xiyuan Xia1b30f792016-01-06 08:50:30 -0800130 protected LockPatternUtils mLockPatternUtils;
131 protected ViewMediatorCallback mViewMediatorCallback;
Jason Monk2a6ea9c2017-01-26 11:14:51 -0500132 protected StatusBar mStatusBar;
Lucas Dupinbc9aac12018-03-04 20:18:15 -0800133 private NotificationPanelView mNotificationPanelView;
Gilad Brettercb51b8b2018-03-22 17:04:51 +0200134 private BiometricUnlockController mBiometricUnlockController;
Jorim Jaggi5cf17872014-03-26 18:31:48 +0100135
Jorim Jaggi5cf17872014-03-26 18:31:48 +0100136 private ViewGroup mContainer;
Lucas Dupin2e838ac2019-04-17 16:50:58 -0700137 private ViewGroup mLockIconContainer;
Selim Cinek06c12d62019-07-01 19:44:18 -0700138 private View mNotificationContainer;
Jorim Jaggi5cf17872014-03-26 18:31:48 +0100139
Xiyuan Xia1b30f792016-01-06 08:50:30 -0800140 protected KeyguardBouncer mBouncer;
141 protected boolean mShowing;
142 protected boolean mOccluded;
143 protected boolean mRemoteInputActive;
Adrian Roos087826a2017-04-19 16:59:09 -0700144 private boolean mDozing;
Lucas Dupinafffbf92019-04-09 19:52:26 -0700145 private boolean mPulsing;
146 private boolean mGesturalNav;
147 private boolean mIsDocked;
Jorim Jaggi5cf17872014-03-26 18:31:48 +0100148
Xiyuan Xia1b30f792016-01-06 08:50:30 -0800149 protected boolean mFirstUpdate = true;
150 protected boolean mLastShowing;
151 protected boolean mLastOccluded;
Adrian Roosb6011622014-05-14 15:52:53 +0200152 private boolean mLastBouncerShowing;
153 private boolean mLastBouncerDismissible;
Xiyuan Xia1b30f792016-01-06 08:50:30 -0800154 protected boolean mLastRemoteInputActive;
Adrian Roos087826a2017-04-19 16:59:09 -0700155 private boolean mLastDozing;
Lucas Dupinafffbf92019-04-09 19:52:26 -0700156 private boolean mLastGesturalNav;
157 private boolean mLastIsDocked;
158 private boolean mLastPulsing;
Gilad Brettercb51b8b2018-03-22 17:04:51 +0200159 private int mLastBiometricMode;
Lucas Dupin16cfe452018-02-08 13:14:50 -0800160 private boolean mGoingToSleepVisibleNotOccluded;
Lucas Dupin269feda2019-04-29 17:11:02 -0700161 private boolean mLastLockVisible;
Adrian Roosd28ccd72016-01-06 15:23:14 +0100162
Jorim Jaggi746f7fa2014-08-27 17:52:46 +0200163 private OnDismissAction mAfterKeyguardGoneAction;
Jorim Jaggibcbe9482016-11-23 17:37:49 +0100164 private final ArrayList<Runnable> mAfterKeyguardGoneRunnables = new ArrayList<>();
Adrian Roosb6011622014-05-14 15:52:53 +0200165
Adrian Roosfee661c2017-08-04 17:05:45 +0200166 // Dismiss action to be launched when we stop dozing or the keyguard is gone.
Adrian Roos34e65402017-08-07 19:32:45 +0200167 private DismissWithActionRequest mPendingWakeupAction;
Evan Laird2d620fa2018-10-30 13:03:31 -0400168 private final KeyguardMonitorImpl mKeyguardMonitor =
169 (KeyguardMonitorImpl) Dependency.get(KeyguardMonitor.class);
Jason Monk297c04e2018-08-23 17:16:59 -0400170 private final NotificationMediaManager mMediaManager =
171 Dependency.get(NotificationMediaManager.class);
Selim Cinek06c12d62019-07-01 19:44:18 -0700172 private final SysuiStatusBarStateController mStatusBarStateController =
173 (SysuiStatusBarStateController) Dependency.get(StatusBarStateController.class);
Lucas Dupinafffbf92019-04-09 19:52:26 -0700174 private final DockManager mDockManager;
Selim Cinek06c12d62019-07-01 19:44:18 -0700175 private KeyguardBypassController mBypassController;
Adrian Roosfee661c2017-08-04 17:05:45 +0200176
Jorim Jaggia9d7fcd2017-05-18 01:08:12 +0200177 private final KeyguardUpdateMonitorCallback mUpdateMonitorCallback =
178 new KeyguardUpdateMonitorCallback() {
179 @Override
180 public void onEmergencyCallAction() {
181
182 // Since we won't get a setOccluded call we have to reset the view manually such that
183 // the bouncer goes away.
184 if (mOccluded) {
Lucas Dupin28f90292017-08-08 18:07:49 -0400185 reset(true /* hideBouncerWhenShowing */);
Jorim Jaggia9d7fcd2017-05-18 01:08:12 +0200186 }
187 }
188 };
189
Jorim Jaggi5cf17872014-03-26 18:31:48 +0100190 public StatusBarKeyguardViewManager(Context context, ViewMediatorCallback callback,
191 LockPatternUtils lockPatternUtils) {
192 mContext = context;
193 mViewMediatorCallback = callback;
194 mLockPatternUtils = lockPatternUtils;
Lucas Dupin1a8588d2018-08-21 12:18:47 -0700195 mStatusBarWindowController = Dependency.get(StatusBarWindowController.class);
Jorim Jaggia9d7fcd2017-05-18 01:08:12 +0200196 KeyguardUpdateMonitor.getInstance(context).registerCallback(mUpdateMonitorCallback);
Lucas Dupin2e838ac2019-04-17 16:50:58 -0700197 mStatusBarStateController.addCallback(this);
Lucas Dupinafffbf92019-04-09 19:52:26 -0700198 Dependency.get(ConfigurationController.class).addCallback(this);
Lucas Dupinbe050b22019-05-02 16:38:33 -0700199 mGesturalNav = QuickStepContract.isGesturalMode(
Winson Chung1aa24b92019-04-24 15:17:33 -0700200 Dependency.get(NavigationModeController.class).addListener(this));
Lucas Dupind93e95f2019-05-01 00:49:35 +0000201 mDockManager = Dependency.get(DockManager.class);
Lucas Dupinafffbf92019-04-09 19:52:26 -0700202 if (mDockManager != null) {
203 mDockManager.addListener(mDockEventListener);
204 mIsDocked = mDockManager.isDocked();
205 }
Jorim Jaggi5cf17872014-03-26 18:31:48 +0100206 }
207
Jason Monk2a6ea9c2017-01-26 11:14:51 -0500208 public void registerStatusBar(StatusBar statusBar,
Jason Monk421a9412017-02-06 09:15:21 -0800209 ViewGroup container,
Lucas Dupinbc9aac12018-03-04 20:18:15 -0800210 NotificationPanelView notificationPanelView,
Gilad Brettercb51b8b2018-03-22 17:04:51 +0200211 BiometricUnlockController biometricUnlockController,
Lucas Dupin2e838ac2019-04-17 16:50:58 -0700212 DismissCallbackRegistry dismissCallbackRegistry,
Selim Cinek06c12d62019-07-01 19:44:18 -0700213 ViewGroup lockIconContainer, View notificationContainer,
Dave Mankoff2339f592019-06-28 16:33:25 -0400214 KeyguardBypassController bypassController, FalsingManager falsingManager) {
Jason Monk2a6ea9c2017-01-26 11:14:51 -0500215 mStatusBar = statusBar;
Jorim Jaggi5cf17872014-03-26 18:31:48 +0100216 mContainer = container;
Lucas Dupin2e838ac2019-04-17 16:50:58 -0700217 mLockIconContainer = lockIconContainer;
Lucas Dupin269feda2019-04-29 17:11:02 -0700218 if (mLockIconContainer != null) {
219 mLastLockVisible = mLockIconContainer.getVisibility() == View.VISIBLE;
220 }
Gilad Brettercb51b8b2018-03-22 17:04:51 +0200221 mBiometricUnlockController = biometricUnlockController;
Xiyuan Xia1b30f792016-01-06 08:50:30 -0800222 mBouncer = SystemUIFactory.getInstance().createKeyguardBouncer(mContext,
Lucas Dupin15a6b6c2018-04-16 14:50:20 +0800223 mViewMediatorCallback, mLockPatternUtils, container, dismissCallbackRegistry,
Lucas Dupind969b762019-08-15 11:41:52 -0700224 mExpansionCallback, falsingManager, bypassController);
Lucas Dupinbc9aac12018-03-04 20:18:15 -0800225 mNotificationPanelView = notificationPanelView;
Selim Cineka678b0e2019-07-23 13:12:55 -0700226 notificationPanelView.addExpansionListener(this);
Selim Cinek06c12d62019-07-01 19:44:18 -0700227 mBypassController = bypassController;
228 mNotificationContainer = notificationContainer;
Lucas Dupinbc9aac12018-03-04 20:18:15 -0800229 }
230
Lucas Dupin2e838ac2019-04-17 16:50:58 -0700231 @Override
232 public void onPanelExpansionChanged(float expansion, boolean tracking) {
Lucas Dupin6f0d71f2018-03-23 17:26:06 -0700233 // We don't want to translate the bounce when:
234 // • Keyguard is occluded, because we're in a FLAG_SHOW_WHEN_LOCKED activity and need to
235 // conserve the original animation.
236 // • The user quickly taps on the display and we show "swipe up to unlock."
237 // • Keyguard will be dismissed by an action. a.k.a: FLAG_DISMISS_KEYGUARD_ACTIVITY
jovanak5f6dc612018-03-27 11:59:22 -0700238 // • Full-screen user switcher is displayed.
Lucas Dupind7344dc2018-04-20 12:08:52 +0800239 if (mNotificationPanelView.isUnlockHintRunning()) {
Lucas Dupinf9ca35e2018-05-16 20:41:35 -0700240 mBouncer.setExpansion(KeyguardBouncer.EXPANSION_HIDDEN);
Lucas Dupinc516bac2018-06-19 10:50:04 -0700241 } else if (bouncerNeedsScrimming()) {
Lucas Dupinf9ca35e2018-05-16 20:41:35 -0700242 mBouncer.setExpansion(KeyguardBouncer.EXPANSION_VISIBLE);
Lucas Dupin1c327432019-01-03 13:37:53 -0800243 } else if (mShowing) {
Lucas Dupinaaac2cb2018-06-08 14:11:41 -0700244 if (!isWakeAndUnlocking() && !mStatusBar.isInLaunchTransition()) {
Lucas Dupin71dd4842018-05-29 15:41:03 -0700245 mBouncer.setExpansion(expansion);
246 }
Lucas Dupinf9ca35e2018-05-16 20:41:35 -0700247 if (expansion != KeyguardBouncer.EXPANSION_HIDDEN && tracking
248 && mStatusBar.isKeyguardCurrentlySecure()
Lucas Dupin52a95872018-04-20 10:28:07 +0800249 && !mBouncer.isShowing() && !mBouncer.isAnimatingAway()) {
Lucas Dupin71dd4842018-05-29 15:41:03 -0700250 mBouncer.show(false /* resetSecuritySelection */, false /* scrimmed */);
Lucas Dupin3d565fa2018-03-20 15:40:14 -0700251 }
Lucas Dupinf6a1f172019-04-18 20:57:40 -0700252 } else if (mPulsing && expansion == KeyguardBouncer.EXPANSION_VISIBLE) {
253 // Panel expanded while pulsing but didn't translate the bouncer (because we are
254 // unlocked.) Let's simply wake-up to dismiss the lock screen.
255 mStatusBar.wakeUpIfDozing(SystemClock.uptimeMillis(), mContainer, "BOUNCER_VISIBLE");
Lucas Dupinbc9aac12018-03-04 20:18:15 -0800256 }
Lucas Dupin2e838ac2019-04-17 16:50:58 -0700257 }
258
259 @Override
260 public void onQsExpansionChanged(float expansion) {
261 updateLockIcon();
262 }
263
264 private void updateLockIcon() {
Brad Stenning691c2742019-04-19 11:48:00 -0700265 // Not all form factors have a lock icon
266 if (mLockIconContainer == null) {
267 return;
268 }
Lucas Dupin2e838ac2019-04-17 16:50:58 -0700269 boolean keyguardWithoutQs = mStatusBarStateController.getState() == StatusBarState.KEYGUARD
270 && !mNotificationPanelView.isQsExpanded();
Lucas Dupin269feda2019-04-29 17:11:02 -0700271 boolean lockVisible = (mBouncer.isShowing() || keyguardWithoutQs)
Selim Cinek84b2acc2019-07-07 00:40:38 -0700272 && !mBouncer.isAnimatingAway() && !mKeyguardMonitor.isKeyguardFadingAway();
Lucas Dupin2e838ac2019-04-17 16:50:58 -0700273
Lucas Dupin269feda2019-04-29 17:11:02 -0700274 if (mLastLockVisible != lockVisible) {
275 mLastLockVisible = lockVisible;
276 if (lockVisible) {
277 CrossFadeHelper.fadeIn(mLockIconContainer,
278 AppearAnimationUtils.DEFAULT_APPEAR_DURATION /* duration */,
279 0 /* delay */);
280 } else {
Selim Cinek84b2acc2019-07-07 00:40:38 -0700281 final long duration;
282 if (needsBypassFading()) {
283 duration = KeyguardBypassController.BYPASS_PANEL_FADE_DURATION;
284 } else {
285 duration = AppearAnimationUtils.DEFAULT_APPEAR_DURATION / 2;
286 }
Lucas Dupin269feda2019-04-29 17:11:02 -0700287 CrossFadeHelper.fadeOut(mLockIconContainer,
Selim Cinek84b2acc2019-07-07 00:40:38 -0700288 duration /* duration */,
Lucas Dupin269feda2019-04-29 17:11:02 -0700289 0 /* delay */, null /* runnable */);
290 }
Lucas Dupin2e838ac2019-04-17 16:50:58 -0700291 }
Jorim Jaggi5cf17872014-03-26 18:31:48 +0100292 }
293
294 /**
295 * Show the keyguard. Will handle creating and attaching to the view manager
296 * lazily.
297 */
298 public void show(Bundle options) {
Jorim Jaggi03c701e2014-04-02 12:39:51 +0200299 mShowing = true;
Lucas Dupin1a8588d2018-08-21 12:18:47 -0700300 mStatusBarWindowController.setKeyguardShowing(true);
Evan Laird2d620fa2018-10-30 13:03:31 -0400301 mKeyguardMonitor.notifyKeyguardState(
302 mShowing, mKeyguardMonitor.isSecure(), mKeyguardMonitor.isOccluded());
Jorim Jaggife762342016-10-13 14:33:27 +0200303 reset(true /* hideBouncerWhenShowing */);
Tej Singhdd7bd352018-02-09 19:33:15 -0800304 StatsLog.write(StatsLog.KEYGUARD_STATE_CHANGED,
305 StatsLog.KEYGUARD_STATE_CHANGED__STATE__SHOWN);
Jorim Jaggi5cf17872014-03-26 18:31:48 +0100306 }
307
Jorim Jaggia005f1b2014-04-16 19:06:10 +0200308 /**
309 * Shows the notification keyguard or the bouncer depending on
310 * {@link KeyguardBouncer#needsFullscreenBouncer()}.
311 */
Jorim Jaggife762342016-10-13 14:33:27 +0200312 protected void showBouncerOrKeyguard(boolean hideBouncerWhenShowing) {
Adrian Roos41eecff2017-06-29 14:09:52 +0200313 if (mBouncer.needsFullscreenBouncer() && !mDozing) {
Jorim Jaggia005f1b2014-04-16 19:06:10 +0200314 // The keyguard might be showing (already). So we need to hide it.
Jason Monk2a6ea9c2017-01-26 11:14:51 -0500315 mStatusBar.hideKeyguard();
Jorim Jaggi95e89ca2014-11-24 20:12:50 +0100316 mBouncer.show(true /* resetSecuritySelection */);
Jorim Jaggia005f1b2014-04-16 19:06:10 +0200317 } else {
Jason Monk2a6ea9c2017-01-26 11:14:51 -0500318 mStatusBar.showKeyguard();
Jorim Jaggife762342016-10-13 14:33:27 +0200319 if (hideBouncerWhenShowing) {
Jian Jind1b63982018-05-21 15:20:40 -0700320 hideBouncer(shouldDestroyViewOnReset() /* destroyView */);
Jorim Jaggife762342016-10-13 14:33:27 +0200321 mBouncer.prepare();
322 }
Jorim Jaggia005f1b2014-04-16 19:06:10 +0200323 }
Adrian Roos61676aa2017-08-03 16:24:32 +0200324 updateStates();
Jorim Jaggia005f1b2014-04-16 19:06:10 +0200325 }
326
Jian Jind1b63982018-05-21 15:20:40 -0700327 protected boolean shouldDestroyViewOnReset() {
328 return false;
329 }
330
Lucas Dupin3c9df5a2018-02-27 11:32:16 -0800331 private void hideBouncer(boolean destroyView) {
Lucas Dupinafffbf92019-04-09 19:52:26 -0700332 if (mBouncer == null) {
333 return;
334 }
Adrian Roosfee661c2017-08-04 17:05:45 +0200335 mBouncer.hide(destroyView);
Adrian Roos34e65402017-08-07 19:32:45 +0200336 cancelPendingWakeupAction();
Adrian Roosfee661c2017-08-04 17:05:45 +0200337 }
338
Lucas Dupinf9ca35e2018-05-16 20:41:35 -0700339 public void showBouncer(boolean scrimmed) {
340 if (mShowing && !mBouncer.isShowing()) {
341 mBouncer.show(false /* resetSecuritySelection */, scrimmed);
Dan Sandler3806c772014-05-08 14:52:10 -0400342 }
Jorim Jaggi4222d9a2014-04-23 16:13:15 +0200343 updateStates();
Jorim Jaggi5cf17872014-03-26 18:31:48 +0100344 }
345
Jorim Jaggid9449862015-05-29 14:49:08 -0700346 public void dismissWithAction(OnDismissAction r, Runnable cancelAction,
347 boolean afterKeyguardGone) {
Lucas Dupinc80c67e2017-12-04 14:29:10 -0800348 dismissWithAction(r, cancelAction, afterKeyguardGone, null /* message */);
349 }
350
351 public void dismissWithAction(OnDismissAction r, Runnable cancelAction,
352 boolean afterKeyguardGone, String message) {
Adrian Roos0002a452014-07-03 13:46:07 +0200353 if (mShowing) {
Adrian Roos34e65402017-08-07 19:32:45 +0200354 cancelPendingWakeupAction();
Adrian Roosfee661c2017-08-04 17:05:45 +0200355 // If we're dozing, this needs to be delayed until after we wake up - unless we're
356 // wake-and-unlocking, because there dozing will last until the end of the transition.
357 if (mDozing && !isWakeAndUnlocking()) {
Adrian Roos34e65402017-08-07 19:32:45 +0200358 mPendingWakeupAction = new DismissWithActionRequest(
Lucas Dupinc80c67e2017-12-04 14:29:10 -0800359 r, cancelAction, afterKeyguardGone, message);
Adrian Roosfee661c2017-08-04 17:05:45 +0200360 return;
361 }
362
Jorim Jaggi746f7fa2014-08-27 17:52:46 +0200363 if (!afterKeyguardGone) {
Jorim Jaggid9449862015-05-29 14:49:08 -0700364 mBouncer.showWithDismissAction(r, cancelAction);
Jorim Jaggi746f7fa2014-08-27 17:52:46 +0200365 } else {
Jorim Jaggi746f7fa2014-08-27 17:52:46 +0200366 mAfterKeyguardGoneAction = r;
Jorim Jaggi8d5a6e72016-11-02 21:57:33 -0700367 mBouncer.show(false /* resetSecuritySelection */);
Jorim Jaggi746f7fa2014-08-27 17:52:46 +0200368 }
Adrian Roos7d7090d2014-05-21 13:10:23 +0200369 }
370 updateStates();
371 }
372
Adrian Roosfee661c2017-08-04 17:05:45 +0200373 private boolean isWakeAndUnlocking() {
Gilad Brettercb51b8b2018-03-22 17:04:51 +0200374 int mode = mBiometricUnlockController.getMode();
Adrian Roosfee661c2017-08-04 17:05:45 +0200375 return mode == MODE_WAKE_AND_UNLOCK || mode == MODE_WAKE_AND_UNLOCK_PULSING;
376 }
377
Jorim Jaggi5cf17872014-03-26 18:31:48 +0100378 /**
Jorim Jaggibcbe9482016-11-23 17:37:49 +0100379 * Adds a {@param runnable} to be executed after Keyguard is gone.
380 */
381 public void addAfterKeyguardGoneRunnable(Runnable runnable) {
382 mAfterKeyguardGoneRunnables.add(runnable);
383 }
384
385 /**
Jorim Jaggi5cf17872014-03-26 18:31:48 +0100386 * Reset the state of the view.
387 */
Jorim Jaggife762342016-10-13 14:33:27 +0200388 public void reset(boolean hideBouncerWhenShowing) {
Jorim Jaggi43bdbbd2014-05-09 16:05:53 +0200389 if (mShowing) {
Adrian Roos7a56d1a2017-08-04 15:04:43 +0200390 if (mOccluded && !mDozing) {
Jason Monk2a6ea9c2017-01-26 11:14:51 -0500391 mStatusBar.hideKeyguard();
Adrian Roos91ffdc42017-08-04 18:14:41 +0200392 if (hideBouncerWhenShowing || mBouncer.needsFullscreenBouncer()) {
393 hideBouncer(false /* destroyView */);
394 }
Jorim Jaggi43bdbbd2014-05-09 16:05:53 +0200395 } else {
Jorim Jaggife762342016-10-13 14:33:27 +0200396 showBouncerOrKeyguard(hideBouncerWhenShowing);
Jorim Jaggi43bdbbd2014-05-09 16:05:53 +0200397 }
Selim Cinek1fcafc42015-07-20 14:39:25 -0700398 KeyguardUpdateMonitor.getInstance(mContext).sendKeyguardReset();
Jorim Jaggi43bdbbd2014-05-09 16:05:53 +0200399 updateStates();
Dan Sandler3806c772014-05-08 14:52:10 -0400400 }
Jorim Jaggi5cf17872014-03-26 18:31:48 +0100401 }
402
Lucas Dupin16cfe452018-02-08 13:14:50 -0800403 public boolean isGoingToSleepVisibleNotOccluded() {
404 return mGoingToSleepVisibleNotOccluded;
405 }
406
Jorim Jaggi18f18ae2015-09-10 15:48:21 -0700407 public void onStartedGoingToSleep() {
Lucas Dupin16cfe452018-02-08 13:14:50 -0800408 mGoingToSleepVisibleNotOccluded = isShowing() && !isOccluded();
Jorim Jaggi18f18ae2015-09-10 15:48:21 -0700409 }
410
Jorim Jaggi0d210f62015-07-10 14:24:44 -0700411 public void onFinishedGoingToSleep() {
Lucas Dupin16cfe452018-02-08 13:14:50 -0800412 mGoingToSleepVisibleNotOccluded = false;
Jorim Jaggi03c701e2014-04-02 12:39:51 +0200413 mBouncer.onScreenTurnedOff();
Jorim Jaggi5cf17872014-03-26 18:31:48 +0100414 }
415
Jorim Jaggi0d210f62015-07-10 14:24:44 -0700416 public void onStartedWakingUp() {
Adrian Roos731d4df2017-07-18 15:10:39 +0200417 // TODO: remove
Jorim Jaggi5cf17872014-03-26 18:31:48 +0100418 }
419
Jorim Jaggi93739112015-08-13 15:53:14 -0700420 public void onScreenTurningOn() {
Adrian Roos731d4df2017-07-18 15:10:39 +0200421 // TODO: remove
Selim Cinek372d1bd2015-08-14 13:19:37 -0700422 }
423
Jorim Jaggi0d210f62015-07-10 14:24:44 -0700424 public void onScreenTurnedOn() {
Lucas Dupin9e3fa102017-11-08 17:16:55 -0800425 // TODO: remove
Jorim Jaggi0d210f62015-07-10 14:24:44 -0700426 }
427
Adrian Roosd28ccd72016-01-06 15:23:14 +0100428 @Override
429 public void onRemoteInputActive(boolean active) {
430 mRemoteInputActive = active;
431 updateStates();
432 }
433
Evan Laird878c8532018-10-15 15:54:29 -0400434 private void setDozing(boolean dozing) {
Adrian Roos41eecff2017-06-29 14:09:52 +0200435 if (mDozing != dozing) {
436 mDozing = dozing;
Adrian Roos61676aa2017-08-03 16:24:32 +0200437 if (dozing || mBouncer.needsFullscreenBouncer() || mOccluded) {
438 reset(dozing /* hideBouncerWhenShowing */);
439 }
Adrian Roos41eecff2017-06-29 14:09:52 +0200440 updateStates();
Adrian Roosfee661c2017-08-04 17:05:45 +0200441
442 if (!dozing) {
Adrian Roos34e65402017-08-07 19:32:45 +0200443 launchPendingWakeupAction();
Adrian Roosfee661c2017-08-04 17:05:45 +0200444 }
Adrian Roos41eecff2017-06-29 14:09:52 +0200445 }
Adrian Roos087826a2017-04-19 16:59:09 -0700446 }
447
Lucas Dupinafffbf92019-04-09 19:52:26 -0700448 /**
449 * If {@link StatusBar} is pulsing.
450 */
451 public void setPulsing(boolean pulsing) {
452 if (mPulsing != pulsing) {
453 mPulsing = pulsing;
454 updateStates();
455 }
456 }
457
Jorim Jaggi5cf17872014-03-26 18:31:48 +0100458 public void setNeedsInput(boolean needsInput) {
Lucas Dupin1a8588d2018-08-21 12:18:47 -0700459 mStatusBarWindowController.setKeyguardNeedsInput(needsInput);
Jorim Jaggi5cf17872014-03-26 18:31:48 +0100460 }
461
Adrian Roosd5c2db62016-03-08 16:11:31 -0800462 public boolean isUnlockWithWallpaper() {
Lucas Dupin1a8588d2018-08-21 12:18:47 -0700463 return mStatusBarWindowController.isShowingWallpaper();
Adrian Roosd5c2db62016-03-08 16:11:31 -0800464 }
465
Jorim Jaggi6626f542016-08-22 13:08:44 -0700466 public void setOccluded(boolean occluded, boolean animate) {
Selim Cinek3a49ba22017-08-10 11:17:39 -0700467 mStatusBar.setOccluded(occluded);
Selim Cinekbaa23272014-07-08 18:01:07 +0200468 if (occluded && !mOccluded && mShowing) {
Tej Singhdd7bd352018-02-09 19:33:15 -0800469 StatsLog.write(StatsLog.KEYGUARD_STATE_CHANGED,
470 StatsLog.KEYGUARD_STATE_CHANGED__STATE__OCCLUDED);
Jason Monk2a6ea9c2017-01-26 11:14:51 -0500471 if (mStatusBar.isInLaunchTransition()) {
Selim Cinekbaa23272014-07-08 18:01:07 +0200472 mOccluded = true;
Jason Monk2a6ea9c2017-01-26 11:14:51 -0500473 mStatusBar.fadeKeyguardAfterLaunchTransition(null /* beforeFading */,
Selim Cinekbaa23272014-07-08 18:01:07 +0200474 new Runnable() {
475 @Override
476 public void run() {
Lucas Dupin1a8588d2018-08-21 12:18:47 -0700477 mStatusBarWindowController.setKeyguardOccluded(mOccluded);
Jorim Jaggife762342016-10-13 14:33:27 +0200478 reset(true /* hideBouncerWhenShowing */);
Selim Cinekbaa23272014-07-08 18:01:07 +0200479 }
480 });
481 return;
482 }
Tej Singhdd7bd352018-02-09 19:33:15 -0800483 } else if (!occluded && mOccluded && mShowing) {
484 StatsLog.write(StatsLog.KEYGUARD_STATE_CHANGED,
485 StatsLog.KEYGUARD_STATE_CHANGED__STATE__SHOWN);
Selim Cinekbaa23272014-07-08 18:01:07 +0200486 }
Lucas Dupin28f90292017-08-08 18:07:49 -0400487 boolean isOccluding = !mOccluded && occluded;
Jorim Jaggia6310292014-04-16 14:11:52 +0200488 mOccluded = occluded;
Adrian Roos909fe2d2016-10-12 12:03:24 -0700489 if (mShowing) {
Jason Monk297c04e2018-08-23 17:16:59 -0400490 mMediaManager.updateMediaMetaData(false, animate && !occluded);
Adrian Roos909fe2d2016-10-12 12:03:24 -0700491 }
Lucas Dupin1a8588d2018-08-21 12:18:47 -0700492 mStatusBarWindowController.setKeyguardOccluded(occluded);
Jorim Jaggife762342016-10-13 14:33:27 +0200493
Adrian Roos7a56d1a2017-08-04 15:04:43 +0200494 // setDozing(false) will call reset once we stop dozing.
495 if (!mDozing) {
496 // If Keyguard is reshown, don't hide the bouncer as it might just have been requested
497 // by a FLAG_DISMISS_KEYGUARD_ACTIVITY.
Lucas Dupin28f90292017-08-08 18:07:49 -0400498 reset(isOccluding /* hideBouncerWhenShowing*/);
Adrian Roos7a56d1a2017-08-04 15:04:43 +0200499 }
Lucas Dupine9e70712019-05-01 14:41:49 -0700500 if (animate && !occluded && mShowing && !mBouncer.isShowing()) {
Jason Monk2a6ea9c2017-01-26 11:14:51 -0500501 mStatusBar.animateKeyguardUnoccluding();
Jorim Jaggi6626f542016-08-22 13:08:44 -0700502 }
Jorim Jaggi5cf17872014-03-26 18:31:48 +0100503 }
504
Dan Sandler4b22bdf2014-06-05 00:58:02 -0400505 public boolean isOccluded() {
506 return mOccluded;
507 }
508
Jorim Jaggi5cf17872014-03-26 18:31:48 +0100509 /**
Jorim Jaggi76a16232014-08-08 17:00:47 +0200510 * Starts the animation before we dismiss Keyguard, i.e. an disappearing animation on the
511 * security view of the bouncer.
512 *
Jorim Jaggi8de4311c2014-08-11 22:36:20 +0200513 * @param finishRunnable the runnable to be run after the animation finished, or {@code null} if
514 * no action should be run
Jorim Jaggi76a16232014-08-08 17:00:47 +0200515 */
516 public void startPreHideAnimation(Runnable finishRunnable) {
517 if (mBouncer.isShowing()) {
518 mBouncer.startPreHideAnimation(finishRunnable);
Lucas Dupin93752552018-03-19 21:32:19 -0700519 mNotificationPanelView.onBouncerPreHideAnimation();
Jorim Jaggi8de4311c2014-08-11 22:36:20 +0200520 } else if (finishRunnable != null) {
Jorim Jaggi76a16232014-08-08 17:00:47 +0200521 finishRunnable.run();
522 }
Lucas Dupind61974d2019-03-29 16:09:26 -0700523 mNotificationPanelView.blockExpansionForCurrentTouch();
Lucas Dupin2e838ac2019-04-17 16:50:58 -0700524 updateLockIcon();
Jorim Jaggi76a16232014-08-08 17:00:47 +0200525 }
526
527 /**
Jorim Jaggi5cf17872014-03-26 18:31:48 +0100528 * Hides the keyguard view
529 */
Jorim Jaggie8fde5d2016-06-30 23:41:37 -0700530 public void hide(long startTime, long fadeoutDuration) {
Jorim Jaggi03c701e2014-04-02 12:39:51 +0200531 mShowing = false;
Evan Laird2d620fa2018-10-30 13:03:31 -0400532 mKeyguardMonitor.notifyKeyguardState(
533 mShowing, mKeyguardMonitor.isSecure(), mKeyguardMonitor.isOccluded());
Adrian Roos34e65402017-08-07 19:32:45 +0200534 launchPendingWakeupAction();
Jorim Jaggi44cf9192014-06-17 19:16:00 -0700535
Jorim Jaggi031f7952016-09-01 16:39:26 -0700536 if (KeyguardUpdateMonitor.getInstance(mContext).needsSlowUnlockTransition()) {
Jorim Jaggie8fde5d2016-06-30 23:41:37 -0700537 fadeoutDuration = KEYGUARD_DISMISS_DURATION_LOCKED;
538 }
Jorim Jaggie29b2db2014-05-30 23:17:03 +0200539 long uptimeMillis = SystemClock.uptimeMillis();
Jorim Jaggi76a16232014-08-08 17:00:47 +0200540 long delay = Math.max(0, startTime + HIDE_TIMING_CORRECTION_MS - uptimeMillis);
Selim Cinekbaa23272014-07-08 18:01:07 +0200541
Jason Monk2a6ea9c2017-01-26 11:14:51 -0500542 if (mStatusBar.isInLaunchTransition() ) {
543 mStatusBar.fadeKeyguardAfterLaunchTransition(new Runnable() {
Selim Cinekbaa23272014-07-08 18:01:07 +0200544 @Override
545 public void run() {
Lucas Dupin1a8588d2018-08-21 12:18:47 -0700546 mStatusBarWindowController.setKeyguardShowing(false);
547 mStatusBarWindowController.setKeyguardFadingAway(true);
Adrian Roosfee661c2017-08-04 17:05:45 +0200548 hideBouncer(true /* destroyView */);
Selim Cinekbaa23272014-07-08 18:01:07 +0200549 updateStates();
Selim Cinekbaa23272014-07-08 18:01:07 +0200550 }
551 }, new Runnable() {
552 @Override
553 public void run() {
Jason Monk2a6ea9c2017-01-26 11:14:51 -0500554 mStatusBar.hideKeyguard();
Lucas Dupin1a8588d2018-08-21 12:18:47 -0700555 mStatusBarWindowController.setKeyguardFadingAway(false);
Selim Cinekbaa23272014-07-08 18:01:07 +0200556 mViewMediatorCallback.keyguardGone();
Jorim Jaggi746f7fa2014-08-27 17:52:46 +0200557 executeAfterKeyguardGoneAction();
Selim Cinekbaa23272014-07-08 18:01:07 +0200558 }
559 });
560 } else {
Jorim Jaggi8d5a6e72016-11-02 21:57:33 -0700561 executeAfterKeyguardGoneAction();
Jorim Jaggie93698b2016-11-11 18:24:38 -0800562 boolean wakeUnlockPulsing =
Gilad Brettercb51b8b2018-03-22 17:04:51 +0200563 mBiometricUnlockController.getMode() == MODE_WAKE_AND_UNLOCK_PULSING;
Selim Cinekc075f152019-07-24 15:32:17 -0700564 boolean needsFading = needsBypassFading();
565 if (needsFading) {
566 delay = 0;
567 fadeoutDuration = KeyguardBypassController.BYPASS_PANEL_FADE_DURATION;
568 } else if (wakeUnlockPulsing) {
Jorim Jaggie93698b2016-11-11 18:24:38 -0800569 delay = 0;
570 fadeoutDuration = 240;
571 }
Selim Cinekc075f152019-07-24 15:32:17 -0700572 mStatusBar.setKeyguardFadingAway(startTime, delay, fadeoutDuration, needsFading);
Gilad Brettercb51b8b2018-03-22 17:04:51 +0200573 mBiometricUnlockController.startKeyguardFadingAway();
Adrian Roosfee661c2017-08-04 17:05:45 +0200574 hideBouncer(true /* destroyView */);
Jorim Jaggie93698b2016-11-11 18:24:38 -0800575 if (wakeUnlockPulsing) {
Selim Cinekc075f152019-07-24 15:32:17 -0700576 if (needsFading) {
Selim Cinek06c12d62019-07-01 19:44:18 -0700577 ViewGroupFadeHelper.fadeOutAllChildrenExcept(mNotificationPanelView,
578 mNotificationContainer,
Selim Cinekc075f152019-07-24 15:32:17 -0700579 fadeoutDuration,
Selim Cinek06c12d62019-07-01 19:44:18 -0700580 () -> {
581 mStatusBar.hideKeyguard();
582 onKeyguardFadedAway();
583 });
584 } else {
585 mStatusBar.fadeKeyguardWhilePulsing();
586 }
Lucas Dupin9e3fa102017-11-08 17:16:55 -0800587 wakeAndUnlockDejank();
Jorim Jaggidbc3dce2014-08-01 01:16:36 +0200588 } else {
Selim Cinek06c12d62019-07-01 19:44:18 -0700589 boolean staying = mStatusBarStateController.leaveOpenOnKeyguardHide();
Jorim Jaggi83eb6bb2015-08-17 17:38:58 -0700590 if (!staying) {
Lucas Dupin1a8588d2018-08-21 12:18:47 -0700591 mStatusBarWindowController.setKeyguardFadingAway(true);
Selim Cinekc075f152019-07-24 15:32:17 -0700592 if (needsFading) {
Selim Cinek06c12d62019-07-01 19:44:18 -0700593 ViewGroupFadeHelper.fadeOutAllChildrenExcept(mNotificationPanelView,
594 mNotificationContainer,
Selim Cinekc075f152019-07-24 15:32:17 -0700595 fadeoutDuration,
Selim Cinek06c12d62019-07-01 19:44:18 -0700596 () -> {
597 mStatusBar.hideKeyguard();
598 });
599 } else {
600 mStatusBar.hideKeyguard();
601 }
Lucas Dupinf0a67e32018-09-19 15:23:54 -0700602 // hide() will happen asynchronously and might arrive after the scrims
603 // were already hidden, this means that the transition callback won't
604 // be triggered anymore and StatusBarWindowController will be forever in
605 // the fadingAway state.
606 mStatusBar.updateScrimController();
Lucas Dupin9e3fa102017-11-08 17:16:55 -0800607 wakeAndUnlockDejank();
Jorim Jaggi83eb6bb2015-08-17 17:38:58 -0700608 } else {
Selim Cinek06c12d62019-07-01 19:44:18 -0700609 mStatusBar.hideKeyguard();
Jason Monk2a6ea9c2017-01-26 11:14:51 -0500610 mStatusBar.finishKeyguardFadingAway();
Gilad Brettercb51b8b2018-03-22 17:04:51 +0200611 mBiometricUnlockController.finishKeyguardFadingAway();
Jorim Jaggi83eb6bb2015-08-17 17:38:58 -0700612 }
Jorim Jaggidbc3dce2014-08-01 01:16:36 +0200613 }
Selim Cinek84b2acc2019-07-07 00:40:38 -0700614 updateLockIcon();
Jorim Jaggi67b29d52017-06-09 18:00:00 -0700615 updateStates();
Lucas Dupin1a8588d2018-08-21 12:18:47 -0700616 mStatusBarWindowController.setKeyguardShowing(false);
Selim Cinekbaa23272014-07-08 18:01:07 +0200617 mViewMediatorCallback.keyguardGone();
Jorim Jaggie29b2db2014-05-30 23:17:03 +0200618 }
Tej Singhdd7bd352018-02-09 19:33:15 -0800619 StatsLog.write(StatsLog.KEYGUARD_STATE_CHANGED,
620 StatsLog.KEYGUARD_STATE_CHANGED__STATE__HIDDEN);
Jorim Jaggi5cf17872014-03-26 18:31:48 +0100621 }
622
Selim Cinek06c12d62019-07-01 19:44:18 -0700623 private boolean needsBypassFading() {
624 return (mBiometricUnlockController.getMode() == MODE_UNLOCK_FADING
625 || mBiometricUnlockController.getMode() == MODE_WAKE_AND_UNLOCK_PULSING
626 || mBiometricUnlockController.getMode() == MODE_WAKE_AND_UNLOCK)
627 && mBypassController.getBypassEnabled();
628 }
629
Lucas Dupinafffbf92019-04-09 19:52:26 -0700630 @Override
Selim Cinekaa8bbf12016-05-04 14:13:20 -0700631 public void onDensityOrFontScaleChanged() {
Adrian Roosfee661c2017-08-04 17:05:45 +0200632 hideBouncer(true /* destroyView */);
Selim Cinekaa8bbf12016-05-04 14:13:20 -0700633 }
634
Lucas Dupinafffbf92019-04-09 19:52:26 -0700635 @Override
Winson Chung1aa24b92019-04-24 15:17:33 -0700636 public void onNavigationModeChanged(int mode) {
637 boolean gesturalNav = QuickStepContract.isGesturalMode(mode);
Lucas Dupinafffbf92019-04-09 19:52:26 -0700638 if (gesturalNav != mGesturalNav) {
639 mGesturalNav = gesturalNav;
640 updateStates();
641 }
642 }
643
Lucas Dupin8c51ce22017-11-21 13:21:05 -0800644 public void onThemeChanged() {
Adrian Roosfee661c2017-08-04 17:05:45 +0200645 hideBouncer(true /* destroyView */);
Lucas Dupinf190a852017-07-31 17:11:26 -0700646 mBouncer.prepare();
Lucas Dupin89516d42017-07-05 13:29:18 -0700647 }
648
Lucas Dupin9e3fa102017-11-08 17:16:55 -0800649 public void onKeyguardFadedAway() {
Lucas Dupin1a8588d2018-08-21 12:18:47 -0700650 mContainer.postDelayed(() -> mStatusBarWindowController.setKeyguardFadingAway(false),
Lucas Dupin9e3fa102017-11-08 17:16:55 -0800651 100);
Selim Cinek06c12d62019-07-01 19:44:18 -0700652 ViewGroupFadeHelper.reset(mNotificationPanelView);
Lucas Dupin9e3fa102017-11-08 17:16:55 -0800653 mStatusBar.finishKeyguardFadingAway();
Gilad Brettercb51b8b2018-03-22 17:04:51 +0200654 mBiometricUnlockController.finishKeyguardFadingAway();
Lucas Dupin9e3fa102017-11-08 17:16:55 -0800655 WindowManagerGlobal.getInstance().trimMemory(
656 ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN);
657
Jorim Jaggi90978852015-08-18 19:55:53 -0700658 }
659
Lucas Dupin9e3fa102017-11-08 17:16:55 -0800660 private void wakeAndUnlockDejank() {
Gilad Brettercb51b8b2018-03-22 17:04:51 +0200661 if (mBiometricUnlockController.getMode() == MODE_WAKE_AND_UNLOCK
Jorim Jaggi8adb30c2016-09-13 15:02:22 -0700662 && LatencyTracker.isEnabled(mContext)) {
663 DejankUtils.postAfterTraversal(() ->
664 LatencyTracker.getInstance(mContext).onActionEnd(
665 LatencyTracker.ACTION_FINGERPRINT_WAKE_AND_UNLOCK));
666 }
Jorim Jaggi0d210f62015-07-10 14:24:44 -0700667 }
668
Jorim Jaggi746f7fa2014-08-27 17:52:46 +0200669 private void executeAfterKeyguardGoneAction() {
670 if (mAfterKeyguardGoneAction != null) {
671 mAfterKeyguardGoneAction.onDismiss();
672 mAfterKeyguardGoneAction = null;
673 }
Jorim Jaggibcbe9482016-11-23 17:37:49 +0100674 for (int i = 0; i < mAfterKeyguardGoneRunnables.size(); i++) {
675 mAfterKeyguardGoneRunnables.get(i).run();
676 }
677 mAfterKeyguardGoneRunnables.clear();
Jorim Jaggi746f7fa2014-08-27 17:52:46 +0200678 }
679
Jorim Jaggi5cf17872014-03-26 18:31:48 +0100680 /**
681 * Dismisses the keyguard by going to the next screen or making it gone.
682 */
Jorim Jaggi8d5a6e72016-11-02 21:57:33 -0700683 public void dismissAndCollapse() {
Jason Monk2a6ea9c2017-01-26 11:14:51 -0500684 mStatusBar.executeRunnableDismissingKeyguard(null, null, true, false, true);
Jorim Jaggi8d5a6e72016-11-02 21:57:33 -0700685 }
686
Christoph Studer2231c6e2014-12-19 12:40:13 +0100687 /**
688 * WARNING: This method might cause Binder calls.
689 */
Jorim Jaggi15682502014-04-23 12:01:36 +0200690 public boolean isSecure() {
691 return mBouncer.isSecure();
692 }
693
Jorim Jaggi5cf17872014-03-26 18:31:48 +0100694 /**
695 * @return Whether the keyguard is showing
696 */
697 public boolean isShowing() {
Jorim Jaggi03c701e2014-04-02 12:39:51 +0200698 return mShowing;
Jorim Jaggi5cf17872014-03-26 18:31:48 +0100699 }
Jorim Jaggie5c7a892014-04-10 20:37:32 +0200700
701 /**
702 * Notifies this manager that the back button has been pressed.
703 *
Lucas Dupin3f54fe22018-04-08 23:17:40 -0700704 * @param hideImmediately Hide bouncer when {@code true}, keep it around otherwise.
705 * Non-scrimmed bouncers have a special animation tied to the expansion
706 * of the notification panel.
Jorim Jaggie5c7a892014-04-10 20:37:32 +0200707 * @return whether the back press has been handled
708 */
Lucas Dupin3f54fe22018-04-08 23:17:40 -0700709 public boolean onBackPressed(boolean hideImmediately) {
Jorim Jaggie5c7a892014-04-10 20:37:32 +0200710 if (mBouncer.isShowing()) {
Jason Monk2a6ea9c2017-01-26 11:14:51 -0500711 mStatusBar.endAffordanceLaunch();
Fabian Kozynskibaa47b62019-04-26 15:40:43 -0400712 // The second condition is for SIM card locked bouncer
713 if (mBouncer.isScrimmed() && !mBouncer.needsFullscreenBouncer()) {
714 hideBouncer(false);
715 updateStates();
716 } else {
717 reset(hideImmediately);
718 }
Jorim Jaggie5c7a892014-04-10 20:37:32 +0200719 return true;
720 }
721 return false;
722 }
723
Jim Millerf41fc962014-06-18 16:33:51 -0700724 public boolean isBouncerShowing() {
725 return mBouncer.isShowing();
726 }
727
Lucas Dupinfa817a02019-07-02 15:22:54 -0700728 /**
729 * When bouncer is fully visible or {@link KeyguardBouncer#show(boolean)} was called but
730 * animation didn't finish yet.
731 */
732 public boolean bouncerIsOrWillBeShowing() {
Lucas Dupinb7d32742019-07-12 17:46:11 +0900733 return mBouncer.isShowing() || mBouncer.inTransit();
Lucas Dupinfa817a02019-07-02 15:22:54 -0700734 }
735
Jackal Guo42cae962018-04-18 18:41:19 +0800736 public boolean isFullscreenBouncer() {
737 return mBouncer.isFullscreenBouncer();
738 }
739
Jorim Jaggi416493b2014-09-13 03:57:32 +0200740 private long getNavBarShowDelay() {
Jason Monk1fd3fc32018-08-14 17:20:09 -0400741 if (mKeyguardMonitor.isKeyguardFadingAway()) {
742 return mKeyguardMonitor.getKeyguardFadingAwayDelay();
Adrian Roos087826a2017-04-19 16:59:09 -0700743 } else if (mBouncer.isShowing()) {
Jorim Jaggi416493b2014-09-13 03:57:32 +0200744 return NAV_BAR_SHOW_DELAY_BOUNCER;
Adrian Roos087826a2017-04-19 16:59:09 -0700745 } else {
746 // No longer dozing, or remote input is active. No delay.
747 return 0;
Jorim Jaggi416493b2014-09-13 03:57:32 +0200748 }
749 }
750
751 private Runnable mMakeNavigationBarVisibleRunnable = new Runnable() {
752 @Override
753 public void run() {
Jason Monk2a6ea9c2017-01-26 11:14:51 -0500754 mStatusBar.getNavigationBarView().getRootView().setVisibility(View.VISIBLE);
Jorim Jaggi416493b2014-09-13 03:57:32 +0200755 }
756 };
757
Xiyuan Xia1b30f792016-01-06 08:50:30 -0800758 protected void updateStates() {
Jorim Jaggie5c7a892014-04-10 20:37:32 +0200759 int vis = mContainer.getSystemUiVisibility();
Adrian Roosb6011622014-05-14 15:52:53 +0200760 boolean showing = mShowing;
761 boolean occluded = mOccluded;
762 boolean bouncerShowing = mBouncer.isShowing();
Jorim Jaggi95e89ca2014-11-24 20:12:50 +0100763 boolean bouncerDismissible = !mBouncer.isFullscreenBouncer();
Adrian Roosd28ccd72016-01-06 15:23:14 +0100764 boolean remoteInputActive = mRemoteInputActive;
Adrian Roosb6011622014-05-14 15:52:53 +0200765
Adrian Roosd28ccd72016-01-06 15:23:14 +0100766 if ((bouncerDismissible || !showing || remoteInputActive) !=
767 (mLastBouncerDismissible || !mLastShowing || mLastRemoteInputActive)
Adrian Roosb6011622014-05-14 15:52:53 +0200768 || mFirstUpdate) {
Adrian Roosd28ccd72016-01-06 15:23:14 +0100769 if (bouncerDismissible || !showing || remoteInputActive) {
Adrian Roosb6011622014-05-14 15:52:53 +0200770 mContainer.setSystemUiVisibility(vis & ~View.STATUS_BAR_DISABLE_BACK);
Jason Monk1e68fb32014-05-02 16:06:20 -0400771 } else {
Adrian Roosb6011622014-05-14 15:52:53 +0200772 mContainer.setSystemUiVisibility(vis | View.STATUS_BAR_DISABLE_BACK);
Jason Monk1e68fb32014-05-02 16:06:20 -0400773 }
Jorim Jaggia6310292014-04-16 14:11:52 +0200774 }
Jorim Jaggi0d210f62015-07-10 14:24:44 -0700775
Xiyuan Xia1b30f792016-01-06 08:50:30 -0800776 boolean navBarVisible = isNavBarVisible();
777 boolean lastNavBarVisible = getLastNavBarVisible();
Jorim Jaggi0d210f62015-07-10 14:24:44 -0700778 if (navBarVisible != lastNavBarVisible || mFirstUpdate) {
Brad Stenning7e411812018-04-13 22:52:39 -0700779 updateNavigationBarVisibility(navBarVisible);
Adrian Roosb6011622014-05-14 15:52:53 +0200780 }
781
782 if (bouncerShowing != mLastBouncerShowing || mFirstUpdate) {
Lucas Dupin1a8588d2018-08-21 12:18:47 -0700783 mStatusBarWindowController.setBouncerShowing(bouncerShowing);
Jason Monk2a6ea9c2017-01-26 11:14:51 -0500784 mStatusBar.setBouncerShowing(bouncerShowing);
Adrian Roosb6011622014-05-14 15:52:53 +0200785 }
786
787 KeyguardUpdateMonitor updateMonitor = KeyguardUpdateMonitor.getInstance(mContext);
788 if ((showing && !occluded) != (mLastShowing && !mLastOccluded) || mFirstUpdate) {
Jorim Jaggi6a15d522015-09-22 15:55:33 -0700789 updateMonitor.onKeyguardVisibilityChanged(showing && !occluded);
Adrian Roosb6011622014-05-14 15:52:53 +0200790 }
791 if (bouncerShowing != mLastBouncerShowing || mFirstUpdate) {
792 updateMonitor.sendKeyguardBouncerChanged(bouncerShowing);
793 }
794
795 mFirstUpdate = false;
796 mLastShowing = showing;
797 mLastOccluded = occluded;
798 mLastBouncerShowing = bouncerShowing;
799 mLastBouncerDismissible = bouncerDismissible;
Adrian Roosd28ccd72016-01-06 15:23:14 +0100800 mLastRemoteInputActive = remoteInputActive;
Adrian Roos087826a2017-04-19 16:59:09 -0700801 mLastDozing = mDozing;
Lucas Dupinafffbf92019-04-09 19:52:26 -0700802 mLastPulsing = mPulsing;
Gilad Brettercb51b8b2018-03-22 17:04:51 +0200803 mLastBiometricMode = mBiometricUnlockController.getMode();
Lucas Dupinafffbf92019-04-09 19:52:26 -0700804 mLastGesturalNav = mGesturalNav;
805 mLastIsDocked = mIsDocked;
Jason Monk2a6ea9c2017-01-26 11:14:51 -0500806 mStatusBar.onKeyguardViewManagerStatesUpdated();
Jorim Jaggie5c7a892014-04-10 20:37:32 +0200807 }
Jorim Jaggi8c8bcc12014-04-16 21:36:51 +0200808
Brad Stenning7e411812018-04-13 22:52:39 -0700809 protected void updateNavigationBarVisibility(boolean navBarVisible) {
810 if (mStatusBar.getNavigationBarView() != null) {
811 if (navBarVisible) {
812 long delay = getNavBarShowDelay();
813 if (delay == 0) {
814 mMakeNavigationBarVisibleRunnable.run();
815 } else {
816 mContainer.postOnAnimationDelayed(mMakeNavigationBarVisibleRunnable,
817 delay);
818 }
819 } else {
820 mContainer.removeCallbacks(mMakeNavigationBarVisibleRunnable);
821 mStatusBar.getNavigationBarView().getRootView().setVisibility(View.GONE);
822 }
823 }
824 }
825
Xiyuan Xia1b30f792016-01-06 08:50:30 -0800826 /**
827 * @return Whether the navigation bar should be made visible based on the current state.
828 */
829 protected boolean isNavBarVisible() {
Gilad Brettercb51b8b2018-03-22 17:04:51 +0200830 int biometricMode = mBiometricUnlockController.getMode();
Jorim Jaggif5304ad2017-07-17 18:31:13 +0200831 boolean keyguardShowing = mShowing && !mOccluded;
Gilad Brettercb51b8b2018-03-22 17:04:51 +0200832 boolean hideWhileDozing = mDozing && biometricMode != MODE_WAKE_AND_UNLOCK_PULSING;
Lucas Dupinafffbf92019-04-09 19:52:26 -0700833 boolean keyguardWithGestureNav = (keyguardShowing && !mDozing || mPulsing && !mIsDocked)
834 && mGesturalNav;
Jorim Jaggif5304ad2017-07-17 18:31:13 +0200835 return (!keyguardShowing && !hideWhileDozing || mBouncer.isShowing()
Lucas Dupinafffbf92019-04-09 19:52:26 -0700836 || mRemoteInputActive || keyguardWithGestureNav);
Xiyuan Xia1b30f792016-01-06 08:50:30 -0800837 }
838
839 /**
840 * @return Whether the navigation bar was made visible based on the last known state.
841 */
842 protected boolean getLastNavBarVisible() {
Jorim Jaggif5304ad2017-07-17 18:31:13 +0200843 boolean keyguardShowing = mLastShowing && !mLastOccluded;
Gilad Brettercb51b8b2018-03-22 17:04:51 +0200844 boolean hideWhileDozing = mLastDozing && mLastBiometricMode != MODE_WAKE_AND_UNLOCK_PULSING;
Lucas Dupinafffbf92019-04-09 19:52:26 -0700845 boolean keyguardWithGestureNav = (keyguardShowing && !mLastDozing
846 || mLastPulsing && !mLastIsDocked) && mLastGesturalNav;
Jorim Jaggif5304ad2017-07-17 18:31:13 +0200847 return (!keyguardShowing && !hideWhileDozing || mLastBouncerShowing
Lucas Dupinafffbf92019-04-09 19:52:26 -0700848 || mLastRemoteInputActive || keyguardWithGestureNav);
Xiyuan Xia1b30f792016-01-06 08:50:30 -0800849 }
850
Selim Cinek28540192016-02-19 17:25:08 -0800851 public boolean shouldDismissOnMenuPressed() {
852 return mBouncer.shouldDismissOnMenuPressed();
Jorim Jaggi8c8bcc12014-04-16 21:36:51 +0200853 }
Jorim Jaggidf993512014-05-13 23:06:35 +0200854
855 public boolean interceptMediaKey(KeyEvent event) {
856 return mBouncer.interceptMediaKey(event);
857 }
Jorim Jaggi8de4311c2014-08-11 22:36:20 +0200858
Jorim Jaggife762342016-10-13 14:33:27 +0200859 public void readyForKeyguardDone() {
860 mViewMediatorCallback.readyForKeyguardDone();
861 }
862
Jorim Jaggi84a3e7a2014-08-13 17:58:58 +0200863 public boolean shouldDisableWindowAnimationsForUnlock() {
Jason Monk2a6ea9c2017-01-26 11:14:51 -0500864 return mStatusBar.isInLaunchTransition();
Jorim Jaggi84a3e7a2014-08-13 17:58:58 +0200865 }
866
Issei Suzuki5609ccb2019-06-13 15:04:08 +0200867
868 /**
869 * @return Whether subtle animation should be used for unlocking the device.
870 */
871 public boolean shouldSubtleWindowAnimationsForUnlock() {
Selim Cinek06c12d62019-07-01 19:44:18 -0700872 return needsBypassFading();
Issei Suzuki5609ccb2019-06-13 15:04:08 +0200873 }
874
Jorim Jaggi84a3e7a2014-08-13 17:58:58 +0200875 public boolean isGoingToNotificationShade() {
Beverly8fdb5332019-02-04 14:29:49 -0500876 return ((SysuiStatusBarStateController) Dependency.get(StatusBarStateController.class))
877 .leaveOpenOnKeyguardHide();
Jorim Jaggi84a3e7a2014-08-13 17:58:58 +0200878 }
Adrian Roos31b844b2014-11-21 13:55:09 +0100879
880 public boolean isSecure(int userId) {
881 return mBouncer.isSecure() || mLockPatternUtils.isSecure(userId);
882 }
Jim Millerab954542014-10-10 18:21:49 -0700883
Jorim Jaggi33ae80e2015-02-04 16:37:11 +0100884 public void keyguardGoingAway() {
Jason Monk2a6ea9c2017-01-26 11:14:51 -0500885 mStatusBar.keyguardGoingAway();
Jorim Jaggi33ae80e2015-02-04 16:37:11 +0100886 }
Jim Miller25d7e512015-03-03 17:12:09 -0800887
Jorim Jaggif3b3bee2015-04-16 14:57:34 -0700888 public void animateCollapsePanels(float speedUpFactor) {
Jason Monk2a6ea9c2017-01-26 11:14:51 -0500889 mStatusBar.animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE, true /* force */,
Jorim Jaggif3b3bee2015-04-16 14:57:34 -0700890 false /* delayed */, speedUpFactor);
Jim Miller25d7e512015-03-03 17:12:09 -0800891 }
Jorim Jaggi5cc86592015-06-08 14:48:28 -0700892
Aarthi Balachander0a427ef2018-07-13 15:00:58 -0700893
894 /**
895 * Called when cancel button in bouncer is pressed.
896 */
897 public void onCancelClicked() {
898 // No-op
899 }
900
Jorim Jaggi5cc86592015-06-08 14:48:28 -0700901 /**
902 * Notifies that the user has authenticated by other means than using the bouncer, for example,
903 * fingerprint.
904 */
Jorim Jaggi25b4d4b2015-08-11 15:54:06 -0700905 public void notifyKeyguardAuthenticated(boolean strongAuth) {
906 mBouncer.notifyKeyguardAuthenticated(strongAuth);
Jorim Jaggi5cc86592015-06-08 14:48:28 -0700907 }
Jorim Jaggi0d210f62015-07-10 14:24:44 -0700908
Jason Chang1e4a4bd2018-05-22 17:30:19 +0800909 public void showBouncerMessage(String message, ColorStateList colorState) {
910 mBouncer.showMessage(message, colorState);
Selim Cinekcfafe4e2015-08-11 14:58:44 -0700911 }
Jorim Jaggib774e552015-08-24 14:52:45 -0700912
913 public ViewRootImpl getViewRootImpl() {
Jason Monk2a6ea9c2017-01-26 11:14:51 -0500914 return mStatusBar.getStatusBarView().getViewRootImpl();
Jorim Jaggib774e552015-08-24 14:52:45 -0700915 }
Adrian Roosfee661c2017-08-04 17:05:45 +0200916
Adrian Roos34e65402017-08-07 19:32:45 +0200917 public void launchPendingWakeupAction() {
918 DismissWithActionRequest request = mPendingWakeupAction;
919 mPendingWakeupAction = null;
Adrian Roosfee661c2017-08-04 17:05:45 +0200920 if (request != null) {
921 if (mShowing) {
922 dismissWithAction(request.dismissAction, request.cancelAction,
Lucas Dupinc80c67e2017-12-04 14:29:10 -0800923 request.afterKeyguardGone, request.message);
Adrian Roosfee661c2017-08-04 17:05:45 +0200924 } else if (request.dismissAction != null) {
925 request.dismissAction.onDismiss();
926 }
927 }
928 }
929
Adrian Roos34e65402017-08-07 19:32:45 +0200930 public void cancelPendingWakeupAction() {
931 DismissWithActionRequest request = mPendingWakeupAction;
932 mPendingWakeupAction = null;
Adrian Roosfee661c2017-08-04 17:05:45 +0200933 if (request != null && request.cancelAction != null) {
934 request.cancelAction.run();
935 }
936 }
937
Lucas Dupinf9ca35e2018-05-16 20:41:35 -0700938 public boolean bouncerNeedsScrimming() {
Lucas Dupin300e3712019-03-27 19:33:36 -0700939 return mOccluded || mBouncer.willDismissWithAction()
Lucas Dupin93f714d2019-03-26 16:49:24 -0700940 || mStatusBar.isFullScreenUserSwitcherState()
Lucas Dupin300e3712019-03-27 19:33:36 -0700941 || (mBouncer.isShowing() && mBouncer.isScrimmed())
942 || mBouncer.isFullscreenBouncer();
Lucas Dupinf9ca35e2018-05-16 20:41:35 -0700943 }
944
Lucas Dupin15a6b6c2018-04-16 14:50:20 +0800945 public void dump(PrintWriter pw) {
946 pw.println("StatusBarKeyguardViewManager:");
947 pw.println(" mShowing: " + mShowing);
948 pw.println(" mOccluded: " + mOccluded);
949 pw.println(" mRemoteInputActive: " + mRemoteInputActive);
950 pw.println(" mDozing: " + mDozing);
951 pw.println(" mGoingToSleepVisibleNotOccluded: " + mGoingToSleepVisibleNotOccluded);
952 pw.println(" mAfterKeyguardGoneAction: " + mAfterKeyguardGoneAction);
953 pw.println(" mAfterKeyguardGoneRunnables: " + mAfterKeyguardGoneRunnables);
954 pw.println(" mPendingWakeupAction: " + mPendingWakeupAction);
955
956 if (mBouncer != null) {
957 mBouncer.dump(pw);
958 }
959 }
960
Evan Laird878c8532018-10-15 15:54:29 -0400961 @Override
962 public void onStateChanged(int newState) {
Lucas Dupin2e838ac2019-04-17 16:50:58 -0700963 updateLockIcon();
Evan Laird878c8532018-10-15 15:54:29 -0400964 }
965
966 @Override
967 public void onDozingChanged(boolean isDozing) {
968 setDozing(isDozing);
969 }
970
Lucas Dupin407cc582019-03-11 21:04:31 -0700971 public KeyguardBouncer getBouncer() {
972 return mBouncer;
973 }
974
Adrian Roos34e65402017-08-07 19:32:45 +0200975 private static class DismissWithActionRequest {
Adrian Roosfee661c2017-08-04 17:05:45 +0200976 final OnDismissAction dismissAction;
977 final Runnable cancelAction;
978 final boolean afterKeyguardGone;
Lucas Dupinc80c67e2017-12-04 14:29:10 -0800979 final String message;
Adrian Roosfee661c2017-08-04 17:05:45 +0200980
Adrian Roos34e65402017-08-07 19:32:45 +0200981 DismissWithActionRequest(OnDismissAction dismissAction, Runnable cancelAction,
Lucas Dupinc80c67e2017-12-04 14:29:10 -0800982 boolean afterKeyguardGone, String message) {
Adrian Roosfee661c2017-08-04 17:05:45 +0200983 this.dismissAction = dismissAction;
984 this.cancelAction = cancelAction;
985 this.afterKeyguardGone = afterKeyguardGone;
Lucas Dupinc80c67e2017-12-04 14:29:10 -0800986 this.message = message;
Adrian Roosfee661c2017-08-04 17:05:45 +0200987 }
988 }
Jorim Jaggi5cf17872014-03-26 18:31:48 +0100989}