From ad70b91119febe87768312d60cd567f07776d25a Mon Sep 17 00:00:00 2001 From: Jack Yu Date: Thu, 23 Feb 2023 17:44:05 -0800 Subject: [PATCH] Do not crash clients when service is not available To be consistent with many other subscription manager APIs. Fix: 270558438 Test: Basic phone funcationality tests Change-Id: Iae8806084193c6686a1b8ce8376f43b5f5dddce1 --- telephony/java/android/telephony/SubscriptionManager.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java index b418a02aed602..3e2c7c4e51423 100644 --- a/telephony/java/android/telephony/SubscriptionManager.java +++ b/telephony/java/android/telephony/SubscriptionManager.java @@ -4401,7 +4401,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 */ @@ -4418,8 +4417,7 @@ public class SubscriptionManager { if (iSub != null) { return iSub.getSubscriptionUserHandle(subscriptionId); } else { - throw new IllegalStateException("[getSubscriptionUserHandle]: " - + "subscription service unavailable"); + Log.e(LOG_TAG, "[getSubscriptionUserHandle]: subscription service unavailable"); } } catch (RemoteException ex) { ex.rethrowAsRuntimeException();