diff options
| author | Bryce Lee <brycelee@google.com> | 2015-03-09 15:35:38 +0000 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2015-03-09 15:35:38 +0000 |
| commit | 1b8df04b8d754f68dc6bfa6caa9e0a2666d16933 (patch) | |
| tree | 5765fce2c2e24011c0a9f48eb4f096662b2ba3af /policy | |
| parent | 168d0ade0cb5a733c83d7dcfdf0a0efa3250cb16 (diff) | |
| parent | 8aeab6c8b9b89d77108fc05245561e33113fe27f (diff) | |
| download | frameworks_base-1b8df04b8d754f68dc6bfa6caa9e0a2666d16933.zip frameworks_base-1b8df04b8d754f68dc6bfa6caa9e0a2666d16933.tar.gz frameworks_base-1b8df04b8d754f68dc6bfa6caa9e0a2666d16933.tar.bz2 | |
am 8aeab6c8: Allow the keyguard service to be configurable.
* commit '8aeab6c8b9b89d77108fc05245561e33113fe27f':
Allow the keyguard service to be configurable.
Diffstat (limited to 'policy')
| -rw-r--r-- | policy/src/com/android/internal/policy/impl/keyguard/KeyguardServiceDelegate.java | 13 |
1 files changed, 8 insertions, 5 deletions
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; |
