Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 23c2acfd authored by Paul Lawrence's avatar Paul Lawrence
Browse files

Don't show secure startup options and strings when file encrypted

File encryption is secure by default, so we don't need to warn.

Bug: 27433949
Bug: 27435082

Change-Id: I3e856256188e6a7dcd58cabbde043395c314999e
parent dccc582d
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ import android.os.Bundle;
import android.os.Process;
import android.os.UserHandle;
import android.os.UserManager;
import android.os.storage.StorageManager;
import android.security.KeyStore;
import android.support.v7.preference.Preference;
import android.support.v7.preference.PreferenceScreen;
@@ -481,7 +482,13 @@ public class ChooseLockGeneric extends SettingsActivity {
        }

        private void updatePreferenceSummaryIfNeeded() {
            if (LockPatternUtils.isDeviceEncrypted()) {
            // On a default block encrypted device with accessibility, add a warning
            // that your data is not credential encrypted
            if (!StorageManager.isBlockEncrypted()) {
                return;
            }

            if (StorageManager.isNonDefaultBlockEncrypted()) {
                return;
            }

+2 −1
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ import android.os.Bundle;
import android.os.PersistableBundle;
import android.os.UserHandle;
import android.os.UserManager;
import android.os.storage.StorageManager;
import android.provider.SearchIndexableResource;
import android.provider.Settings;
import android.security.KeyStore;
@@ -1054,7 +1055,7 @@ public class SecuritySettings extends SettingsPreferenceFragment
            DevicePolicyManager dpm = context.getSystemService(DevicePolicyManager.class);
            return UserManager.get(context).isAdminUser()
                    && UserManager.get(context).isPrimaryUser()
                    && LockPatternUtils.isDeviceEncryptionEnabled()
                    && StorageManager.isBlockEncrypted()
                    && !dpm.getDoNotAskCredentialsOnBoot();
        }