Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8aeab6c8 authored by Bryce Lee's avatar Bryce Lee
Browse files

Allow the keyguard service to be configurable.

Change-Id: I811171c228764c3e0e507ad3ce28835ccad9bb31
parent 1e53b98c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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>
+3 −0
Original line number Diff line number Diff line
@@ -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" />
+8 −5
Original line number Diff line number Diff line
@@ -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;