• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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  */
16 package com.android.internal.policy;
17 
18 import com.android.internal.policy.IKeyguardDrawnCallback;
19 import com.android.internal.policy.IKeyguardStateCallback;
20 import com.android.internal.policy.IKeyguardExitCallback;
21 
22 import android.os.Bundle;
23 
24 oneway interface IKeyguardService {
25 
26     /**
27      * Sets the Keyguard as occluded when a window dismisses the Keyguard with flag
28      * FLAG_SHOW_ON_LOCK_SCREEN.
29      *
30      * @param isOccluded Whether the Keyguard is occluded by another window.
31      */
setOccluded(boolean isOccluded)32     void setOccluded(boolean isOccluded);
33 
addStateMonitorCallback(IKeyguardStateCallback callback)34     void addStateMonitorCallback(IKeyguardStateCallback callback);
verifyUnlock(IKeyguardExitCallback callback)35     void verifyUnlock(IKeyguardExitCallback callback);
keyguardDone(boolean authenticated, boolean wakeup)36     void keyguardDone(boolean authenticated, boolean wakeup);
dismiss(boolean allowWhileOccluded)37     void dismiss(boolean allowWhileOccluded);
onDreamingStarted()38     void onDreamingStarted();
onDreamingStopped()39     void onDreamingStopped();
40 
41     /**
42      * Called when the device has started going to sleep.
43      *
44      * @param why {@link #OFF_BECAUSE_OF_USER}, {@link #OFF_BECAUSE_OF_ADMIN},
45      * or {@link #OFF_BECAUSE_OF_TIMEOUT}.
46      */
onStartedGoingToSleep(int reason)47     void onStartedGoingToSleep(int reason);
48 
49     /**
50      * Called when the device has finished going to sleep.
51      *
52      * @param why {@link #OFF_BECAUSE_OF_USER}, {@link #OFF_BECAUSE_OF_ADMIN},
53      *            or {@link #OFF_BECAUSE_OF_TIMEOUT}.
54      * @param cameraGestureTriggered whether the camera gesture was triggered between
55      *                               {@link #onStartedGoingToSleep} and this method; if it's been
56      *                               triggered, we shouldn't lock the device.
57      */
onFinishedGoingToSleep(int reason, boolean cameraGestureTriggered)58     void onFinishedGoingToSleep(int reason, boolean cameraGestureTriggered);
59 
60     /**
61      * Called when the device has started waking up.
62      */
onStartedWakingUp()63     void onStartedWakingUp();
64 
65     /**
66      * Called when the device screen is turning on.
67      */
onScreenTurningOn(IKeyguardDrawnCallback callback)68     void onScreenTurningOn(IKeyguardDrawnCallback callback);
69 
70     /**
71      * Called when the screen has actually turned on.
72      */
onScreenTurnedOn()73     void onScreenTurnedOn();
74 
75     /**
76      * Called when the screen has turned off.
77      */
onScreenTurnedOff()78     void onScreenTurnedOff();
79 
setKeyguardEnabled(boolean enabled)80     void setKeyguardEnabled(boolean enabled);
onSystemReady()81     void onSystemReady();
doKeyguardTimeout(in Bundle options)82     void doKeyguardTimeout(in Bundle options);
setCurrentUser(int userId)83     void setCurrentUser(int userId);
onBootCompleted()84     void onBootCompleted();
85 
86     /**
87      * Notifies that the activity behind has now been drawn and it's safe to remove the wallpaper
88      * and keyguard flag.
89      *
90      * @param startTime the start time of the animation in uptime milliseconds
91      * @param fadeoutDuration the duration of the exit animation, in milliseconds
92      */
startKeyguardExitAnimation(long startTime, long fadeoutDuration)93     void startKeyguardExitAnimation(long startTime, long fadeoutDuration);
94 
95     /**
96      * Notifies the Keyguard that the activity that was starting has now been drawn and it's safe
97      * to start the keyguard dismiss sequence.
98      */
onActivityDrawn()99     void onActivityDrawn();
100 }
101