diff options
author | Alex Li <alexylli@google.com> | 2020-06-22 03:59:30 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-06-22 03:59:30 +0000 |
commit | 3f8d40bd954b6369e9ecb195cc94e94aefac48c7 (patch) | |
tree | 04813109f4dd2ae533ce07edbee1fc812a145d94 /src/com/android/settings | |
parent | fbabf8f251356ff8168876058b9b228d39395dca (diff) | |
parent | 40b79387cc3f9124068830185f334c263c79dce9 (diff) | |
download | packages_apps_Settings-3f8d40bd954b6369e9ecb195cc94e94aefac48c7.tar.gz packages_apps_Settings-3f8d40bd954b6369e9ecb195cc94e94aefac48c7.tar.bz2 packages_apps_Settings-3f8d40bd954b6369e9ecb195cc94e94aefac48c7.zip |
Merge "[Settings] Avoids disabled component when page start from setup wizard." into rvc-dev
Diffstat (limited to 'src/com/android/settings')
-rw-r--r-- | src/com/android/settings/SetupRedactionInterstitial.java | 12 | ||||
-rw-r--r-- | src/com/android/settings/notification/RedactionInterstitial.java | 7 |
2 files changed, 18 insertions, 1 deletions
diff --git a/src/com/android/settings/SetupRedactionInterstitial.java b/src/com/android/settings/SetupRedactionInterstitial.java index 90f6c21dab..4747d84cf8 100644 --- a/src/com/android/settings/SetupRedactionInterstitial.java +++ b/src/com/android/settings/SetupRedactionInterstitial.java @@ -20,9 +20,12 @@ import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; +import android.os.Bundle; import com.android.settings.notification.RedactionInterstitial; +import com.google.android.setupcompat.util.WizardManagerHelper; + /** * Setup Wizard's version of RedactionInterstitial screen. It inherits the logic and basic structure * from RedactionInterstitial class, and should remain similar to that behaviorally. This class @@ -47,6 +50,15 @@ public class SetupRedactionInterstitial extends RedactionInterstitial { } @Override + protected void onCreate(Bundle savedInstance) { + // Only allow to start the activity from Setup Wizard. + if (!WizardManagerHelper.isAnySetupWizard(getIntent())) { + finish(); + } + super.onCreate(savedInstance); + } + + @Override public Intent getIntent() { Intent modIntent = new Intent(super.getIntent()); modIntent.putExtra(EXTRA_SHOW_FRAGMENT, diff --git a/src/com/android/settings/notification/RedactionInterstitial.java b/src/com/android/settings/notification/RedactionInterstitial.java index 14f99f38b3..ac648a51e6 100644 --- a/src/com/android/settings/notification/RedactionInterstitial.java +++ b/src/com/android/settings/notification/RedactionInterstitial.java @@ -48,6 +48,7 @@ import com.android.settingslib.RestrictedLockUtilsInternal; import com.google.android.setupcompat.template.FooterBarMixin; import com.google.android.setupcompat.template.FooterButton; +import com.google.android.setupcompat.util.WizardManagerHelper; import com.google.android.setupdesign.GlifLayout; public class RedactionInterstitial extends SettingsActivity { @@ -144,7 +145,11 @@ public class RedactionInterstitial extends SettingsActivity { } private void onDoneButtonClicked(View view) { - SetupRedactionInterstitial.setEnabled(getContext(), false); + // If the activity starts by Setup Wizard, then skip disable component which avoids the + // framework force closing all activities on the same task when the system is busy. + if (!WizardManagerHelper.isAnySetupWizard(getIntent())) { + SetupRedactionInterstitial.setEnabled(getContext(), false); + } final RedactionInterstitial activity = (RedactionInterstitial) getActivity(); if (activity != null) { activity.setResult(RESULT_OK, null); |