Jim Miller | 5ecd811 | 2013-01-09 18:50:26 -0800 | [diff] [blame] | 1 | /* |
Jim Miller | 2519057 | 2013-02-28 17:36:24 -0800 | [diff] [blame] | 2 | * Copyright (C) 2013 The Android Open Source Project |
Jim Miller | 5ecd811 | 2013-01-09 18:50:26 -0800 | [diff] [blame] | 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 | package com.android.internal.policy; |
| 17 | |
Jorim Jaggi | 740452e | 2015-07-09 12:13:59 -0700 | [diff] [blame] | 18 | import com.android.internal.policy.IKeyguardDrawnCallback; |
Jorim Jaggi | 241ae10 | 2016-11-02 21:57:33 -0700 | [diff] [blame] | 19 | import com.android.internal.policy.IKeyguardDismissCallback; |
Jim Miller | ab95454 | 2014-10-10 18:21:49 -0700 | [diff] [blame] | 20 | import com.android.internal.policy.IKeyguardStateCallback; |
Jim Miller | 2519057 | 2013-02-28 17:36:24 -0800 | [diff] [blame] | 21 | import com.android.internal.policy.IKeyguardExitCallback; |
Jim Miller | 5ecd811 | 2013-01-09 18:50:26 -0800 | [diff] [blame] | 22 | |
| 23 | import android.os.Bundle; |
| 24 | |
Jim Miller | ab95454 | 2014-10-10 18:21:49 -0700 | [diff] [blame] | 25 | oneway interface IKeyguardService { |
Jorim Jaggi | d175b6c | 2015-05-27 15:39:09 -0700 | [diff] [blame] | 26 | |
Jorim Jaggi | 380ecb8 | 2014-03-14 17:25:20 +0100 | [diff] [blame] | 27 | /** |
Jorim Jaggi | 5cf1787 | 2014-03-26 18:31:48 +0100 | [diff] [blame] | 28 | * Sets the Keyguard as occluded when a window dismisses the Keyguard with flag |
| 29 | * FLAG_SHOW_ON_LOCK_SCREEN. |
Jorim Jaggi | 380ecb8 | 2014-03-14 17:25:20 +0100 | [diff] [blame] | 30 | * |
Jorim Jaggi | 5cf1787 | 2014-03-26 18:31:48 +0100 | [diff] [blame] | 31 | * @param isOccluded Whether the Keyguard is occluded by another window. |
Jorim Jaggi | 6626f54 | 2016-08-22 13:08:44 -0700 | [diff] [blame] | 32 | * @param animate Whether to play an animation for the state change. |
Jorim Jaggi | 380ecb8 | 2014-03-14 17:25:20 +0100 | [diff] [blame] | 33 | */ |
Jorim Jaggi | 6626f54 | 2016-08-22 13:08:44 -0700 | [diff] [blame] | 34 | void setOccluded(boolean isOccluded, boolean animate); |
Jorim Jaggi | 380ecb8 | 2014-03-14 17:25:20 +0100 | [diff] [blame] | 35 | |
Jim Miller | ab95454 | 2014-10-10 18:21:49 -0700 | [diff] [blame] | 36 | void addStateMonitorCallback(IKeyguardStateCallback callback); |
| 37 | void verifyUnlock(IKeyguardExitCallback callback); |
Lucas Dupin | c80c67e | 2017-12-04 14:29:10 -0800 | [diff] [blame] | 38 | void dismiss(IKeyguardDismissCallback callback, CharSequence message); |
Jim Miller | ab95454 | 2014-10-10 18:21:49 -0700 | [diff] [blame] | 39 | void onDreamingStarted(); |
| 40 | void onDreamingStopped(); |
Jorim Jaggi | d175b6c | 2015-05-27 15:39:09 -0700 | [diff] [blame] | 41 | |
| 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 Jaggi | f1cdf95 | 2016-04-05 21:41:06 -0700 | [diff] [blame] | 54 | * 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 Jaggi | d175b6c | 2015-05-27 15:39:09 -0700 | [diff] [blame] | 58 | */ |
Jorim Jaggi | f1cdf95 | 2016-04-05 21:41:06 -0700 | [diff] [blame] | 59 | void onFinishedGoingToSleep(int reason, boolean cameraGestureTriggered); |
Jorim Jaggi | d175b6c | 2015-05-27 15:39:09 -0700 | [diff] [blame] | 60 | |
| 61 | /** |
| 62 | * Called when the device has started waking up. |
| 63 | */ |
Jorim Jaggi | 740452e | 2015-07-09 12:13:59 -0700 | [diff] [blame] | 64 | void onStartedWakingUp(); |
| 65 | |
| 66 | /** |
Adrian Roos | 369907f | 2017-07-14 14:53:39 +0200 | [diff] [blame] | 67 | * Called when the device has finished waking up. |
| 68 | */ |
| 69 | void onFinishedWakingUp(); |
| 70 | |
| 71 | /** |
Jorim Jaggi | 740452e | 2015-07-09 12:13:59 -0700 | [diff] [blame] | 72 | * Called when the device screen is turning on. |
| 73 | */ |
| 74 | void onScreenTurningOn(IKeyguardDrawnCallback callback); |
| 75 | |
Jorim Jaggi | 0d210f6 | 2015-07-10 14:24:44 -0700 | [diff] [blame] | 76 | /** |
| 77 | * Called when the screen has actually turned on. |
| 78 | */ |
| 79 | void onScreenTurnedOn(); |
| 80 | |
| 81 | /** |
Adrian Roos | 369907f | 2017-07-14 14:53:39 +0200 | [diff] [blame] | 82 | * Called when the screen starts turning off. |
| 83 | */ |
| 84 | void onScreenTurningOff(); |
| 85 | |
| 86 | /** |
Jorim Jaggi | 0d210f6 | 2015-07-10 14:24:44 -0700 | [diff] [blame] | 87 | * Called when the screen has turned off. |
| 88 | */ |
| 89 | void onScreenTurnedOff(); |
| 90 | |
Jim Miller | ab95454 | 2014-10-10 18:21:49 -0700 | [diff] [blame] | 91 | void setKeyguardEnabled(boolean enabled); |
| 92 | void onSystemReady(); |
| 93 | void doKeyguardTimeout(in Bundle options); |
Evan Rosky | 1839645 | 2016-07-27 15:19:37 -0700 | [diff] [blame] | 94 | void setSwitchingUser(boolean switching); |
Jim Miller | ab95454 | 2014-10-10 18:21:49 -0700 | [diff] [blame] | 95 | void setCurrentUser(int userId); |
| 96 | void onBootCompleted(); |
Jorim Jaggi | 0d67462 | 2014-05-21 01:34:15 +0200 | [diff] [blame] | 97 | |
| 98 | /** |
| 99 | * Notifies that the activity behind has now been drawn and it's safe to remove the wallpaper |
| 100 | * and keyguard flag. |
Jorim Jaggi | e29b2db | 2014-05-30 23:17:03 +0200 | [diff] [blame] | 101 | * |
| 102 | * @param startTime the start time of the animation in uptime milliseconds |
| 103 | * @param fadeoutDuration the duration of the exit animation, in milliseconds |
Jorim Jaggi | 0d67462 | 2014-05-21 01:34:15 +0200 | [diff] [blame] | 104 | */ |
Jim Miller | ab95454 | 2014-10-10 18:21:49 -0700 | [diff] [blame] | 105 | void startKeyguardExitAnimation(long startTime, long fadeoutDuration); |
Andrew Zeng | b4045d3 | 2017-03-16 17:25:07 -0700 | [diff] [blame] | 106 | |
| 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 Miller | 5ecd811 | 2013-01-09 18:50:26 -0800 | [diff] [blame] | 112 | } |