Merge "Changes SetupRedactionInterstitial to be an optional step" into nyc-dev am: 7e7f82a

am: 77a9f6f

* commit '77a9f6f2bd8e72d1c161a4eab4c43c8c1854e7f2':
  Changes SetupRedactionInterstitial to be an optional step
This commit is contained in:
Udam Saini
2016-03-28 22:41:28 +00:00
committed by android-build-merger
7 changed files with 58 additions and 24 deletions

View File

@@ -18,8 +18,10 @@ package com.android.settings;
import android.app.Activity;
import android.app.admin.DevicePolicyManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.os.Bundle;
import android.os.UserHandle;
@@ -118,6 +120,12 @@ public class SetupChooseLockGeneric extends ChooseLockGeneric {
data.putExtra(EXTRA_PASSWORD_QUALITY,
lockPatternUtils.getKeyguardStoredPasswordQuality(UserHandle.myUserId()));
PackageManager packageManager = getPackageManager();
ComponentName componentName = new ComponentName("com.android.settings",
"com.android.settings.SetupRedactionInterstitial");
packageManager.setComponentEnabledSetting(componentName,
PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
PackageManager.DONT_KILL_APP);
super.onActivityResult(requestCode, resultCode, data);
}
// If the started activity was cancelled (e.g. the user presses back), then this

View File

@@ -109,11 +109,7 @@ public class SetupChooseLockPassword extends ChooseLockPassword {
@Override
protected Intent getRedactionInterstitialIntent(Context context) {
Intent intent = SetupRedactionInterstitial.createStartIntent(context);
if (intent != null) {
SetupWizardUtils.copySetupExtras(getActivity().getIntent(), intent);
}
return intent;
return null;
}
@Override

View File

@@ -105,11 +105,7 @@ public class SetupChooseLockPattern extends ChooseLockPattern {
@Override
protected Intent getRedactionInterstitialIntent(Context context) {
Intent intent = SetupRedactionInterstitial.createStartIntent(context);
if (intent != null) {
SetupWizardUtils.copySetupExtras(getActivity().getIntent(), intent);
}
return intent;
return null;
}
@Override

View File

@@ -39,27 +39,17 @@ import com.android.setupwizardlib.view.NavigationBar;
*/
public class SetupRedactionInterstitial extends RedactionInterstitial {
public static Intent createStartIntent(Context ctx) {
Intent startIntent = RedactionInterstitial.createStartIntent(ctx, UserHandle.myUserId());
if (startIntent != null) {
startIntent.setClass(ctx, SetupRedactionInterstitial.class);
startIntent.putExtra(EXTRA_PREFS_SHOW_BUTTON_BAR, false)
.putExtra(EXTRA_SHOW_FRAGMENT_TITLE_RESID, -1);
}
return startIntent;
}
@Override
public Intent getIntent() {
Intent modIntent = new Intent(super.getIntent());
modIntent.putExtra(EXTRA_SHOW_FRAGMENT,
SetupEncryptionInterstitialFragment.class.getName());
SetupRedactionInterstitialFragment.class.getName());
return modIntent;
}
@Override
protected boolean isValidFragment(String fragmentName) {
return SetupEncryptionInterstitialFragment.class.getName().equals(fragmentName);
return SetupRedactionInterstitialFragment.class.getName().equals(fragmentName);
}
@Override
@@ -68,7 +58,7 @@ public class SetupRedactionInterstitial extends RedactionInterstitial {
super.onApplyThemeResource(theme, resid, first);
}
public static class SetupEncryptionInterstitialFragment extends RedactionInterstitialFragment
public static class SetupRedactionInterstitialFragment extends RedactionInterstitialFragment
implements NavigationBar.NavigationBarListener {
@Override