use of com.android.settings.password.ChooseLockSettingsHelper in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class LockUnificationPreferenceController method launchConfirmDeviceAndProfileLock.
/**
* Asks the user to confirm device lock (if there is one) and proceeds to ask profile lock.
*/
private void launchConfirmDeviceAndProfileLock() {
final String title = mContext.getString(R.string.unlock_set_unlock_launch_picker_title);
final ChooseLockSettingsHelper helper = new ChooseLockSettingsHelper(mHost.getActivity(), mHost);
if (!helper.launchConfirmationActivity(UNIFY_LOCK_CONFIRM_DEVICE_REQUEST, title, true, MY_USER_ID)) {
launchConfirmProfileLock();
}
}
use of com.android.settings.password.ChooseLockSettingsHelper in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class BiometricEnrollBase method launchConfirmLock.
protected void launchConfirmLock(int titleResId, long challenge) {
ChooseLockSettingsHelper helper = new ChooseLockSettingsHelper(this);
boolean launchedConfirmationActivity;
if (mUserId == UserHandle.USER_NULL) {
launchedConfirmationActivity = helper.launchConfirmationActivity(CONFIRM_REQUEST, getString(titleResId), null, null, challenge, true);
} else {
launchedConfirmationActivity = helper.launchConfirmationActivity(CONFIRM_REQUEST, getString(titleResId), null, null, challenge, mUserId, true);
}
if (!launchedConfirmationActivity) {
// This shouldn't happen, as we should only end up at this step if a lock thingy is
// already set.
finish();
} else {
mLaunchedConfirmLock = true;
}
}
use of com.android.settings.password.ChooseLockSettingsHelper in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class StorageWizardMigrateConfirm method onNavigateNext.
@Override
public void onNavigateNext(View view) {
// Ensure that all users are unlocked so that we can move their data
if (StorageManager.isFileEncryptedNativeOrEmulated()) {
for (UserInfo user : getSystemService(UserManager.class).getUsers()) {
if (!StorageManager.isUserKeyUnlocked(user.id)) {
Log.d(TAG, "User " + user.id + " is currently locked; requesting unlock");
final CharSequence description = TextUtils.expandTemplate(getText(R.string.storage_wizard_move_unlock), user.name);
new ChooseLockSettingsHelper(this).launchConfirmationActivityForAnyUser(REQUEST_CREDENTIAL, null, null, description, user.id);
return;
}
}
}
// We only expect exceptions from StorageManagerService#setPrimaryStorageUuid
int moveId;
try {
moveId = getPackageManager().movePrimaryStorage(mVolume);
} catch (IllegalArgumentException e) {
StorageManager sm = (StorageManager) getSystemService(STORAGE_SERVICE);
if (Objects.equals(mVolume.getFsUuid(), sm.getPrimaryStorageVolume().getUuid())) {
final Intent intent = new Intent(this, StorageWizardReady.class);
intent.putExtra(DiskInfo.EXTRA_DISK_ID, getIntent().getStringExtra(DiskInfo.EXTRA_DISK_ID));
startActivity(intent);
finishAffinity();
return;
} else {
throw e;
}
} catch (IllegalStateException e) {
Toast.makeText(this, getString(R.string.another_migration_already_in_progress), Toast.LENGTH_LONG).show();
finishAffinity();
return;
}
FeatureFactory.getFactory(this).getMetricsFeatureProvider().action(this, SettingsEnums.ACTION_STORAGE_MIGRATE_NOW);
final Intent intent = new Intent(this, StorageWizardMigrateProgress.class);
intent.putExtra(VolumeInfo.EXTRA_VOLUME_ID, mVolume.getId());
intent.putExtra(PackageManager.EXTRA_MOVE_ID, moveId);
startActivity(intent);
finishAffinity();
}
Aggregations