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
This commit is contained in:
Paul Lawrence
2014-08-20 07:43:32 -07:00
parent ff2da2cdb3
commit 0f11e15f50
2 changed files with 37 additions and 0 deletions

View File

@@ -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());