Merge "Honor password visible setting in CryptKeeper" into mnc-dev

This commit is contained in:
Paul Lawrence
2015-05-26 21:52:56 +00:00
committed by Android (Google) Code Review
2 changed files with 25 additions and 0 deletions

View File

@@ -939,4 +939,6 @@ public class StorageManager {
public static final String OWNER_INFO_KEY = "OwnerInfo";
/** @hide */
public static final String PATTERN_VISIBLE_KEY = "PatternVisible";
/** @hide */
public static final String PASSWORD_VISIBLE_KEY = "PasswordVisible";
}

View File

@@ -956,6 +956,29 @@ public class LockPatternUtils {
}
}
/**
* Set whether the visible password is enabled for cryptkeeper screen.
*/
public void setVisiblePasswordEnabled(boolean enabled, int userId) {
// Update for crypto if owner
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(StorageManager.PASSWORD_VISIBLE_KEY, enabled ? "1" : "0");
} catch (RemoteException e) {
Log.e(TAG, "Error changing password visible state", e);
}
}
/**
* @return Whether tactile feedback for the pattern is enabled.
*/