blob: 657e0ebbdc5f0015208aefe977f6a6bacd20752f [file] [log] [blame]
Jorim Jaggife762342016-10-13 14:33:27 +02001/*
2 * Copyright (C) 2016 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.server.am;
18
Wale Ogunwaledfb7fb22017-06-23 14:52:40 -070019import static android.os.Trace.TRACE_TAG_ACTIVITY_MANAGER;
David Stevens9440dc82017-03-16 19:00:20 -070020import static android.view.Display.DEFAULT_DISPLAY;
David Stevens53a39ea2017-08-23 18:41:49 -070021import static android.view.Display.INVALID_DISPLAY;
Wale Ogunwale9e4f3e02018-05-17 09:35:39 -070022import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_GOING_AWAY_NO_ANIMATION;
23import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_GOING_AWAY_TO_SHADE;
24import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_GOING_AWAY_WITH_WALLPAPER;
25import static android.view.WindowManager.TRANSIT_KEYGUARD_GOING_AWAY;
26import static android.view.WindowManager.TRANSIT_KEYGUARD_OCCLUDE;
27import static android.view.WindowManager.TRANSIT_KEYGUARD_UNOCCLUDE;
28import static android.view.WindowManager.TRANSIT_UNSET;
Adrian Roose99bc052017-11-20 17:55:31 +010029import static android.view.WindowManagerPolicyConstants.KEYGUARD_GOING_AWAY_FLAG_NO_WINDOW_ANIMATIONS;
30import static android.view.WindowManagerPolicyConstants.KEYGUARD_GOING_AWAY_FLAG_TO_SHADE;
31import static android.view.WindowManagerPolicyConstants.KEYGUARD_GOING_AWAY_FLAG_WITH_WALLPAPER;
Jorim Jaggi241ae102016-11-02 21:57:33 -070032import static com.android.server.am.ActivityManagerDebugConfig.TAG_AM;
33import static com.android.server.am.ActivityManagerDebugConfig.TAG_WITH_CLASS_NAME;
Jorim Jaggife762342016-10-13 14:33:27 +020034import static com.android.server.am.ActivityStackSupervisor.PRESERVE_WINDOWS;
Yi Jin6c6e9ca2018-03-20 16:53:35 -070035import static com.android.server.am.KeyguardControllerProto.KEYGUARD_OCCLUDED;
36import static com.android.server.am.KeyguardControllerProto.KEYGUARD_SHOWING;
Jorim Jaggife762342016-10-13 14:33:27 +020037
Jorim Jaggi241ae102016-11-02 21:57:33 -070038import android.os.IBinder;
39import android.os.RemoteException;
Wale Ogunwaledfb7fb22017-06-23 14:52:40 -070040import android.os.Trace;
Jorim Jaggi241ae102016-11-02 21:57:33 -070041import android.util.Slog;
Steven Timotius4346f0a2017-09-12 11:07:21 -070042import android.util.proto.ProtoOutputStream;
Adrian Roose99bc052017-11-20 17:55:31 +010043
Jorim Jaggi241ae102016-11-02 21:57:33 -070044import com.android.internal.policy.IKeyguardDismissCallback;
Adrian Roose99bc052017-11-20 17:55:31 +010045import com.android.server.policy.WindowManagerPolicy;
Wale Ogunwale9e4f3e02018-05-17 09:35:39 -070046import com.android.server.wm.ActivityTaskManagerInternal.SleepToken;
Jorim Jaggife762342016-10-13 14:33:27 +020047import com.android.server.wm.WindowManagerService;
Adrian Roose99bc052017-11-20 17:55:31 +010048
Jorim Jaggi8d786932016-10-26 19:08:36 -070049import java.io.PrintWriter;
Jorim Jaggife762342016-10-13 14:33:27 +020050
51/**
52 * Controls Keyguard occluding, dismissing and transitions depending on what kind of activities are
53 * currently visible.
54 * <p>
55 * Note that everything in this class should only be accessed with the AM lock being held.
56 */
57class KeyguardController {
58
Jorim Jaggi241ae102016-11-02 21:57:33 -070059 private static final String TAG = TAG_WITH_CLASS_NAME ? "KeyguardController" : TAG_AM;
60
Jorim Jaggife762342016-10-13 14:33:27 +020061 private final ActivityManagerService mService;
62 private final ActivityStackSupervisor mStackSupervisor;
63 private WindowManagerService mWindowManager;
Jorim Jaggife762342016-10-13 14:33:27 +020064 private boolean mKeyguardShowing;
Lucas Dupin47a65c72018-02-15 14:16:18 -080065 private boolean mAodShowing;
Jorim Jaggi8d786932016-10-26 19:08:36 -070066 private boolean mKeyguardGoingAway;
Jorim Jaggife762342016-10-13 14:33:27 +020067 private boolean mOccluded;
Jorim Jaggi07961872016-11-23 11:28:57 +010068 private boolean mDismissalRequested;
Jorim Jaggife762342016-10-13 14:33:27 +020069 private ActivityRecord mDismissingKeyguardActivity;
70 private int mBeforeUnoccludeTransit;
71 private int mVisibilityTransactionDepth;
David Stevens9440dc82017-03-16 19:00:20 -070072 private SleepToken mSleepToken;
David Stevens53a39ea2017-08-23 18:41:49 -070073 private int mSecondaryDisplayShowing = INVALID_DISPLAY;
Jorim Jaggife762342016-10-13 14:33:27 +020074
75 KeyguardController(ActivityManagerService service,
76 ActivityStackSupervisor stackSupervisor) {
77 mService = service;
78 mStackSupervisor = stackSupervisor;
79 }
80
81 void setWindowManager(WindowManagerService windowManager) {
82 mWindowManager = windowManager;
83 }
84
85 /**
Lucas Dupin47a65c72018-02-15 14:16:18 -080086 * @return true if either Keyguard or AOD are showing, not going away, and not being occluded
87 * on the given display, false otherwise
88 */
89 boolean isKeyguardOrAodShowing(int displayId) {
90 return (mKeyguardShowing || mAodShowing) && !mKeyguardGoingAway &&
91 (displayId == DEFAULT_DISPLAY ? !mOccluded : displayId == mSecondaryDisplayShowing);
92 }
93
94 /**
David Stevens53a39ea2017-08-23 18:41:49 -070095 * @return true if Keyguard is showing, not going away, and not being occluded on the given
96 * display, false otherwise
Jorim Jaggife762342016-10-13 14:33:27 +020097 */
David Stevens53a39ea2017-08-23 18:41:49 -070098 boolean isKeyguardShowing(int displayId) {
Bryce Leed939cf02018-03-12 09:04:44 -070099 return mKeyguardShowing && !mKeyguardGoingAway &&
100 (displayId == DEFAULT_DISPLAY ? !mOccluded : displayId == mSecondaryDisplayShowing);
Jorim Jaggife762342016-10-13 14:33:27 +0200101 }
102
103 /**
104 * @return true if Keyguard is either showing or occluded, but not going away
105 */
106 boolean isKeyguardLocked() {
107 return mKeyguardShowing && !mKeyguardGoingAway;
108 }
109
110 /**
Bryce Lee271617a2018-03-15 10:39:12 -0700111 * @return {@code true} if the keyguard is going away, {@code false} otherwise.
112 */
113 boolean isKeyguardGoingAway() {
114 // Also check keyguard showing in case value is stale.
115 return mKeyguardGoingAway && mKeyguardShowing;
116 }
117
118 /**
Jorim Jaggife762342016-10-13 14:33:27 +0200119 * Update the Keyguard showing state.
120 */
Lucas Dupin47a65c72018-02-15 14:16:18 -0800121 void setKeyguardShown(boolean keyguardShowing, boolean aodShowing,
122 int secondaryDisplayShowing) {
123 boolean showingChanged = keyguardShowing != mKeyguardShowing || aodShowing != mAodShowing;
Adrian Roos6ec76b72018-04-25 14:01:11 +0200124 // If keyguard is going away, but SystemUI aborted the transition, need to reset state.
125 showingChanged |= mKeyguardGoingAway && keyguardShowing;
David Stevens53a39ea2017-08-23 18:41:49 -0700126 if (!showingChanged && secondaryDisplayShowing == mSecondaryDisplayShowing) {
Jorim Jaggife762342016-10-13 14:33:27 +0200127 return;
128 }
Lucas Dupin47a65c72018-02-15 14:16:18 -0800129 mKeyguardShowing = keyguardShowing;
130 mAodShowing = aodShowing;
David Stevens53a39ea2017-08-23 18:41:49 -0700131 mSecondaryDisplayShowing = secondaryDisplayShowing;
chaviw0e9fb132018-06-05 16:29:13 -0700132 mWindowManager.setAodShowing(aodShowing);
David Stevens53a39ea2017-08-23 18:41:49 -0700133 if (showingChanged) {
134 dismissDockedStackIfNeeded();
Andrii Kulian0d595f32018-02-21 15:47:33 -0800135 setKeyguardGoingAway(false);
Adrian Roosb56b3c32018-05-17 17:32:26 +0200136 mWindowManager.setKeyguardOrAodShowingOnDefaultDisplay(
137 isKeyguardOrAodShowing(DEFAULT_DISPLAY));
Lucas Dupin47a65c72018-02-15 14:16:18 -0800138 if (keyguardShowing) {
David Stevens53a39ea2017-08-23 18:41:49 -0700139 mDismissalRequested = false;
140 }
Jorim Jaggife762342016-10-13 14:33:27 +0200141 }
142 mStackSupervisor.ensureActivitiesVisibleLocked(null, 0, !PRESERVE_WINDOWS);
David Stevens9440dc82017-03-16 19:00:20 -0700143 updateKeyguardSleepToken();
Jorim Jaggife762342016-10-13 14:33:27 +0200144 }
145
146 /**
147 * Called when Keyguard is going away.
148 *
Adrian Roose99bc052017-11-20 17:55:31 +0100149 * @param flags See {@link WindowManagerPolicy#KEYGUARD_GOING_AWAY_FLAG_TO_SHADE}
Jorim Jaggife762342016-10-13 14:33:27 +0200150 * etc.
151 */
152 void keyguardGoingAway(int flags) {
Wale Ogunwaledfb7fb22017-06-23 14:52:40 -0700153 if (!mKeyguardShowing) {
154 return;
155 }
156 Trace.traceBegin(TRACE_TAG_ACTIVITY_MANAGER, "keyguardGoingAway");
157 mWindowManager.deferSurfaceLayout();
158 try {
159 setKeyguardGoingAway(true);
160 mWindowManager.prepareAppTransition(TRANSIT_KEYGUARD_GOING_AWAY,
161 false /* alwaysKeepCurrent */, convertTransitFlags(flags),
162 false /* forceOverride */);
David Stevens9440dc82017-03-16 19:00:20 -0700163 updateKeyguardSleepToken();
Jorim Jaggife762342016-10-13 14:33:27 +0200164
Wale Ogunwaledfb7fb22017-06-23 14:52:40 -0700165 // Some stack visibility might change (e.g. docked stack)
Andrii Kulian0d595f32018-02-21 15:47:33 -0800166 mStackSupervisor.resumeFocusedStackTopActivityLocked();
Wale Ogunwaledfb7fb22017-06-23 14:52:40 -0700167 mStackSupervisor.ensureActivitiesVisibleLocked(null, 0, !PRESERVE_WINDOWS);
168 mStackSupervisor.addStartingWindowsForVisibleActivities(true /* taskSwitch */);
169 mWindowManager.executeAppTransition();
170 } finally {
171 Trace.traceBegin(TRACE_TAG_ACTIVITY_MANAGER, "keyguardGoingAway: surfaceLayout");
172 mWindowManager.continueSurfaceLayout();
173 Trace.traceEnd(TRACE_TAG_ACTIVITY_MANAGER);
174
175 Trace.traceEnd(TRACE_TAG_ACTIVITY_MANAGER);
Jorim Jaggife762342016-10-13 14:33:27 +0200176 }
177 }
178
Lucas Dupinc80c67e2017-12-04 14:29:10 -0800179 void dismissKeyguard(IBinder token, IKeyguardDismissCallback callback, CharSequence message) {
Jorim Jaggi241ae102016-11-02 21:57:33 -0700180 final ActivityRecord activityRecord = ActivityRecord.forTokenLocked(token);
181 if (activityRecord == null || !activityRecord.visibleIgnoringKeyguard) {
182 failCallback(callback);
183 return;
184 }
Jorim Jaggid7214892017-07-18 14:05:19 +0200185 Slog.i(TAG, "Activity requesting to dismiss Keyguard: " + activityRecord);
chaviw59b98852017-06-13 12:05:44 -0700186
187 // If the client has requested to dismiss the keyguard and the Activity has the flag to
188 // turn the screen on, wakeup the screen if it's the top Activity.
189 if (activityRecord.getTurnScreenOnFlag() && activityRecord.isTopRunningActivity()) {
190 mStackSupervisor.wakeUp("dismissKeyguard");
191 }
192
Lucas Dupinc80c67e2017-12-04 14:29:10 -0800193 mWindowManager.dismissKeyguard(callback, message);
Jorim Jaggi241ae102016-11-02 21:57:33 -0700194 }
195
Wale Ogunwalebfa81ad2017-05-24 15:14:42 -0700196 private void setKeyguardGoingAway(boolean keyguardGoingAway) {
197 mKeyguardGoingAway = keyguardGoingAway;
198 mWindowManager.setKeyguardGoingAway(keyguardGoingAway);
199 }
200
Jorim Jaggi241ae102016-11-02 21:57:33 -0700201 private void failCallback(IKeyguardDismissCallback callback) {
202 try {
203 callback.onDismissError();
204 } catch (RemoteException e) {
205 Slog.w(TAG, "Failed to call callback", e);
206 }
207 }
208
Jorim Jaggife762342016-10-13 14:33:27 +0200209 private int convertTransitFlags(int keyguardGoingAwayFlags) {
210 int result = 0;
211 if ((keyguardGoingAwayFlags & KEYGUARD_GOING_AWAY_FLAG_TO_SHADE) != 0) {
212 result |= TRANSIT_FLAG_KEYGUARD_GOING_AWAY_TO_SHADE;
213 }
214 if ((keyguardGoingAwayFlags & KEYGUARD_GOING_AWAY_FLAG_NO_WINDOW_ANIMATIONS) != 0) {
215 result |= TRANSIT_FLAG_KEYGUARD_GOING_AWAY_NO_ANIMATION;
216 }
217 if ((keyguardGoingAwayFlags & KEYGUARD_GOING_AWAY_FLAG_WITH_WALLPAPER) != 0) {
218 result |= TRANSIT_FLAG_KEYGUARD_GOING_AWAY_WITH_WALLPAPER;
219 }
220 return result;
221 }
222
223 /**
224 * Starts a batch of visibility updates.
225 */
226 void beginActivityVisibilityUpdate() {
227 mVisibilityTransactionDepth++;
228 }
229
230 /**
231 * Ends a batch of visibility updates. After all batches are done, this method makes sure to
232 * update lockscreen occluded/dismiss state if needed.
233 */
234 void endActivityVisibilityUpdate() {
235 mVisibilityTransactionDepth--;
236 if (mVisibilityTransactionDepth == 0) {
237 visibilitiesUpdated();
238 }
239 }
240
Jorim Jaggie69c9312016-10-31 18:24:38 -0700241 /**
242 * @return True if we may show an activity while Keyguard is showing because we are in the
243 * process of dismissing it anyways, false otherwise.
244 */
Jorim Jaggi07961872016-11-23 11:28:57 +0100245 boolean canShowActivityWhileKeyguardShowing(ActivityRecord r, boolean dismissKeyguard) {
246
247 // Allow to show it when we are about to dismiss Keyguard. This isn't allowed if r is
248 // already the dismissing activity, in which case we don't allow it to repeatedly dismiss
249 // Keyguard.
Lucas Dupin47a65c72018-02-15 14:16:18 -0800250 return dismissKeyguard && canDismissKeyguard() && !mAodShowing
251 && (mDismissalRequested || r != mDismissingKeyguardActivity);
Jorim Jaggi07961872016-11-23 11:28:57 +0100252 }
253
254 /**
255 * @return True if we may show an activity while Keyguard is occluded, false otherwise.
256 */
257 boolean canShowWhileOccluded(boolean dismissKeyguard, boolean showWhenLocked) {
258 return showWhenLocked || dismissKeyguard && !mWindowManager.isKeyguardSecure();
Jorim Jaggie69c9312016-10-31 18:24:38 -0700259 }
260
Jorim Jaggife762342016-10-13 14:33:27 +0200261 private void visibilitiesUpdated() {
262 final boolean lastOccluded = mOccluded;
263 final ActivityRecord lastDismissingKeyguardActivity = mDismissingKeyguardActivity;
264 mOccluded = false;
265 mDismissingKeyguardActivity = null;
Jorim Jaggife762342016-10-13 14:33:27 +0200266
Pat Plunkett40426e02017-10-31 14:06:29 -0700267 for (int displayNdx = mStackSupervisor.getChildCount() - 1; displayNdx >= 0; displayNdx--) {
268 final ActivityDisplay display = mStackSupervisor.getChildAt(displayNdx);
269 for (int stackNdx = display.getChildCount() - 1; stackNdx >= 0; --stackNdx) {
270 final ActivityStack stack = display.getChildAt(stackNdx);
Jorim Jaggi07961872016-11-23 11:28:57 +0100271
Pat Plunkett40426e02017-10-31 14:06:29 -0700272 // Only the top activity of the focused stack on the default display may control
273 // occluded state.
274 if (display.mDisplayId == DEFAULT_DISPLAY
275 && mStackSupervisor.isFocusedStack(stack)) {
276
277 // A dismissing activity occludes Keyguard in the insecure case for legacy
278 // reasons.
279 final ActivityRecord topDismissing = stack.getTopDismissingKeyguardActivity();
280 mOccluded =
281 stack.topActivityOccludesKeyguard()
282 || (topDismissing != null
283 && stack.topRunningActivityLocked() == topDismissing
284 && canShowWhileOccluded(
285 true /* dismissKeyguard */,
286 false /* showWhenLocked */));
287 }
288
289 if (mDismissingKeyguardActivity == null
290 && stack.getTopDismissingKeyguardActivity() != null) {
291 mDismissingKeyguardActivity = stack.getTopDismissingKeyguardActivity();
292 }
Jorim Jaggife762342016-10-13 14:33:27 +0200293 }
294 }
Jorim Jaggi77e10432016-10-26 17:43:56 -0700295 mOccluded |= mWindowManager.isShowingDream();
Jorim Jaggife762342016-10-13 14:33:27 +0200296 if (mOccluded != lastOccluded) {
297 handleOccludedChanged();
298 }
299 if (mDismissingKeyguardActivity != lastDismissingKeyguardActivity) {
300 handleDismissKeyguard();
301 }
302 }
303
304 /**
305 * Called when occluded state changed.
306 */
307 private void handleOccludedChanged() {
308 mWindowManager.onKeyguardOccludedChanged(mOccluded);
309 if (isKeyguardLocked()) {
310 mWindowManager.deferSurfaceLayout();
311 try {
312 mWindowManager.prepareAppTransition(resolveOccludeTransit(),
313 false /* alwaysKeepCurrent */, 0 /* flags */, true /* forceOverride */);
David Stevens9440dc82017-03-16 19:00:20 -0700314 updateKeyguardSleepToken();
Jorim Jaggife762342016-10-13 14:33:27 +0200315 mStackSupervisor.ensureActivitiesVisibleLocked(null, 0, !PRESERVE_WINDOWS);
316 mWindowManager.executeAppTransition();
317 } finally {
318 mWindowManager.continueSurfaceLayout();
319 }
320 }
321 dismissDockedStackIfNeeded();
322 }
323
324 /**
325 * Called when somebody might want to dismiss the Keyguard.
326 */
327 private void handleDismissKeyguard() {
Jorim Jaggi07961872016-11-23 11:28:57 +0100328 // We only allow dismissing Keyguard via the flag when Keyguard is secure for legacy
329 // reasons, because that's how apps used to dismiss Keyguard in the secure case. In the
330 // insecure case, we actually show it on top of the lockscreen. See #canShowWhileOccluded.
331 if (!mOccluded && mDismissingKeyguardActivity != null
332 && mWindowManager.isKeyguardSecure()) {
Lucas Dupinc80c67e2017-12-04 14:29:10 -0800333 mWindowManager.dismissKeyguard(null /* callback */, null /* message */);
Jorim Jaggi07961872016-11-23 11:28:57 +0100334 mDismissalRequested = true;
Jorim Jaggife762342016-10-13 14:33:27 +0200335
336 // If we are about to unocclude the Keyguard, but we can dismiss it without security,
337 // we immediately dismiss the Keyguard so the activity gets shown without a flicker.
338 if (mKeyguardShowing && canDismissKeyguard()
339 && mWindowManager.getPendingAppTransition() == TRANSIT_KEYGUARD_UNOCCLUDE) {
340 mWindowManager.prepareAppTransition(mBeforeUnoccludeTransit,
341 false /* alwaysKeepCurrent */, 0 /* flags */, true /* forceOverride */);
Jorim Jaggife762342016-10-13 14:33:27 +0200342 mStackSupervisor.ensureActivitiesVisibleLocked(null, 0, !PRESERVE_WINDOWS);
343 mWindowManager.executeAppTransition();
344 }
345 }
346 }
347
348 /**
349 * @return true if Keyguard can be currently dismissed without entering credentials.
350 */
Andrii Kulianfc8f82b2017-01-26 13:17:27 -0800351 boolean canDismissKeyguard() {
Jorim Jaggife762342016-10-13 14:33:27 +0200352 return mWindowManager.isKeyguardTrusted() || !mWindowManager.isKeyguardSecure();
353 }
354
355 private int resolveOccludeTransit() {
356 if (mBeforeUnoccludeTransit != TRANSIT_UNSET
357 && mWindowManager.getPendingAppTransition() == TRANSIT_KEYGUARD_UNOCCLUDE
358 && mOccluded) {
359
360 // Reuse old transit in case we are occluding Keyguard again, meaning that we never
361 // actually occclude/unocclude Keyguard, but just run a normal transition.
362 return mBeforeUnoccludeTransit;
363 } else if (!mOccluded) {
364
365 // Save transit in case we dismiss/occlude Keyguard shortly after.
366 mBeforeUnoccludeTransit = mWindowManager.getPendingAppTransition();
367 return TRANSIT_KEYGUARD_UNOCCLUDE;
368 } else {
369 return TRANSIT_KEYGUARD_OCCLUDE;
370 }
371 }
372
373 private void dismissDockedStackIfNeeded() {
374 if (mKeyguardShowing && mOccluded) {
375 // The lock screen is currently showing, but is occluded by a window that can
376 // show on top of the lock screen. In this can we want to dismiss the docked
377 // stack since it will be complicated/risky to try to put the activity on top
378 // of the lock screen in the right fullscreen configuration.
Wale Ogunwalea0f5b5e2017-10-11 09:37:23 -0700379 final ActivityStack stack = mStackSupervisor.getDefaultDisplay().getSplitScreenPrimaryStack();
Wale Ogunwale9dcf9462017-09-19 15:13:01 -0700380 if (stack == null) {
381 return;
382 }
383 mStackSupervisor.moveTasksToFullscreenStackLocked(stack,
384 mStackSupervisor.mFocusedStack == stack);
Jorim Jaggife762342016-10-13 14:33:27 +0200385 }
386 }
Jorim Jaggi8d786932016-10-26 19:08:36 -0700387
David Stevens9440dc82017-03-16 19:00:20 -0700388 private void updateKeyguardSleepToken() {
Lucas Dupin47a65c72018-02-15 14:16:18 -0800389 if (mSleepToken == null && isKeyguardOrAodShowing(DEFAULT_DISPLAY)) {
David Stevens9440dc82017-03-16 19:00:20 -0700390 mSleepToken = mService.acquireSleepToken("Keyguard", DEFAULT_DISPLAY);
Lucas Dupin47a65c72018-02-15 14:16:18 -0800391 } else if (mSleepToken != null && !isKeyguardOrAodShowing(DEFAULT_DISPLAY)) {
David Stevens9440dc82017-03-16 19:00:20 -0700392 mSleepToken.release();
393 mSleepToken = null;
394 }
395 }
396
Jorim Jaggi8d786932016-10-26 19:08:36 -0700397 void dump(PrintWriter pw, String prefix) {
398 pw.println(prefix + "KeyguardController:");
399 pw.println(prefix + " mKeyguardShowing=" + mKeyguardShowing);
Lucas Dupin47a65c72018-02-15 14:16:18 -0800400 pw.println(prefix + " mAodShowing=" + mAodShowing);
Jorim Jaggi8d786932016-10-26 19:08:36 -0700401 pw.println(prefix + " mKeyguardGoingAway=" + mKeyguardGoingAway);
402 pw.println(prefix + " mOccluded=" + mOccluded);
403 pw.println(prefix + " mDismissingKeyguardActivity=" + mDismissingKeyguardActivity);
Jorim Jaggi07961872016-11-23 11:28:57 +0100404 pw.println(prefix + " mDismissalRequested=" + mDismissalRequested);
Jorim Jaggi8d786932016-10-26 19:08:36 -0700405 pw.println(prefix + " mVisibilityTransactionDepth=" + mVisibilityTransactionDepth);
406 }
Steven Timotius4346f0a2017-09-12 11:07:21 -0700407
408 void writeToProto(ProtoOutputStream proto, long fieldId) {
409 final long token = proto.start(fieldId);
410 proto.write(KEYGUARD_SHOWING, mKeyguardShowing);
411 proto.write(KEYGUARD_OCCLUDED, mOccluded);
412 proto.end(token);
413 }
Jorim Jaggife762342016-10-13 14:33:27 +0200414}