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

Commit c008e0a5 authored by Tobias Haamel's avatar Tobias Haamel
Browse files

Fix 2514479: Putting phone in car dock ignores security pattern

Don't disable the keylock pattern when the device is in car mode.
Instead it should be possible to show the lock pattern at least once
and after valid authentication it should be disabled in the system.
Since this requires additional discussion it will be moved to the
next Android release.

Change-Id: I28cddcfb6640e44a29c716b59a3d6e37e8003dca
parent 9ab518ad
Loading
Loading
Loading
Loading
+0 −20
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ import android.app.Activity;
import android.app.ActivityManagerNative;
import android.app.AlarmManager;
import android.app.IActivityManager;
import android.app.KeyguardManager;
import android.app.IUiModeManager;
import android.app.Notification;
import android.app.NotificationManager;
@@ -103,7 +102,6 @@ class UiModeManagerService extends IUiModeManager.Stub {
    private LocationManager mLocationManager;
    private Location mLocation;
    private StatusBarManager mStatusBarManager;
    private KeyguardManager.KeyguardLock mKeyguardLock;
    private final PowerManager.WakeLock mWakeLock;

    // The broadcast receiver which receives the result of the ordered broadcast sent when
@@ -347,24 +345,6 @@ class UiModeManagerService extends IUiModeManager.Stub {
    void setCarModeLocked(boolean enabled) {
        if (mCarModeEnabled != enabled) {
            mCarModeEnabled = enabled;

            // Disable keyguard when in car mode
            if (mKeyguardLock == null) {
                KeyguardManager km =
                        (KeyguardManager)mContext.getSystemService(Context.KEYGUARD_SERVICE);
                if (km != null) {
                    mKeyguardLock = km.newKeyguardLock(TAG);
                }
            }
            if (mKeyguardLock != null) {
                long ident = Binder.clearCallingIdentity();
                if (enabled) {
                    mKeyguardLock.disableKeyguard();
                } else {
                    mKeyguardLock.reenableKeyguard();
                }
                Binder.restoreCallingIdentity(ident);
            }
        }
    }