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

Commit 878ba0a2 authored by Paul Lawrence's avatar Paul Lawrence
Browse files

Save PatternVisible setting to crypto header

Bug: 17059314
Change-Id: Ic64c64567f70ea11030cabfd33b57f77fb23dac7
parent fe9c0a58
Loading
Loading
Loading
Loading
+19 −0
Original line number Original line Diff line number Diff line
@@ -1093,6 +1093,25 @@ public class LockPatternUtils {
     */
     */
    public void setVisiblePatternEnabled(boolean enabled) {
    public void setVisiblePatternEnabled(boolean enabled) {
        setBoolean(Settings.Secure.LOCK_PATTERN_VISIBLE, enabled);
        setBoolean(Settings.Secure.LOCK_PATTERN_VISIBLE, enabled);

        // Update for crypto if owner
        int userId = getCurrentOrCallingUserId();
        if (userId != UserHandle.USER_OWNER) {
            return;
        }

        IBinder service = ServiceManager.getService("mount");
        if (service == null) {
            Log.e(TAG, "Could not find the mount service to update the user info");
            return;
        }

        IMountService mountService = IMountService.Stub.asInterface(service);
        try {
            mountService.setField("PatternVisible", enabled ? "1" : "0");
        } catch (RemoteException e) {
            Log.e(TAG, "Error changing pattern visible state", e);
        }
    }
    }


    /**
    /**