More work on the Crypt Keeper.
* Use the DPM to determine if we are encrypted. * Fix misspelling (Comfirm -> Confirm). * Animate to black when enabling encryption. * Add holo droid background. * Change the progress bar to indterminate. * Display the percentage complete in the status line. * Fixed bug 3388097. You will no longer have to unplug your device to start encryption. This line is intentionally long. I could make it shorter but I am proving a point: <magic>overflow: auto;</magic>. * Actually hold onto the wakelock to prvent the device from sleeping. * Implement onStop() as a orientation change can happen at boot. This will start the activity twice and there will be multiple handlers with messages. Change-Id: Ia752d106c39e0d81431e856f8f500182e8ec1abd
This commit is contained in:
@@ -29,7 +29,6 @@ import android.content.Intent;
|
||||
import android.database.Cursor;
|
||||
import android.location.LocationManager;
|
||||
import android.os.Bundle;
|
||||
import android.os.SystemProperties;
|
||||
import android.os.Vibrator;
|
||||
import android.preference.CheckBoxPreference;
|
||||
import android.preference.ListPreference;
|
||||
@@ -188,17 +187,20 @@ public class SecuritySettings extends SettingsPreferenceFragment
|
||||
|
||||
|
||||
// Add options for device encryption
|
||||
DevicePolicyManager dpm =
|
||||
(DevicePolicyManager) getSystemService(Context.DEVICE_POLICY_SERVICE);
|
||||
|
||||
String status = SystemProperties.get("ro.crypto.state", "unsupported");
|
||||
if ("encrypted".equalsIgnoreCase(status)) {
|
||||
// The device is currently encrypted
|
||||
switch (dpm.getStorageEncryptionStatus()) {
|
||||
case DevicePolicyManager.ENCRYPTION_STATUS_ACTIVE:
|
||||
// The device is currently encrypted.
|
||||
addPreferencesFromResource(R.xml.security_settings_encrypted);
|
||||
} else if ("unencrypted".equalsIgnoreCase(status)) {
|
||||
// This device support encryption but isn't encrypted
|
||||
break;
|
||||
case DevicePolicyManager.ENCRYPTION_STATUS_INACTIVE:
|
||||
// This device supports encryption but isn't encrypted.
|
||||
addPreferencesFromResource(R.xml.security_settings_unencrypted);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// lock after preference
|
||||
mLockAfter = (ListPreference) root.findPreference(KEY_LOCK_AFTER_TIMEOUT);
|
||||
if (mLockAfter != null) {
|
||||
|
Reference in New Issue
Block a user