Merge "Fix Settings app crashes when clicked on the magnification" into sc-v2-dev am: 6de9b2486f am: 6001f86910

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

Change-Id: I841ede3f2254ffe42881ffb28880ae293dee42f9
This commit is contained in:
Menghan Li
2021-10-14 07:42:58 +00:00
committed by Automerger Merge Worker
6 changed files with 9 additions and 18 deletions

View File

@@ -36,6 +36,7 @@ import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.fragment.app.FragmentActivity;
import com.android.settings.R;
import com.android.settings.SetupWizardUtils;
import com.android.settings.SubSettings;
import com.android.settings.core.CategoryMixin.CategoryHandler;
import com.android.settingslib.core.lifecycle.HideNonSystemOverlayMixin;
@@ -91,17 +92,14 @@ public class SettingsBaseActivity extends FragmentActivity implements CategoryHa
// Apply SetupWizard light theme during setup flow. This is for SubSettings pages.
final boolean isAnySetupWizard = WizardManagerHelper.isAnySetupWizard(getIntent());
if (isAnySetupWizard && this instanceof SubSettings) {
int appliedTheme;
if (ThemeHelper.trySetDynamicColor(this)) {
appliedTheme = ThemeHelper.isSetupWizardDayNightEnabled(this)
final int appliedTheme = ThemeHelper.isSetupWizardDayNightEnabled(this)
? R.style.SudDynamicColorThemeSettings_SetupWizard_DayNight
: R.style.SudDynamicColorThemeSettings_SetupWizard;
setTheme(appliedTheme);
} else {
appliedTheme = ThemeHelper.isSetupWizardDayNightEnabled(this)
? R.style.SubSettings_SetupWizard
: R.style.SudThemeGlifV3_Light;
setTheme(SetupWizardUtils.getTheme(this, getIntent()));
}
setTheme(appliedTheme);
}
if (isToolbarEnabled() && !isAnySetupWizard) {