Merge "Save PatternVisible setting to crypto header" into lmp-dev

This commit is contained in:
Paul Lawrence
2014-08-21 16:25:55 +00:00
committed by Android (Google) Code Review

View File

@@ -1093,6 +1093,25 @@ public class LockPatternUtils {
*/
public void setVisiblePatternEnabled(boolean 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);
}
}
/**