summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorAdnan Begovic <adnan@cyngn.com>2015-12-11 12:38:25 -0800
committerAdnan Begovic <adnan@cyngn.com>2015-12-11 14:38:43 -0800
commit4601c9fda34494c2b5f9b34e328a560cc153b7d9 (patch)
tree276fbec3dfb2b1914d9c0ec2fb9ae624a9248ddd /services
parent36cf346880e9de490ed8568b5ccdb2574df72634 (diff)
downloadframeworks_base-4601c9fda34494c2b5f9b34e328a560cc153b7d9.zip
frameworks_base-4601c9fda34494c2b5f9b34e328a560cc153b7d9.tar.gz
frameworks_base-4601c9fda34494c2b5f9b34e328a560cc153b7d9.tar.bz2
SystemUi: Readd LockscreenToggleTile.
Change-Id: Ib1e627bf5432ce54a9f81a5ba65da7c687c232d6
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java14
1 files changed, 14 insertions, 0 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 936dcb1..cb09dd4 100644
--- a/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java
+++ b/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java
@@ -49,6 +49,10 @@ public class KeyguardServiceDelegate {
private final KeyguardState mKeyguardState = new KeyguardState();
private DrawnListener mDrawnListenerWhenConnect;
+ private static final String ACTION_STATE_CHANGE =
+ "com.android.internal.action.KEYGUARD_SERVICE_STATE_CHANGED";
+ private static final String EXTRA_ACTIVE = "active";
+
private static final class KeyguardState {
KeyguardState() {
// Assume keyguard is showing and secure until we know for sure. This is here in
@@ -79,6 +83,13 @@ public class KeyguardServiceDelegate {
void onDrawn();
}
+ private void sendStateChangeBroadcast(boolean bound) {
+ Intent i = new Intent(ACTION_STATE_CHANGE);
+ i.putExtra(EXTRA_ACTIVE, bound);
+ mScrim.getContext().sendBroadcastAsUser(i, UserHandle.ALL,
+ android.Manifest.permission.CONTROL_KEYGUARD);
+ }
+
// A delegate class to map a particular invocation with a ShowListener object.
private final class KeyguardShowDelegate extends IKeyguardDrawnCallback.Stub {
private DrawnListener mDrawnListener;
@@ -171,6 +182,7 @@ public class KeyguardServiceDelegate {
}
if (mKeyguardState.bootCompleted) {
mKeyguardService.onBootCompleted();
+ sendStateChangeBroadcast(true);
}
if (mKeyguardState.occluded) {
mKeyguardService.setOccluded(mKeyguardState.occluded);
@@ -181,6 +193,7 @@ public class KeyguardServiceDelegate {
public void onServiceDisconnected(ComponentName name) {
if (DEBUG) Log.v(TAG, "*** Keyguard disconnected (boo!)");
mKeyguardService = null;
+ sendStateChangeBroadcast(false);
}
};
@@ -388,6 +401,7 @@ public class KeyguardServiceDelegate {
mKeyguardService.onBootCompleted();
}
mKeyguardState.bootCompleted = true;
+ sendStateChangeBroadcast(true);
}
public void onActivityDrawn() {