IKeyguardService.aidl revision b4045d3791566a1965024591def87dff7d120295
1/*
2 * Copyright (C) 2013 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 */
16package com.android.internal.policy;
17
18import com.android.internal.policy.IKeyguardDrawnCallback;
19import com.android.internal.policy.IKeyguardDismissCallback;
20import com.android.internal.policy.IKeyguardStateCallback;
21import com.android.internal.policy.IKeyguardExitCallback;
22
23import android.os.Bundle;
24
25oneway interface IKeyguardService {
26
27    /**
28     * Sets the Keyguard as occluded when a window dismisses the Keyguard with flag
29     * FLAG_SHOW_ON_LOCK_SCREEN.
30     *
31     * @param isOccluded Whether the Keyguard is occluded by another window.
32     * @param animate Whether to play an animation for the state change.
33     */
34    void setOccluded(boolean isOccluded, boolean animate);
35
36    void addStateMonitorCallback(IKeyguardStateCallback callback);
37    void verifyUnlock(IKeyguardExitCallback callback);
38    void dismiss(IKeyguardDismissCallback callback);
39    void onDreamingStarted();
40    void onDreamingStopped();
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},
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.
58     */
59    void onFinishedGoingToSleep(int reason, boolean cameraGestureTriggered);
60
61    /**
62     * Called when the device has started waking up.
63     */
64    void onStartedWakingUp();
65
66    /**
67     * Called when the device screen is turning on.
68     */
69    void onScreenTurningOn(IKeyguardDrawnCallback callback);
70
71    /**
72     * Called when the screen has actually turned on.
73     */
74    void onScreenTurnedOn();
75
76    /**
77     * Called when the screen has turned off.
78     */
79    void onScreenTurnedOff();
80
81    void setKeyguardEnabled(boolean enabled);
82    void onSystemReady();
83    void doKeyguardTimeout(in Bundle options);
84    void setSwitchingUser(boolean switching);
85    void setCurrentUser(int userId);
86    void onBootCompleted();
87
88    /**
89     * Notifies that the activity behind has now been drawn and it's safe to remove the wallpaper
90     * and keyguard flag.
91     *
92     * @param startTime the start time of the animation in uptime milliseconds
93     * @param fadeoutDuration the duration of the exit animation, in milliseconds
94     */
95    void startKeyguardExitAnimation(long startTime, long fadeoutDuration);
96
97    /**
98     * Notifies the Keyguard that the power key was pressed while locked and launched Home rather
99     * than putting the device to sleep or waking up.
100     */
101    void onShortPowerPressedGoHome();
102}
103