diff options
| author | 2020-06-17 10:35:21 -0700 | |
|---|---|---|
| committer | 2020-06-17 15:47:23 -0700 | |
| commit | 88fb45c1a9a4ba1baa34c9eaf8f35c65c9c8f0de (patch) | |
| tree | 2195607ab62b76a4d0faf865971550291a8fddb2 | |
| parent | 8aafdcc3286d5920f2d1790b4a614e7f5dc02ab2 (diff) | |
Reset cell broadcast config before enabling all channels
Before cell broadcast config service enabling all channels, it
reset all channels that were previously enabled. This will make
sure the full channel config can be pushed down to modem. This
also solved the issue that channel config not sending to modem
when SIM is swapped. Note that a hidden API is added and will
be unhide in the next Android release.
Fix: 155027085
Test: Manual
Merged-In: Id571b990f4e45aea5bbab0dbadce48dda7b2bc56
Change-Id: Id571b990f4e45aea5bbab0dbadce48dda7b2bc56
3 files changed, 40 insertions, 0 deletions
diff --git a/telephony/java/android/telephony/SmsManager.java b/telephony/java/android/telephony/SmsManager.java index 991375c5bc73..b376660f839e 100644 --- a/telephony/java/android/telephony/SmsManager.java +++ b/telephony/java/android/telephony/SmsManager.java @@ -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; + } } diff --git a/telephony/java/com/android/internal/telephony/ISms.aidl b/telephony/java/com/android/internal/telephony/ISms.aidl index 89f811ebf7a1..9ec3c6716a29 100644 --- a/telephony/java/com/android/internal/telephony/ISms.aidl +++ b/telephony/java/com/android/internal/telephony/ISms.aidl @@ -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); } diff --git a/telephony/java/com/android/internal/telephony/ISmsImplBase.java b/telephony/java/com/android/internal/telephony/ISmsImplBase.java index f1182f75cc5e..c361d5bec097 100644 --- a/telephony/java/com/android/internal/telephony/ISmsImplBase.java +++ b/telephony/java/com/android/internal/telephony/ISmsImplBase.java @@ -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(); + } } |