Make GLIF v2 available to OEMs
Rename GLIF Pixel to GLIF v2 and make available to OEMs. In this
model settings read the EXTRA_THEME from the intent and picks between
GLIF and GLIF v2.
Test: Manual
Bug: 36857917
Change-Id: I4899a3d041abaf0b97843cf14affc8d6f9587a22
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index da88f76..7edb46c 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1560,7 +1560,7 @@
</activity>
<activity android:name=".notification.RedactionInterstitial"
- android:theme="@style/SetupWizardTheme.Light" />
+ android:theme="@style/GlifTheme.Light" />
<activity android:name=".notification.RedactionSettingsStandalone"
android:exported="true">
@@ -1571,11 +1571,11 @@
</activity>
<activity android:name="ConfirmLockPattern"
- android:theme="@style/SetupWizardTheme.Light"/>
+ android:theme="@style/GlifTheme.Light"/>
<activity android:name="ConfirmLockPassword"
android:windowSoftInputMode="stateHidden|adjustResize"
- android:theme="@style/SetupWizardTheme.Light"/>
+ android:theme="@style/GlifTheme.Light"/>
<activity
android:name=".Settings$FingerprintSuggestionActivity"
@@ -1607,7 +1607,7 @@
<activity android:name=".fingerprint.SetupFingerprintEnrollIntroduction"
android:exported="true"
android:permission="android.permission.MANAGE_FINGERPRINT"
- android:theme="@style/SetupWizardTheme.Light">
+ android:theme="@style/GlifTheme.Light">
<intent-filter>
<action android:name="android.settings.FINGERPRINT_SETUP" />
<category android:name="android.intent.category.DEFAULT" />
@@ -1617,17 +1617,17 @@
<!-- Note this must not be exported since it returns the password in the intent -->
<activity android:name="ConfirmLockPattern$InternalActivity"
android:exported="false"
- android:theme="@style/SetupWizardTheme.Light"/>
+ android:theme="@style/GlifTheme.Light"/>
<!-- Note this must not be exported since it returns the password in the intent -->
<activity android:name="ConfirmLockPassword$InternalActivity"
android:exported="false"
android:windowSoftInputMode="adjustResize"
- android:theme="@style/SetupWizardTheme.Light"/>
+ android:theme="@style/GlifTheme.Light"/>
<activity android:name="SetupChooseLockGeneric"
android:taskAffinity="com.android.wizard"
- android:theme="@style/SetupWizardTheme.Light"
+ android:theme="@style/GlifTheme.Light"
android:label="@string/lock_settings_picker_title">
<intent-filter android:priority="1">
<action android:name="com.android.settings.SETUP_LOCK_SCREEN" />
@@ -1690,30 +1690,30 @@
<activity android:name="SetupChooseLockPattern"
android:exported="false"
android:taskAffinity="com.android.wizard"
- android:theme="@style/SetupWizardTheme.Light" />
+ android:theme="@style/GlifTheme.Light" />
<activity android:name="ChooseLockPattern"
android:exported="false"
- android:theme="@style/SetupWizardTheme.Light" />
+ android:theme="@style/GlifTheme.Light" />
<activity android:name="SetupChooseLockPassword"
android:exported="false"
android:taskAffinity="com.android.wizard"
- android:theme="@style/SetupWizardTheme.Light"
+ android:theme="@style/GlifTheme.Light"
android:windowSoftInputMode="stateVisible|adjustResize" />
<activity android:name="ChooseLockPassword"
android:exported="false"
- android:theme="@style/SetupWizardTheme.Light"
+ android:theme="@style/GlifTheme.Light"
android:windowSoftInputMode="stateVisible|adjustResize"/>
<activity android:name=".SetupEncryptionInterstitial"
android:label="@string/encryption_interstitial_header"
android:taskAffinity="com.android.wizard"
- android:theme="@style/SetupWizardTheme.Light"/>
+ android:theme="@style/GlifTheme.Light"/>
<activity android:name=".EncryptionInterstitial"
- android:theme="@style/SetupWizardTheme.Light" />
+ android:theme="@style/GlifTheme.Light" />
<activity android:name=".Settings$StatusActivity"
android:label="@string/device_status_activity_title"
diff --git a/res/values/themes.xml b/res/values/themes.xml
index 7ca109b..5198f76 100644
--- a/res/values/themes.xml
+++ b/res/values/themes.xml
@@ -22,7 +22,7 @@
<attr name="side_margin" format="reference|dimension" />
<attr name="wifi_signal_color" format="reference" />
- <style name="SetupWizardTheme" parent="SuwThemeGlif">
+ <style name="GlifTheme" parent="SuwThemeGlif">
<!-- For all Alert Dialogs -->
<item name="android:alertDialogTheme">@style/ThemeOverlay.AlertDialog</item>
<item name="android:colorPrimary">@color/suw_color_accent_dark</item>
@@ -43,7 +43,7 @@
<item name="*android:lockPatternStyle">@style/LockPatternStyle.Setup</item>
</style>
- <style name="SetupWizardTheme.Light" parent="SuwThemeGlif.Light">
+ <style name="GlifTheme.Light" parent="SuwThemeGlif.Light">
<!-- For all Alert Dialogs -->
<item name="android:alertDialogTheme">@style/ThemeOverlay.AlertDialog</item>
<item name="android:colorPrimary">@color/suw_color_accent_light</item>
@@ -63,14 +63,55 @@
<item name="*android:lockPatternStyle">@style/LockPatternStyle.Setup</item>
</style>
- <style name="SetupWizardTheme.Transparent" parent="SetupWizardTheme">
+ <style name="GlifV2Theme" parent="SuwThemeGlifV2">
+ <!-- For all Alert Dialogs -->
+ <item name="android:alertDialogTheme">@style/ThemeOverlay.AlertDialog</item>
+ <item name="android:colorPrimary">@color/suw_color_accent_dark</item>
+ <item name="android:windowBackground">?android:attr/colorBackground</item>
+ <item name="*android:preferencePanelStyle">@*android:style/PreferencePanel.Dialog</item>
+ <item name="fingerprint_layout_theme">@style/FingerprintLayoutTheme</item>
+ <item name="ic_menu_moreoverflow">@*android:drawable/ic_menu_moreoverflow_material</item>
+ <item name="ic_wps">@drawable/ic_wps_dark</item>
+ <item name="setup_divider_color">@color/setup_divider_color_dark</item>
+ <item name="side_margin">0dip</item>
+ <item name="wifi_signal_color">@color/setup_wizard_wifi_color_dark</item>
+ <item name="wifi_signal">@drawable/wifi_signal</item>
+ <item name="wifi_friction">@drawable/wifi_friction</item>
+ <item name="preferenceBackgroundColor">?android:attr/colorBackground</item>
+ <item name="preferenceTheme">@style/PreferenceTheme.SetupWizard</item>
+
+ <!-- LockPatternView colors -->
+ <item name="*android:lockPatternStyle">@style/LockPatternStyle.Setup</item>
+ </style>
+
+ <style name="GlifV2Theme.Light" parent="SuwThemeGlifV2.Light">
+ <!-- For all Alert Dialogs -->
+ <item name="android:alertDialogTheme">@style/ThemeOverlay.AlertDialog</item>
+ <item name="android:colorPrimary">@color/suw_color_accent_light</item>
+ <item name="android:windowBackground">?android:attr/colorBackground</item>
+ <item name="*android:preferencePanelStyle">@*android:style/PreferencePanel.Dialog</item>
+ <item name="fingerprint_layout_theme">@style/FingerprintLayoutTheme</item>
+ <item name="ic_menu_moreoverflow">@*android:drawable/ic_menu_moreoverflow_material</item>
+ <item name="ic_wps">@drawable/ic_wps_light</item>
+ <item name="setup_divider_color">@color/setup_divider_color_light</item>
+ <item name="side_margin">0dip</item>
+ <item name="wifi_signal_color">@color/setup_wizard_wifi_color_light</item>
+ <item name="wifi_signal">@drawable/wifi_signal</item>
+ <item name="wifi_friction">@drawable/wifi_friction</item>
+ <item name="preferenceBackgroundColor">?android:attr/colorBackground</item>
+ <item name="preferenceTheme">@style/PreferenceTheme.SetupWizard</item>
+
+ <item name="*android:lockPatternStyle">@style/LockPatternStyle.Setup</item>
+ </style>
+
+ <style name="SetupWizardTheme.Transparent" parent="GlifTheme">
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowAnimationStyle">@null</item>
</style>
- <style name="SetupWizardTheme.Light.Transparent" parent="SetupWizardTheme.Light">
+ <style name="SetupWizardTheme.Light.Transparent" parent="GlifTheme.Light">
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
diff --git a/src/com/android/settings/ConfirmDeviceCredentialBaseActivity.java b/src/com/android/settings/ConfirmDeviceCredentialBaseActivity.java
index 489dbbe..d36947f 100644
--- a/src/com/android/settings/ConfirmDeviceCredentialBaseActivity.java
+++ b/src/com/android/settings/ConfirmDeviceCredentialBaseActivity.java
@@ -52,7 +52,7 @@
setTheme(R.style.Theme_ConfirmDeviceCredentialsDark);
mConfirmCredentialTheme = ConfirmCredentialTheme.DARK;
} else {
- setTheme(R.style.SetupWizardTheme_Light);
+ setTheme(R.style.GlifTheme_Light);
mConfirmCredentialTheme = ConfirmCredentialTheme.INTERNAL;
}
super.onCreate(savedState);
diff --git a/src/com/android/settings/SetupWizardUtils.java b/src/com/android/settings/SetupWizardUtils.java
index a0a3719..7edffed 100644
--- a/src/com/android/settings/SetupWizardUtils.java
+++ b/src/com/android/settings/SetupWizardUtils.java
@@ -23,11 +23,20 @@
public class SetupWizardUtils {
public static int getTheme(Intent intent) {
- if (WizardManagerHelper.isLightTheme(intent, true)) {
- return R.style.SetupWizardTheme_Light;
- } else {
- return R.style.SetupWizardTheme;
+ String theme = intent.getStringExtra(WizardManagerHelper.EXTRA_THEME);
+ if (theme != null) {
+ switch (theme) {
+ case WizardManagerHelper.THEME_GLIF_V2_LIGHT:
+ return R.style.GlifV2Theme_Light;
+ case WizardManagerHelper.THEME_GLIF_V2:
+ return R.style.GlifV2Theme;
+ case WizardManagerHelper.THEME_GLIF_LIGHT:
+ return R.style.GlifTheme_Light;
+ case WizardManagerHelper.THEME_GLIF:
+ return R.style.GlifTheme;
+ }
}
+ return R.style.GlifTheme_Light;
}
public static int getTransparentTheme(Intent intent) {