Merge "Ensure sim color is shown on multi-sim devices when only one sim installed."
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index e8def4b..039cc31 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -277,6 +277,7 @@
android:theme="@style/Theme.CircularRevealAnimation"
android:exported="false"
android:configChanges="keyboardHidden|orientation"
+ android:launchMode="singleInstance"
android:noHistory="true"
android:excludeFromRecents="true"
android:screenOrientation="nosensor" />
diff --git a/res/values-fr-rCA/strings.xml b/res/values-fr-rCA/strings.xml
index f858e1d..b59d9dc 100644
--- a/res/values-fr-rCA/strings.xml
+++ b/res/values-fr-rCA/strings.xml
@@ -119,7 +119,7 @@
<string name="dialog_voicemail_not_ready_message" msgid="4384716252789515378">"Pour configurer la messagerie vocale, accédez à Menu > Paramètres."</string>
<string name="dialog_voicemail_airplane_mode_message" msgid="530922773669546093">"Veuillez désactiver le mode Avion avant d\'appeler la messagerie vocale."</string>
<string name="contact_list_loading" msgid="5488620820563977329">"Chargement en cours..."</string>
- <string name="imei" msgid="3045126336951684285">"Code IMEI"</string>
+ <string name="imei" msgid="3045126336951684285">"Code IIEM"</string>
<string name="meid" msgid="6210568493746275750">"MEID"</string>
<string name="simContacts_emptyLoading" msgid="6700035985448642408">"Chargement depuis la carte SIM..."</string>
<string name="simContacts_title" msgid="27341688347689769">"Contacts de carte SIM"</string>
diff --git a/src/com/android/dialer/dialpad/DialpadFragment.java b/src/com/android/dialer/dialpad/DialpadFragment.java
index ce6475e..f1112f1 100644
--- a/src/com/android/dialer/dialpad/DialpadFragment.java
+++ b/src/com/android/dialer/dialpad/DialpadFragment.java
@@ -924,9 +924,10 @@
PhoneAccountUtils.getSubscriptionPhoneAccounts(getActivity());
boolean hasUserSelectedDefault = subscriptionAccountHandles.contains(
getTelecomManager().getUserSelectedOutgoingPhoneAccount());
- boolean multiSim = subscriptionAccountHandles.size() > 1;
+ boolean needsAccountDisambiguation = subscriptionAccountHandles.size() > 1
+ && !hasUserSelectedDefault;
- if ((multiSim && !hasUserSelectedDefault) || isVoicemailAvailable()) {
+ if (needsAccountDisambiguation || isVoicemailAvailable()) {
// On a multi-SIM phone, if the user has not selected a default
// subscription, initiate a call to voicemail so they can select an account
// from the "Call with" dialog.
@@ -1519,13 +1520,21 @@
/**
* Check if voicemail is enabled/accessible.
*
- * @return true if voicemail is enabled and accessibly. Note that this can be false
+ * @return true if voicemail is enabled and accessible. Note that this can be false
* "temporarily" after the app boot.
- * @see TelephonyManager#getVoiceMailNumber()
+ * @see TelecomManager#hasVoiceMailNumber(PhoneAccountHandle)
*/
private boolean isVoicemailAvailable() {
try {
- return getTelephonyManager().getVoiceMailNumber() != null;
+ PhoneAccountHandle defaultUserSelectedAccount =
+ getTelecomManager().getUserSelectedOutgoingPhoneAccount();
+ if (defaultUserSelectedAccount == null) {
+ // In a single-SIM phone, there is no default outgoing phone account selected by
+ // the user, so just call TelephonyManager#getVoicemailNumber directly.
+ return getTelephonyManager().getVoiceMailNumber() != null;
+ } else {
+ return getTelecomManager().hasVoiceMailNumber(defaultUserSelectedAccount);
+ }
} catch (SecurityException se) {
// Possibly no READ_PHONE_STATE privilege.
Log.w(TAG, "SecurityException is thrown. Maybe privilege isn't sufficient.");