Font size page support light theme in deferred setup.
Bug:124470158 Test: atest & manually test Change-Id: I41e1e98a9a64e516a294c4a94c8b5f335434078f
This commit is contained in:
@@ -16,7 +16,9 @@
|
||||
|
||||
package com.android.settings.accessibility;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.accessibility.AccessibilityEvent;
|
||||
|
||||
@@ -25,6 +27,7 @@ import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceFragmentCompat;
|
||||
|
||||
import com.android.settings.SettingsActivity;
|
||||
import com.android.settings.SetupWizardUtils;
|
||||
import com.android.settings.core.SubSettingLauncher;
|
||||
import com.android.settings.display.FontSizePreferenceFragmentForSetupWizard;
|
||||
import com.android.settings.search.actionbar.SearchMenuController;
|
||||
@@ -35,10 +38,12 @@ import com.google.android.setupcompat.util.WizardManagerHelper;
|
||||
|
||||
public class AccessibilitySettingsForSetupWizardActivity extends SettingsActivity {
|
||||
|
||||
private static final String LOG_TAG = "A11ySettingsForSUW";
|
||||
private static final String SAVE_KEY_TITLE = "activity_title";
|
||||
|
||||
@VisibleForTesting
|
||||
static final String EXTRA_GO_TO_FONT_SIZE_PREFERENCE = "go_to_font_size_preference";
|
||||
static final String CLASS_NAME_FONT_SIZE_SETTINGS_FOR_SUW =
|
||||
"com.android.settings.FontSizeSettingsForSetupWizardActivity";
|
||||
|
||||
@Override
|
||||
protected void onSaveInstanceState(Bundle savedState) {
|
||||
@@ -91,21 +96,27 @@ public class AccessibilitySettingsForSetupWizardActivity extends SettingsActivit
|
||||
protected void onCreate(Bundle savedState) {
|
||||
super.onCreate(savedState);
|
||||
|
||||
tryLaunchFontSizePreference();
|
||||
tryLaunchFontSizeSettings();
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
void tryLaunchFontSizePreference() {
|
||||
if (WizardManagerHelper.isAnySetupWizard(getIntent()) && getIntent().getBooleanExtra(
|
||||
EXTRA_GO_TO_FONT_SIZE_PREFERENCE, false)) {
|
||||
Bundle args = new Bundle();
|
||||
void tryLaunchFontSizeSettings() {
|
||||
if (WizardManagerHelper.isAnySetupWizard(getIntent())
|
||||
&& new ComponentName(getPackageName(),
|
||||
CLASS_NAME_FONT_SIZE_SETTINGS_FOR_SUW).equals(
|
||||
getIntent().getComponent())) {
|
||||
final Bundle args = new Bundle();
|
||||
args.putInt(HelpResourceProvider.HELP_URI_RESOURCE_KEY, 0);
|
||||
args.putBoolean(SearchMenuController.NEED_SEARCH_ICON_IN_ACTION_BAR, false);
|
||||
new SubSettingLauncher(this)
|
||||
final SubSettingLauncher subSettingLauncher = new SubSettingLauncher(this)
|
||||
.setDestination(FontSizePreferenceFragmentForSetupWizard.class.getName())
|
||||
.setArguments(args)
|
||||
.setSourceMetricsCategory(Instrumentable.METRICS_CATEGORY_UNKNOWN)
|
||||
.launch();
|
||||
.setExtras(SetupWizardUtils.copyLifecycleExtra(getIntent().getExtras(),
|
||||
new Bundle()));
|
||||
|
||||
Log.d(LOG_TAG, "Launch font size settings");
|
||||
subSettingLauncher.launch();
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user