Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 415510c8 authored by Jack Yu's avatar Jack Yu Committed by Automerger Merge Worker
Browse files

Merge "Reset cell broadcast config before enabling all channels" into...

Merge "Reset cell broadcast config before enabling all channels" into rvc-d1-dev-plus-aosp am: 2e91dd70

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

Change-Id: I699832d723958e658094d424fbe670de189befc2
parents 8380ec25 2e91dd70
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -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;
    }
}
+10 −0
Original line number Diff line number Diff line
@@ -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);
}
+5 −0
Original line number Diff line number Diff line
@@ -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();
    }
}