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

Commit 8f32d7e8 authored by Jack Yu's avatar Jack Yu Committed by Automerger Merge Worker
Browse files

Merge "Throw illegal state exception when service is not available" am:...

Merge "Throw illegal state exception when service is not available" am: 572a3587 am: f431f2ca am: cd314a3a am: d1533240 am: 5112c028

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



Change-Id: Ie4917a9fc0265e0ba705b944bb8290590dd4d43e
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 39e201dd 5112c028
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -3121,8 +3121,9 @@ public class SubscriptionManager {
     * @param callback Callback will be triggered once it succeeds or failed.
     *                 Pass null if don't care about the result.
     *
     * @throws IllegalStateException when subscription manager service is not available.
     * @throws SecurityException when clients do not have MODIFY_PHONE_STATE permission.
     * @hide
     *
     */
    @SystemApi
    @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
@@ -3132,7 +3133,9 @@ public class SubscriptionManager {
        if (VDBG) logd("[setPreferredDataSubscriptionId]+ subId:" + subId);
        try {
            ISub iSub = TelephonyManager.getSubscriptionService();
            if (iSub == null) return;
            if (iSub == null) {
                throw new IllegalStateException("subscription manager service is null.");
            }

            ISetOpportunisticDataCallback callbackStub = new ISetOpportunisticDataCallback.Stub() {
                @Override
@@ -3152,7 +3155,8 @@ public class SubscriptionManager {
            };
            iSub.setPreferredDataSubscriptionId(subId, needValidation, callbackStub);
        } catch (RemoteException ex) {
            // ignore it
            loge("setPreferredDataSubscriptionId RemoteException=" + ex);
            ex.rethrowFromSystemServer();
        }
    }