Merge "Do not show SMS SIM pick UI for Cell Broadcast Config change" am: 4ae4e50def
am: f15dabde00
Change-Id: I13573f02a8b14fe695222cced5e8fbfa493ed733
This commit is contained in:
@@ -941,8 +941,7 @@ public final class SmsManager {
|
|||||||
* @return associated subscription id
|
* @return associated subscription id
|
||||||
*/
|
*/
|
||||||
public int getSubscriptionId() {
|
public int getSubscriptionId() {
|
||||||
final int subId = (mSubId == DEFAULT_SUBSCRIPTION_ID)
|
final int subId = getSubIdOrDefault();
|
||||||
? getDefaultSmsSubscriptionId() : mSubId;
|
|
||||||
boolean isSmsSimPickActivityNeeded = false;
|
boolean isSmsSimPickActivityNeeded = false;
|
||||||
final Context context = ActivityThread.currentApplication().getApplicationContext();
|
final Context context = ActivityThread.currentApplication().getApplicationContext();
|
||||||
try {
|
try {
|
||||||
@@ -974,6 +973,17 @@ public final class SmsManager {
|
|||||||
return subId;
|
return subId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the subscription ID associated with this {@link SmsManager} or the default set by the
|
||||||
|
* user if this instance was created using {@link SmsManager#getDefault}.
|
||||||
|
*
|
||||||
|
* If there is no default set by the user, this method returns
|
||||||
|
* {@link SubscriptionManager#INVALID_SUBSCRIPTION_ID}.
|
||||||
|
*/
|
||||||
|
private int getSubIdOrDefault() {
|
||||||
|
return (mSubId == DEFAULT_SUBSCRIPTION_ID) ? getDefaultSmsSubscriptionId() : mSubId;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the ISms service, or throws an UnsupportedOperationException if
|
* Returns the ISms service, or throws an UnsupportedOperationException if
|
||||||
* the service does not exist.
|
* the service does not exist.
|
||||||
@@ -1141,8 +1151,9 @@ public final class SmsManager {
|
|||||||
try {
|
try {
|
||||||
ISms iSms = getISmsService();
|
ISms iSms = getISmsService();
|
||||||
if (iSms != null) {
|
if (iSms != null) {
|
||||||
success = iSms.enableCellBroadcastForSubscriber(
|
// If getSubIdOrDefault() returns INVALID, we will use the default phone internally.
|
||||||
getSubscriptionId(), messageIdentifier, ranType);
|
success = iSms.enableCellBroadcastForSubscriber(getSubIdOrDefault(),
|
||||||
|
messageIdentifier, ranType);
|
||||||
}
|
}
|
||||||
} catch (RemoteException ex) {
|
} catch (RemoteException ex) {
|
||||||
// ignore it
|
// ignore it
|
||||||
@@ -1177,8 +1188,9 @@ public final class SmsManager {
|
|||||||
try {
|
try {
|
||||||
ISms iSms = getISmsService();
|
ISms iSms = getISmsService();
|
||||||
if (iSms != null) {
|
if (iSms != null) {
|
||||||
success = iSms.disableCellBroadcastForSubscriber(
|
// If getSubIdOrDefault() returns INVALID, we will use the default phone internally.
|
||||||
getSubscriptionId(), messageIdentifier, ranType);
|
success = iSms.disableCellBroadcastForSubscriber(getSubIdOrDefault(),
|
||||||
|
messageIdentifier, ranType);
|
||||||
}
|
}
|
||||||
} catch (RemoteException ex) {
|
} catch (RemoteException ex) {
|
||||||
// ignore it
|
// ignore it
|
||||||
@@ -1220,7 +1232,8 @@ public final class SmsManager {
|
|||||||
try {
|
try {
|
||||||
ISms iSms = getISmsService();
|
ISms iSms = getISmsService();
|
||||||
if (iSms != null) {
|
if (iSms != null) {
|
||||||
success = iSms.enableCellBroadcastRangeForSubscriber(getSubscriptionId(),
|
// If getSubIdOrDefault() returns INVALID, we will use the default phone internally.
|
||||||
|
success = iSms.enableCellBroadcastRangeForSubscriber(getSubIdOrDefault(),
|
||||||
startMessageId, endMessageId, ranType);
|
startMessageId, endMessageId, ranType);
|
||||||
}
|
}
|
||||||
} catch (RemoteException ex) {
|
} catch (RemoteException ex) {
|
||||||
@@ -1263,7 +1276,8 @@ public final class SmsManager {
|
|||||||
try {
|
try {
|
||||||
ISms iSms = getISmsService();
|
ISms iSms = getISmsService();
|
||||||
if (iSms != null) {
|
if (iSms != null) {
|
||||||
success = iSms.disableCellBroadcastRangeForSubscriber(getSubscriptionId(),
|
// If getSubIdOrDefault() returns INVALID, we will use the default phone internally.
|
||||||
|
success = iSms.disableCellBroadcastRangeForSubscriber(getSubIdOrDefault(),
|
||||||
startMessageId, endMessageId, ranType);
|
startMessageId, endMessageId, ranType);
|
||||||
}
|
}
|
||||||
} catch (RemoteException ex) {
|
} catch (RemoteException ex) {
|
||||||
|
|||||||
Reference in New Issue
Block a user