Set/read VM vibration and ringtone from default phone if SIM is absent

Dialer voicemail settings use TelecomManager.
getDefaultOutgoingPhoneAccount() to get the phone account handle in
single SIM scenarios. If the SIM is absent, the returned handle will
be invalid(does not correspond to a phone object). Before this CL,
telephony will throw an exception while trying to modify voicemail
settings with an invalid phone account handle.

After this CL, the settings will be applied to the default phone
instead, which correspond to INVALID_SUBSCRIPTION_ID and is
consistent with previous behavior (same phone object when the
telephony voicemail settings is created without a SIM).

Bug: 37161918
Change-Id: I6336ce076d0f38db14c838cb2ac78f5494e28a3e
Fixes: 37161918
Test: manual - toggle voicemail vibration settings without a SIM.
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 3638877..a3b6195 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -3429,9 +3429,9 @@
      */
     @Override
     public Uri getVoicemailRingtoneUri(PhoneAccountHandle accountHandle) {
-        final Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(accountHandle);
+        Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(accountHandle);
         if (phone == null) {
-            return null;
+            phone = mPhone;
         }
 
         return VoicemailNotificationSettingsUtil.getRingtoneUri(phone);
@@ -3459,8 +3459,7 @@
         }
         Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(phoneAccountHandle);
         if (phone == null){
-            throw new IllegalArgumentException("The phoneAccountHandle does not correspond to an "
-                    + "active phone account.");
+           phone = mPhone;
         }
         VoicemailNotificationSettingsUtil.setRingtoneUri(phone, uri);
     }
@@ -3474,9 +3473,9 @@
      */
     @Override
     public boolean isVoicemailVibrationEnabled(PhoneAccountHandle accountHandle) {
-        final Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(accountHandle);
+        Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(accountHandle);
         if (phone == null) {
-            return false;
+            phone = mPhone;
         }
 
         return VoicemailNotificationSettingsUtil.isVibrationEnabled(phone);
@@ -3505,8 +3504,7 @@
 
         Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(phoneAccountHandle);
         if (phone == null){
-            throw new IllegalArgumentException("The phoneAccountHandle does not correspond to an "
-                    + "active phone account.");
+            phone = mPhone;
         }
         VoicemailNotificationSettingsUtil.setVibrationEnabled(phone, enabled);
     }