summaryrefslogtreecommitdiffstats
path: root/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java
diff options
context:
space:
mode:
Diffstat (limited to 'services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java')
-rw-r--r--services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java46
1 files changed, 27 insertions, 19 deletions
diff --git a/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java b/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java
index 1406789..0f3a199 100644
--- a/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java
+++ b/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java
@@ -18,9 +18,9 @@ import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.WindowManagerPolicy.OnKeyguardExitResult;
+import com.android.internal.policy.IKeyguardDrawnCallback;
import com.android.internal.policy.IKeyguardExitCallback;
import com.android.internal.policy.IKeyguardService;
-import com.android.internal.policy.IKeyguardShowCallback;
/**
* A local class that keeps a cache of keyguard state that can be restored in the event
@@ -35,7 +35,7 @@ public class KeyguardServiceDelegate {
private final Context mContext;
private final View mScrim; // shown if keyguard crashes
private final KeyguardState mKeyguardState = new KeyguardState();
- private ShowListener mShowListenerWhenConnect;
+ private DrawnListener mDrawnListenerWhenConnect;
private static final class KeyguardState {
KeyguardState() {
@@ -61,23 +61,23 @@ public class KeyguardServiceDelegate {
public boolean bootCompleted;
};
- public interface ShowListener {
- public void onShown(IBinder windowToken);
+ public interface DrawnListener {
+ void onDrawn();
}
// A delegate class to map a particular invocation with a ShowListener object.
- private final class KeyguardShowDelegate extends IKeyguardShowCallback.Stub {
- private ShowListener mShowListener;
+ private final class KeyguardShowDelegate extends IKeyguardDrawnCallback.Stub {
+ private DrawnListener mDrawnListener;
- KeyguardShowDelegate(ShowListener showListener) {
- mShowListener = showListener;
+ KeyguardShowDelegate(DrawnListener drawnListener) {
+ mDrawnListener = drawnListener;
}
@Override
- public void onShown(IBinder windowToken) throws RemoteException {
+ public void onDrawn() throws RemoteException {
if (DEBUG) Log.v(TAG, "**** SHOWN CALLED ****");
- if (mShowListener != null) {
- mShowListener.onShown(windowToken);
+ if (mDrawnListener != null) {
+ mDrawnListener.onDrawn();
}
hideScrim();
}
@@ -141,9 +141,10 @@ public class KeyguardServiceDelegate {
// If the system is ready, it means keyguard crashed and restarted.
mKeyguardService.onSystemReady();
// This is used to hide the scrim once keyguard displays.
- mKeyguardService.onStartedWakingUp(new KeyguardShowDelegate(
- mShowListenerWhenConnect));
- mShowListenerWhenConnect = null;
+ mKeyguardService.onStartedWakingUp();
+ mKeyguardService.onScreenTurningOn(
+ new KeyguardShowDelegate(mDrawnListenerWhenConnect));
+ mDrawnListenerWhenConnect = null;
}
if (mKeyguardState.bootCompleted) {
mKeyguardService.onBootCompleted();
@@ -221,16 +222,23 @@ public class KeyguardServiceDelegate {
mKeyguardState.dreaming = false;
}
- public void onStartedWakingUp(final ShowListener showListener) {
+ public void onStartedWakingUp() {
if (mKeyguardService != null) {
- if (DEBUG) Log.v(TAG, "onScreenTurnedOn(showListener = " + showListener + ")");
- mKeyguardService.onStartedWakingUp(new KeyguardShowDelegate(showListener));
+ if (DEBUG) Log.v(TAG, "onStartedWakingUp()");
+ mKeyguardService.onStartedWakingUp();
+ }
+ }
+
+ public void onScreenTurningOn(final DrawnListener drawnListener) {
+ if (mKeyguardService != null) {
+ if (DEBUG) Log.v(TAG, "onScreenTurnedOn(showListener = " + drawnListener + ")");
+ mKeyguardService.onScreenTurningOn(new KeyguardShowDelegate(drawnListener));
} else {
// try again when we establish a connection
- Slog.w(TAG, "onScreenTurnedOn(): no keyguard service!");
+ Slog.w(TAG, "onScreenTurningOn(): no keyguard service!");
// This shouldn't happen, but if it does, show the scrim immediately and
// invoke the listener's callback after the service actually connects.
- mShowListenerWhenConnect = showListener;
+ mDrawnListenerWhenConnect = drawnListener;
showScrim();
}
}