Merge "Honor password visible setting in CryptKeeper" into mnc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
3452d2d0db
@@ -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";
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user