blob: e5d5685ab3e85a02522ed18f689e0fe60cb4145a [file] [log] [blame]
Jim Miller5ecd8112013-01-09 18:50:26 -08001/*
Jim Miller25190572013-02-28 17:36:24 -08002 * Copyright (C) 2013 The Android Open Source Project
Jim Miller5ecd8112013-01-09 18:50:26 -08003 *
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 */
16package com.android.internal.policy;
17
Jorim Jaggi740452e2015-07-09 12:13:59 -070018import com.android.internal.policy.IKeyguardDrawnCallback;
Jorim Jaggi241ae102016-11-02 21:57:33 -070019import com.android.internal.policy.IKeyguardDismissCallback;
Jim Millerab954542014-10-10 18:21:49 -070020import com.android.internal.policy.IKeyguardStateCallback;
Jim Miller25190572013-02-28 17:36:24 -080021import com.android.internal.policy.IKeyguardExitCallback;
Jim Miller5ecd8112013-01-09 18:50:26 -080022
23import android.os.Bundle;
24
Jim Millerab954542014-10-10 18:21:49 -070025oneway interface IKeyguardService {
Jorim Jaggid175b6c2015-05-27 15:39:09 -070026
Jorim Jaggi380ecb82014-03-14 17:25:20 +010027 /**
Jorim Jaggi5cf17872014-03-26 18:31:48 +010028 * Sets the Keyguard as occluded when a window dismisses the Keyguard with flag
29 * FLAG_SHOW_ON_LOCK_SCREEN.
Jorim Jaggi380ecb82014-03-14 17:25:20 +010030 *
Jorim Jaggi5cf17872014-03-26 18:31:48 +010031 * @param isOccluded Whether the Keyguard is occluded by another window.
Jorim Jaggi6626f542016-08-22 13:08:44 -070032 * @param animate Whether to play an animation for the state change.
Jorim Jaggi380ecb82014-03-14 17:25:20 +010033 */
Jorim Jaggi6626f542016-08-22 13:08:44 -070034 void setOccluded(boolean isOccluded, boolean animate);
Jorim Jaggi380ecb82014-03-14 17:25:20 +010035
Jim Millerab954542014-10-10 18:21:49 -070036 void addStateMonitorCallback(IKeyguardStateCallback callback);
37 void verifyUnlock(IKeyguardExitCallback callback);
Lucas Dupinc80c67e2017-12-04 14:29:10 -080038 void dismiss(IKeyguardDismissCallback callback, CharSequence message);
Jim Millerab954542014-10-10 18:21:49 -070039 void onDreamingStarted();
40 void onDreamingStopped();
Jorim Jaggid175b6c2015-05-27 15:39:09 -070041
42 /**
43 * Called when the device has started going to sleep.
44 *
45 * @param why {@link #OFF_BECAUSE_OF_USER}, {@link #OFF_BECAUSE_OF_ADMIN},
46 * or {@link #OFF_BECAUSE_OF_TIMEOUT}.
47 */
48 void onStartedGoingToSleep(int reason);
49
50 /**
51 * Called when the device has finished going to sleep.
52 *
53 * @param why {@link #OFF_BECAUSE_OF_USER}, {@link #OFF_BECAUSE_OF_ADMIN},
Jorim Jaggif1cdf952016-04-05 21:41:06 -070054 * or {@link #OFF_BECAUSE_OF_TIMEOUT}.
55 * @param cameraGestureTriggered whether the camera gesture was triggered between
56 * {@link #onStartedGoingToSleep} and this method; if it's been
57 * triggered, we shouldn't lock the device.
Jorim Jaggid175b6c2015-05-27 15:39:09 -070058 */
Jorim Jaggif1cdf952016-04-05 21:41:06 -070059 void onFinishedGoingToSleep(int reason, boolean cameraGestureTriggered);
Jorim Jaggid175b6c2015-05-27 15:39:09 -070060
61 /**
62 * Called when the device has started waking up.
63 */
Jorim Jaggi740452e2015-07-09 12:13:59 -070064 void onStartedWakingUp();
65
66 /**
Adrian Roos369907f2017-07-14 14:53:39 +020067 * Called when the device has finished waking up.
68 */
69 void onFinishedWakingUp();
70
71 /**
Jorim Jaggi740452e2015-07-09 12:13:59 -070072 * Called when the device screen is turning on.
73 */
74 void onScreenTurningOn(IKeyguardDrawnCallback callback);
75
Jorim Jaggi0d210f62015-07-10 14:24:44 -070076 /**
77 * Called when the screen has actually turned on.
78 */
79 void onScreenTurnedOn();
80
81 /**
Adrian Roos369907f2017-07-14 14:53:39 +020082 * Called when the screen starts turning off.
83 */
84 void onScreenTurningOff();
85
86 /**
Jorim Jaggi0d210f62015-07-10 14:24:44 -070087 * Called when the screen has turned off.
88 */
89 void onScreenTurnedOff();
90
Jim Millerab954542014-10-10 18:21:49 -070091 void setKeyguardEnabled(boolean enabled);
92 void onSystemReady();
93 void doKeyguardTimeout(in Bundle options);
Evan Rosky18396452016-07-27 15:19:37 -070094 void setSwitchingUser(boolean switching);
Jim Millerab954542014-10-10 18:21:49 -070095 void setCurrentUser(int userId);
96 void onBootCompleted();
Jorim Jaggi0d674622014-05-21 01:34:15 +020097
98 /**
99 * Notifies that the activity behind has now been drawn and it's safe to remove the wallpaper
100 * and keyguard flag.
Jorim Jaggie29b2db2014-05-30 23:17:03 +0200101 *
102 * @param startTime the start time of the animation in uptime milliseconds
103 * @param fadeoutDuration the duration of the exit animation, in milliseconds
Jorim Jaggi0d674622014-05-21 01:34:15 +0200104 */
Jim Millerab954542014-10-10 18:21:49 -0700105 void startKeyguardExitAnimation(long startTime, long fadeoutDuration);
Andrew Zengb4045d32017-03-16 17:25:07 -0700106
107 /**
108 * Notifies the Keyguard that the power key was pressed while locked and launched Home rather
109 * than putting the device to sleep or waking up.
110 */
111 void onShortPowerPressedGoHome();
Jim Miller5ecd8112013-01-09 18:50:26 -0800112}