diff options
author | Paul Lawrence <paullawrence@google.com> | 2014-08-20 07:43:32 -0700 |
---|---|---|
committer | Paul Lawrence <paullawrence@google.com> | 2014-08-21 15:41:42 -0700 |
commit | 0f11e15f503d65d5a085157d8ec406a72d712ce7 (patch) | |
tree | 8a13033d6c1ba9a8a1c5c076103be5f8c0ca6844 /src/com/android/settings/CryptKeeperConfirm.java | |
parent | ff2da2cdb332be35bc94e3e66a10d55fe7bb0105 (diff) | |
download | packages_apps_Settings-0f11e15f503d65d5a085157d8ec406a72d712ce7.tar.gz packages_apps_Settings-0f11e15f503d65d5a085157d8ec406a72d712ce7.tar.bz2 packages_apps_Settings-0f11e15f503d65d5a085157d8ec406a72d712ce7.zip |
Honor hide pattern on crypto screen
Also clear pattern a little more quickly, and show owner info
even from before encrypting (since we're fixing pattern visible,
we should fix owner info too in the same way)
Bug: 17059314
Change-Id: Ie9ccd4a892a1dec32ebe60567d3b72dd6fe25060
Diffstat (limited to 'src/com/android/settings/CryptKeeperConfirm.java')
-rw-r--r-- | src/com/android/settings/CryptKeeperConfirm.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/com/android/settings/CryptKeeperConfirm.java b/src/com/android/settings/CryptKeeperConfirm.java index 71d5e96d8a..764152590c 100644 --- a/src/com/android/settings/CryptKeeperConfirm.java +++ b/src/com/android/settings/CryptKeeperConfirm.java @@ -25,6 +25,7 @@ import android.os.Bundle; import android.os.Handler; import android.os.IBinder; import android.os.ServiceManager; +import android.os.UserHandle; import android.os.storage.IMountService; import android.util.Log; import android.view.LayoutInflater; @@ -32,6 +33,8 @@ import android.view.View; import android.view.ViewGroup; import android.widget.Button; +import com.android.internal.widget.LockPatternUtils; + public class CryptKeeperConfirm extends Fragment { public static class Blank extends Activity { @@ -90,6 +93,27 @@ public class CryptKeeperConfirm extends Fragment { return; } + /* WARNING - nasty hack! + Settings for the lock screen are not available to the crypto + screen (CryptKeeper) at boot. We duplicate the ones that + CryptKeeper needs to the crypto key/value store when they are + modified (see LockPatternUtils). + However, prior to encryption, the crypto key/value store is not + persisted across reboots, thus modified settings are lost to + CryptKeeper. + In order to make sure CryptKeeper had the correct settings after + first encrypting, we thus need to rewrite them, which ensures the + crypto key/value store is up to date. On encryption, this store + is then persisted, and the settings will be there on future + reboots. + */ + LockPatternUtils utils = new LockPatternUtils(getActivity()); + utils.setVisiblePatternEnabled(utils.isVisiblePatternEnabled()); + if (utils.isOwnerInfoEnabled()) { + utils.setOwnerInfo(utils.getOwnerInfo(UserHandle.USER_OWNER), + UserHandle.USER_OWNER); + } + Intent intent = new Intent(getActivity(), Blank.class); intent.putExtras(getArguments()); |