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

Commit 3bbdae4d authored by Jack Yu's avatar Jack Yu
Browse files

Do not crash SubscriptionManager clients

To be consistent with many other subscription manager APIs, do
not crash the clients when service is not available.

Fix: 269726553
Test: atest SubscriptionManagerTest
Change-Id: I363058d0320ac09e237f712ef759fe5b2c3b2962
parent 24e694b2
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -4439,7 +4439,6 @@ public class SubscriptionManager {
     *
     * @throws IllegalArgumentException if subscription is invalid.
     * @throws SecurityException if the caller doesn't have permissions required.
     * @throws IllegalStateException if subscription service is not available.
     *
     * @hide
     */
@@ -4456,8 +4455,8 @@ public class SubscriptionManager {
            if (iSub != null) {
                return iSub.isSubscriptionAssociatedWithUser(subscriptionId, userHandle);
            } else {
                throw new IllegalStateException("[isSubscriptionAssociatedWithUser]: "
                        + "subscription service unavailable");
                Log.e(LOG_TAG, "[isSubscriptionAssociatedWithUser]: subscription service "
                        + "unavailable");
            }
        } catch (RemoteException ex) {
            ex.rethrowAsRuntimeException();
@@ -4484,7 +4483,7 @@ public class SubscriptionManager {
            if (iSub != null) {
                return iSub.getSubscriptionInfoListAssociatedWithUser(userHandle);
            } else {
                throw new IllegalStateException("[getSubscriptionInfoListAssociatedWithUser]: "
                Log.e(LOG_TAG, "[getSubscriptionInfoListAssociatedWithUser]: "
                        + "subscription service unavailable");
            }
        } catch (RemoteException ex) {