am 8aeab6c8: Allow the keyguard service to be configurable.
* commit '8aeab6c8b9b89d77108fc05245561e33113fe27f': Allow the keyguard service to be configurable.
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -2063,6 +2063,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" />
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user