summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/SecuritySettings.java
diff options
context:
space:
mode:
authorJason parks <jparks@google.com>2011-01-25 09:26:55 -0600
committerJason parks <jparks@google.com>2011-01-25 10:29:50 -0600
commit4112199ed654f8bd1cea2c9a29a24be3c148b2ed (patch)
tree219b672dd6e48bd2d62a4e26b3f71e43d3e8b236 /src/com/android/settings/SecuritySettings.java
parentf1dbf55819e01f6cf1a99d38a292b15de1262a29 (diff)
downloadpackages_apps_settings-4112199ed654f8bd1cea2c9a29a24be3c148b2ed.zip
packages_apps_settings-4112199ed654f8bd1cea2c9a29a24be3c148b2ed.tar.gz
packages_apps_settings-4112199ed654f8bd1cea2c9a29a24be3c148b2ed.tar.bz2
Display the correct encryption settings.
* You can no longer try to encrypt the device when it is encrypted. * Moved the encryption section below the lock screen section. It will be more common to change the lock screen settings. * If the device doesn't support encryption don't display the encryption section. Bug: 3384074 Change-Id: I172f5894a3cea57b1b8d03a84f1ecf0ee500c1f3
Diffstat (limited to 'src/com/android/settings/SecuritySettings.java')
-rw-r--r--src/com/android/settings/SecuritySettings.java21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java
index aaaf265..e413915 100644
--- a/src/com/android/settings/SecuritySettings.java
+++ b/src/com/android/settings/SecuritySettings.java
@@ -29,6 +29,7 @@ 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;
@@ -50,7 +51,6 @@ import java.util.Observer;
*/
public class SecuritySettings extends SettingsPreferenceFragment
implements OnPreferenceChangeListener {
- private static final String KEY_ENCRYPTION = "encryption";
// Lock Settings
private static final String KEY_UNLOCK_SET_OR_CHANGE = "unlock_set_or_change";
@@ -161,12 +161,6 @@ public class SecuritySettings extends SettingsPreferenceFragment
mUseLocation = useLocation;
}
- // Add options for device encryption
- // TODO: It still needs to be determined how a device specifies that it supports
- // encryption. That mechanism needs to be checked before adding the following code
-
- addPreferencesFromResource(R.xml.security_settings_encryption);
-
// Add options for lock/unlock screen
int resid = 0;
if (!mLockPatternUtils.isSecure()) {
@@ -192,6 +186,19 @@ public class SecuritySettings extends SettingsPreferenceFragment
}
addPreferencesFromResource(resid);
+
+ // Add options for device encryption
+
+ String status = SystemProperties.get("ro.crypto.state", "unsupported");
+ if ("encrypted".equalsIgnoreCase(status)) {
+ // The device is currently encrypted
+ addPreferencesFromResource(R.xml.security_settings_encrypted);
+ } else if ("unencrypted".equalsIgnoreCase(status)) {
+ // This device support encryption but isn't encrypted
+ addPreferencesFromResource(R.xml.security_settings_unencrypted);
+ }
+
+
// lock after preference
mLockAfter = (ListPreference) root.findPreference(KEY_LOCK_AFTER_TIMEOUT);
if (mLockAfter != null) {