diff options
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 71d5e96d8..764152590 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()); |
