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

Commit 3874e9c8 authored by d34d's avatar d34d Committed by Michael Bestas
Browse files

LockPatternUtils: Make settings getter and setters protected

This patch will allow us to extend LockPatternUtils in lineage-sdk
and have access to getting and setting lock settings, and minimize
code changes to the original LockPatternUtils class.

Change-Id: I3417f64db1f05cffab47328df574f23dd20776d5
parent 16c3196e
Loading
Loading
Loading
Loading
+12 −6
Original line number Original line Diff line number Diff line
@@ -1208,7 +1208,8 @@ public class LockPatternUtils {
        return deadline;
        return deadline;
    }
    }


    private boolean getBoolean(String secureSettingKey, boolean defaultValue, int userId) {
    /** @hide */
    protected boolean getBoolean(String secureSettingKey, boolean defaultValue, int userId) {
        try {
        try {
            return getLockSettings().getBoolean(secureSettingKey, defaultValue, userId);
            return getLockSettings().getBoolean(secureSettingKey, defaultValue, userId);
        } catch (RemoteException re) {
        } catch (RemoteException re) {
@@ -1216,7 +1217,8 @@ public class LockPatternUtils {
        }
        }
    }
    }


    private void setBoolean(String secureSettingKey, boolean enabled, int userId) {
    /** @hide */
    protected void setBoolean(String secureSettingKey, boolean enabled, int userId) {
        try {
        try {
            getLockSettings().setBoolean(secureSettingKey, enabled, userId);
            getLockSettings().setBoolean(secureSettingKey, enabled, userId);
        } catch (RemoteException re) {
        } catch (RemoteException re) {
@@ -1225,7 +1227,8 @@ public class LockPatternUtils {
        }
        }
    }
    }


    private long getLong(String secureSettingKey, long defaultValue, int userHandle) {
    /** @hide */
    protected long getLong(String secureSettingKey, long defaultValue, int userHandle) {
        try {
        try {
            return getLockSettings().getLong(secureSettingKey, defaultValue, userHandle);
            return getLockSettings().getLong(secureSettingKey, defaultValue, userHandle);
        } catch (RemoteException re) {
        } catch (RemoteException re) {
@@ -1233,8 +1236,9 @@ public class LockPatternUtils {
        }
        }
    }
    }


    /** @hide */
    @UnsupportedAppUsage
    @UnsupportedAppUsage
    private void setLong(String secureSettingKey, long value, int userHandle) {
    protected void setLong(String secureSettingKey, long value, int userHandle) {
        try {
        try {
            getLockSettings().setLong(secureSettingKey, value, userHandle);
            getLockSettings().setLong(secureSettingKey, value, userHandle);
        } catch (RemoteException re) {
        } catch (RemoteException re) {
@@ -1243,8 +1247,9 @@ public class LockPatternUtils {
        }
        }
    }
    }


    /** @hide */
    @UnsupportedAppUsage
    @UnsupportedAppUsage
    private String getString(String secureSettingKey, int userHandle) {
    protected String getString(String secureSettingKey, int userHandle) {
        try {
        try {
            return getLockSettings().getString(secureSettingKey, null, userHandle);
            return getLockSettings().getString(secureSettingKey, null, userHandle);
        } catch (RemoteException re) {
        } catch (RemoteException re) {
@@ -1252,8 +1257,9 @@ public class LockPatternUtils {
        }
        }
    }
    }


    /** @hide */
    @UnsupportedAppUsage
    @UnsupportedAppUsage
    private void setString(String secureSettingKey, String value, int userHandle) {
    protected void setString(String secureSettingKey, String value, int userHandle) {
        try {
        try {
            getLockSettings().setString(secureSettingKey, value, userHandle);
            getLockSettings().setString(secureSettingKey, value, userHandle);
        } catch (RemoteException re) {
        } catch (RemoteException re) {