summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryce Lee <brycelee@google.com>2015-03-06 15:21:46 -0800
committerBryce Lee <brycelee@google.com>2015-03-06 15:21:46 -0800
commit8aeab6c8b9b89d77108fc05245561e33113fe27f (patch)
treeebcb1612e8d2fafd136438dcebdd527c2ac0b6c1
parent1e53b98c38b6606859f4b33a98d776cbb65f1a42 (diff)
downloadframeworks_base-8aeab6c8b9b89d77108fc05245561e33113fe27f.zip
frameworks_base-8aeab6c8b9b89d77108fc05245561e33113fe27f.tar.gz
frameworks_base-8aeab6c8b9b89d77108fc05245561e33113fe27f.tar.bz2
Allow the keyguard service to be configurable.
Change-Id: I811171c228764c3e0e507ad3ce28835ccad9bb31
-rwxr-xr-xcore/res/res/values/config.xml3
-rwxr-xr-xcore/res/res/values/symbols.xml3
-rw-r--r--policy/src/com/android/internal/policy/impl/keyguard/KeyguardServiceDelegate.java13
3 files changed, 14 insertions, 5 deletions
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 59686fd..254e256 100755
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -2087,4 +2087,7 @@
<!-- Specifies the maximum burn-in offset vertically. -->
<integer name="config_burnInProtectionMaxVerticalOffset">0</integer>
+
+ <!-- Keyguard component -->
+ <string name="config_keyguardComponent" translatable="false">com.android.systemui/com.android.systemui.keyguard.KeyguardService</string>
</resources>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 82c81a0..464e4d3 100755
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -2080,6 +2080,9 @@
<java-symbol type="array" name="config_clockTickVibePattern" />
<java-symbol type="array" name="config_calendarDateVibePattern" />
+ <!-- From KeyguardServiceDelegate -->
+ <java-symbol type="string" name="config_keyguardComponent" />
+
<!-- From various Material changes -->
<java-symbol type="attr" name="titleTextAppearance" />
<java-symbol type="attr" name="subtitleTextAppearance" />
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardServiceDelegate.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardServiceDelegate.java
index 6e8f550..6c98e50 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardServiceDelegate.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardServiceDelegate.java
@@ -5,6 +5,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.pm.ActivityInfo;
+import android.content.res.Resources;
import android.graphics.PixelFormat;
import android.os.Bundle;
import android.os.IBinder;
@@ -27,9 +28,6 @@ import com.android.internal.policy.IKeyguardShowCallback;
* local or remote instances of keyguard.
*/
public class KeyguardServiceDelegate {
- public static final String KEYGUARD_PACKAGE = "com.android.systemui";
- public static final String KEYGUARD_CLASS = "com.android.systemui.keyguard.KeyguardService";
-
private static final String TAG = "KeyguardServiceDelegate";
private static final boolean DEBUG = true;
@@ -111,10 +109,15 @@ public class KeyguardServiceDelegate {
public void bindService(Context context) {
Intent intent = new Intent();
- intent.setClassName(KEYGUARD_PACKAGE, KEYGUARD_CLASS);
+ final Resources resources = context.getApplicationContext().getResources();
+
+ final ComponentName keyguardComponent = ComponentName.unflattenFromString(
+ resources.getString(com.android.internal.R.string.config_keyguardComponent));
+ intent.setComponent(keyguardComponent);
+
if (!context.bindServiceAsUser(intent, mKeyguardConnection,
Context.BIND_AUTO_CREATE, UserHandle.OWNER)) {
- Log.v(TAG, "*** Keyguard: can't bind to " + KEYGUARD_CLASS);
+ Log.v(TAG, "*** Keyguard: can't bind to " + keyguardComponent);
mKeyguardState.showing = false;
mKeyguardState.showingAndNotOccluded = false;
mKeyguardState.secure = false;