OSDN Git Service

Set the theme in BiometricEnrollIntroduction
authorMaurice Lam <yukl@google.com>
Thu, 11 Apr 2019 03:26:30 +0000 (20:26 -0700)
committerMaurice Lam <yukl@google.com>
Thu, 11 Apr 2019 18:08:24 +0000 (18:08 +0000)
So the theme used will be consistent throughout the flow.

Test: Manual
Bug: 130277993
Change-Id: I496767dca858f7b69cfa061c026733567b5e7361

src/com/android/settings/SetupWizardUtils.java
src/com/android/settings/biometrics/BiometricEnrollIntroduction.java

index 7a2fe80..077d94c 100644 (file)
@@ -25,11 +25,16 @@ import com.google.android.setupdesign.util.ThemeHelper;
 
 public class SetupWizardUtils {
 
-    public static int getTheme(Intent intent) {
+    public static String getThemeString(Intent intent) {
         String theme = intent.getStringExtra(WizardManagerHelper.EXTRA_THEME);
         if (theme == null) {
             theme = SetupWizardProperties.theme().orElse("");
         }
+        return theme;
+    }
+
+    public static int getTheme(Intent intent) {
+        String theme = getThemeString(intent);
         // TODO(yukl): Move to ThemeResolver and add any additional required attributes in
         // onApplyThemeResource using Theme overlays
         if (theme != null) {
index 81b70b5..a8e4206 100644 (file)
@@ -27,6 +27,7 @@ import android.widget.TextView;
 
 import com.android.internal.widget.LockPatternUtils;
 import com.android.settings.R;
+import com.android.settings.SetupWizardUtils;
 import com.android.settings.password.ChooseLockGeneric;
 import com.android.settings.password.ChooseLockGeneric.ChooseLockGenericFragment;
 import com.android.settings.password.ChooseLockSettingsHelper;
@@ -123,6 +124,15 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
+
+        Intent intent = getIntent();
+        if (intent.getStringExtra(WizardManagerHelper.EXTRA_THEME) == null) {
+            // Put the theme in the intent so it gets propagated to other activities in the flow
+            intent.putExtra(
+                    WizardManagerHelper.EXTRA_THEME,
+                    SetupWizardUtils.getThemeString(intent));
+        }
+
         mBiometricUnlockDisabledByAdmin = isDisabledByAdmin();
 
         setContentView(getLayoutResource());