Make Convert To File Encryption work

Actually call to recovery from ConvertToFBE
Adding credential check
Gray out Convert option when converted

Change-Id: Ic98929ff49733d182b529012e58870156f40679a
This commit is contained in:
Paul Lawrence
2015-11-04 05:09:02 -08:00
parent 85b2d55d36
commit 0e1a46cf6c
6 changed files with 103 additions and 50 deletions

View File

@@ -409,11 +409,18 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
removePreferenceForProduction(hdcpChecking);
}
PreferenceScreen convertFbePreference =
(PreferenceScreen) findPreference(KEY_CONVERT_FBE);
try {
IBinder service = ServiceManager.getService("mount");
IMountService mountService = IMountService.Stub.asInterface(service);
if (!mountService.isConvertibleToFBE()) {
removePreference(KEY_CONVERT_FBE);
} else if (mountService.isPerUserEncryptionEnabled()) {
convertFbePreference.setEnabled(false);
convertFbePreference.setSummary(getResources()
.getString(R.string.convert_to_file_encryption_done));
}
} catch(RemoteException e) {
removePreference(KEY_CONVERT_FBE);