Set correct theme for MMI-related dialogs
Bug: 17999493
Change-Id: Ifbca5ff1e4203270b0d3b0a7439d5bd2f49de384
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 498b632..1383a62 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -191,7 +191,7 @@
<item name="android:colorPrimaryDark">@color/network_operators_color_primary_dark</item>
</style>
- <style name="Empty" parent="@android:style/Theme.Holo">
+ <style name="Empty" parent="@android:style/Theme.Material.Light">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowContentOverlay">@null</item>
@@ -227,16 +227,6 @@
<item name="*android:taskOpenExitAnimation">@*android:anim/activity_open_exit</item>
</style>
- <!-- Theme for the InCallScreen activity. This gives us a totally black
- window background instead of the default dark grey. (We don't just use
- Theme.Black.NoTitleBar directly, since we want any popups or dialogs
- from the InCallScreen to have the correct holo style. -->
- <style name="Theme.InCallScreen" parent="@android:style/Theme.Holo.NoActionBar">
- <item name="android:windowBackground">@android:color/black</item>
-
- <item name="*android:windowAnimationStyle">@style/InCallAnimationStyle</item>
- </style>
-
<!-- Style for the call settings action bar. Should be kept in sync with Dialer. -->
<style name="DialtactsActionBarStyle" parent="@style/TelephonyActionBarStyle">
<!-- Shift the title text to the right -->
diff --git a/src/com/android/phone/PhoneUtils.java b/src/com/android/phone/PhoneUtils.java
index 56d26c9..b3d64db 100644
--- a/src/com/android/phone/PhoneUtils.java
+++ b/src/com/android/phone/PhoneUtils.java
@@ -117,6 +117,13 @@
/** Noise suppression status as selected by user */
private static boolean sIsNoiseSuppressionEnabled = true;
+ /**
+ * Theme to use for dialogs displayed by utility methods in this class. This is needed
+ * because these dialogs are displayed using the application context, which does not resolve
+ * the dialog theme correctly.
+ */
+ private static final int THEME = AlertDialog.THEME_DEVICE_DEFAULT_LIGHT;
+
private static class FgRingCalls {
private Call fgCall;
private Call ringing;
@@ -955,7 +962,7 @@
// places the message at the forefront of the UI.
if (sUssdDialog == null) {
- sUssdDialog = new AlertDialog.Builder(context)
+ sUssdDialog = new AlertDialog.Builder(context, THEME)
.setPositiveButton(R.string.ok, null)
.setCancelable(true)
.setOnDismissListener(new DialogInterface.OnDismissListener() {
@@ -1045,7 +1052,7 @@
};
// build the dialog
- final AlertDialog newDialog = new AlertDialog.Builder(context)
+ final AlertDialog newDialog = new AlertDialog.Builder(context, THEME)
.setMessage(text)
.setView(dialogView)
.setPositiveButton(R.string.send_button, mUSSDDialogListener)