Merge changes I44dc66f9,I72ee7af9
am: cb7c0be8fb
Change-Id: I6d92a16455441f38a2f63c553ce28c9ebdbf0b15
This commit is contained in:
@@ -1958,16 +1958,24 @@ public final class SmsManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get default sms subscription id
|
* Get default sms subscription id.
|
||||||
*
|
*
|
||||||
* @return the user-defined default SMS subscription id or
|
* <p class="note"><strong>Note:</strong>This returns a value different from
|
||||||
* {@link SubscriptionManager#INVALID_SUBSCRIPTION_ID} if no default is set.
|
* {@link SubscriptionManager#getDefaultSmsSubscriptionId} if the user has not chosen a default.
|
||||||
|
* In this case it returns the active subscription id if there's only one active subscription
|
||||||
|
* available.
|
||||||
|
*
|
||||||
|
* @return the user-defined default SMS subscription id, or the active subscription id if
|
||||||
|
* there's only one active subscription available, otherwise
|
||||||
|
* {@link SubscriptionManager#INVALID_SUBSCRIPTION_ID}.
|
||||||
*/
|
*/
|
||||||
public static int getDefaultSmsSubscriptionId() {
|
public static int getDefaultSmsSubscriptionId() {
|
||||||
try {
|
try {
|
||||||
return SubscriptionManager.getDefaultSmsSubscriptionId();
|
return getISmsService().getPreferredSmsSubscription();
|
||||||
} catch (NullPointerException ex) {
|
} catch (RemoteException e) {
|
||||||
return -1;
|
return SubscriptionManager.INVALID_SUBSCRIPTION_ID;
|
||||||
|
} catch (NullPointerException e) {
|
||||||
|
return SubscriptionManager.INVALID_SUBSCRIPTION_ID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user