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

Commit fd1e089b authored by Eric Biggers's avatar Eric Biggers Committed by Automerger Merge Worker
Browse files

Merge "Unlock non-secure users automatically (2/2)" into main am: fcaf0ace...

Merge "Unlock non-secure users automatically (2/2)" into main am: fcaf0ace am: 3eb12fab am: 81afb5c0

Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2661955



Change-Id: I8ba1eac7a6194410bf574ee3a7a7157471939ae2
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents fde83734 81afb5c0
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import android.util.Log;
import android.view.View;
import android.widget.Toast;

import com.android.internal.widget.LockPatternUtils;
import com.android.settings.R;
import com.android.settings.overlay.FeatureFactory;
import com.android.settings.password.ChooseLockSettingsHelper;
@@ -97,10 +98,19 @@ public class StorageWizardMigrateConfirm extends StorageWizardBase {
    @Override
    public void onNavigateNext(View view) {
        // Ensure that all users are unlocked so that we can move their data
        final LockPatternUtils lpu = new LockPatternUtils(this);
        if (StorageManager.isFileEncrypted()) {
            for (UserInfo user : getSystemService(UserManager.class).getUsers()) {
                if (!StorageManager.isUserKeyUnlocked(user.id)) {
                    Log.d(TAG, "User " + user.id + " is currently locked; requesting unlock");
                if (StorageManager.isUserKeyUnlocked(user.id)) {
                    continue;
                }
                if (!lpu.isSecure(user.id)) {
                    Log.d(TAG, "Unsecured user " + user.id + " is currently locked; attempting "
                            + "automatic unlock");
                    lpu.unlockUserKeyIfUnsecured(user.id);
                } else {
                    Log.d(TAG, "Secured user " + user.id + " is currently locked; requesting "
                            + "manual unlock");
                    final CharSequence description = TextUtils.expandTemplate(
                            getText(R.string.storage_wizard_move_unlock), user.name);
                    final ChooseLockSettingsHelper.Builder builder =
+12 −2
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import android.util.Log;
import android.view.View;

import com.android.internal.util.Preconditions;
import com.android.internal.widget.LockPatternUtils;
import com.android.settings.R;
import com.android.settings.password.ChooseLockSettingsHelper;

@@ -79,10 +80,19 @@ public class StorageWizardMoveConfirm extends StorageWizardBase {
    @Override
    public void onNavigateNext(View view) {
        // Ensure that all users are unlocked so that we can move their data
        final LockPatternUtils lpu = new LockPatternUtils(this);
        if (StorageManager.isFileEncrypted()) {
            for (UserInfo user : getSystemService(UserManager.class).getUsers()) {
                if (!StorageManager.isUserKeyUnlocked(user.id)) {
                    Log.d(TAG, "User " + user.id + " is currently locked; requesting unlock");
                if (StorageManager.isUserKeyUnlocked(user.id)) {
                    continue;
                }
                if (!lpu.isSecure(user.id)) {
                    Log.d(TAG, "Unsecured user " + user.id + " is currently locked; attempting "
                            + "automatic unlock");
                    lpu.unlockUserKeyIfUnsecured(user.id);
                } else {
                    Log.d(TAG, "Secured user " + user.id + " is currently locked; requesting "
                            + "manual unlock");
                    final CharSequence description = TextUtils.expandTemplate(
                            getText(R.string.storage_wizard_move_unlock), user.name);
                    final ChooseLockSettingsHelper.Builder builder =