Merge "Reset cell broadcast config before enabling all channels" into rvc-dev am: 6f000e189b

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11896412

Change-Id: I101d53831bdf6bf4f083e5ff17baad4c014c5eee
This commit is contained in:
TreeHugger Robot
2020-06-19 22:18:42 +00:00
committed by Automerger Merge Worker
3 changed files with 40 additions and 0 deletions

View File

@@ -2978,4 +2978,29 @@ public final class SmsManager {
Log.e(TAG, "setPremiumSmsPermission() RemoteException", e);
}
}
/**
* Reset all cell broadcast ranges. Previously enabled ranges will become invalid after this.
*
* @return {@code true} if succeeded, otherwise {@code false}.
*
* // TODO: Unhide the API in S.
* @hide
*/
public boolean resetAllCellBroadcastRanges() {
boolean success = false;
try {
ISms iSms = getISmsService();
if (iSms != null) {
// If getSubscriptionId() returns INVALID or an inactive subscription, we will use
// the default phone internally.
success = iSms.resetAllCellBroadcastRanges(getSubscriptionId());
}
} catch (RemoteException ex) {
// ignore it
}
return success;
}
}

View File

@@ -563,4 +563,14 @@ interface ISms {
* @return capacity of ICC
*/
int getSmsCapacityOnIccForSubscriber(int subId);
/**
* Reset all cell broadcast ranges. Previously enabled ranges will become invalid after this.
*
* @param subId Subscription index
* @return {@code true} if succeeded, otherwise {@code false}.
*
* @hide
*/
boolean resetAllCellBroadcastRanges(int subId);
}

View File

@@ -212,4 +212,9 @@ public class ISmsImplBase extends ISms.Stub {
public int getSmsCapacityOnIccForSubscriber(int subId) {
throw new UnsupportedOperationException();
}
@Override
public boolean resetAllCellBroadcastRanges(int subId) {
throw new UnsupportedOperationException();
}
}