From abc6c12659dfd2825f1a8216d688d6c1f7251f7e Mon Sep 17 00:00:00 2001 From: Jack Yu Date: Mon, 3 Oct 2022 09:16:47 -0700 Subject: [PATCH 1/2] Removed unused methods Bug: 239607619 Test: Manual Merged-In: Ic751024b8ba3d52ca6af86e3688592a7a5204785 Change-Id: Ic751024b8ba3d52ca6af86e3688592a7a5204785 --- .../telephony/SubscriptionManager.java | 27 ------------------- 1 file changed, 27 deletions(-) diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java index 50bb407ec574..76200e742bf9 100644 --- a/telephony/java/android/telephony/SubscriptionManager.java +++ b/telephony/java/android/telephony/SubscriptionManager.java @@ -2311,18 +2311,6 @@ public class SubscriptionManager { } } - /** - * Return the SubscriptionInfo for default voice subscription. - * - * Will return null on data only devices, or on error. - * - * @return the SubscriptionInfo for the default SMS subscription. - * @hide - */ - public SubscriptionInfo getDefaultSmsSubscriptionInfo() { - return getActiveSubscriptionInfo(getDefaultSmsSubscriptionId()); - } - /** @hide */ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) public int getDefaultSmsPhoneId() { @@ -2396,21 +2384,6 @@ public class SubscriptionManager { return; } - //FIXME this is vulnerable to race conditions - /** @hide */ - public boolean allDefaultsSelected() { - if (!isValidSubscriptionId(getDefaultDataSubscriptionId())) { - return false; - } - if (!isValidSubscriptionId(getDefaultSmsSubscriptionId())) { - return false; - } - if (!isValidSubscriptionId(getDefaultVoiceSubscriptionId())) { - return false; - } - return true; - } - /** * Check if the supplied subscription ID is valid. * From 6fef2393eb9ce539991ef26e23a19b658006fbee Mon Sep 17 00:00:00 2001 From: Jack Yu Date: Mon, 3 Oct 2022 13:29:18 -0700 Subject: [PATCH 2/2] Removed unused methods Removed getAllSubscriptionInfoCount(), getDefaultSmsPhoneId(), and getDefaultDataPhoneId(). Bug: 239607619 Test: Manual Merged-In: I1e4110e4bb7dbbc05d51f75d67f451a8ce3bf229 Change-Id: I1e4110e4bb7dbbc05d51f75d67f451a8ce3bf229 --- .../telephony/SubscriptionManager.java | 36 ------------------- .../com/android/internal/telephony/ISub.aidl | 8 ----- 2 files changed, 44 deletions(-) diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java index 76200e742bf9..9fa64feb3041 100644 --- a/telephony/java/android/telephony/SubscriptionManager.java +++ b/telephony/java/android/telephony/SubscriptionManager.java @@ -1889,30 +1889,6 @@ public class SubscriptionManager { } } - /** - * @return the count of all subscriptions in the database, this includes - * all subscriptions that have been seen. - * @hide - */ - @UnsupportedAppUsage - public int getAllSubscriptionInfoCount() { - if (VDBG) logd("[getAllSubscriptionInfoCount]+"); - - int result = 0; - - try { - ISub iSub = TelephonyManager.getSubscriptionService(); - if (iSub != null) { - result = iSub.getAllSubInfoCount(mContext.getOpPackageName(), - mContext.getAttributionTag()); - } - } catch (RemoteException ex) { - // ignore it - } - - return result; - } - /** * * Requires Permission: {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} @@ -2311,12 +2287,6 @@ public class SubscriptionManager { } } - /** @hide */ - @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) - public int getDefaultSmsPhoneId() { - return getPhoneId(getDefaultSmsSubscriptionId()); - } - /** * Returns the system's default data subscription id. * @@ -2364,12 +2334,6 @@ public class SubscriptionManager { return getActiveSubscriptionInfo(getDefaultDataSubscriptionId()); } - /** @hide */ - @UnsupportedAppUsage - public int getDefaultDataPhoneId() { - return getPhoneId(getDefaultDataSubscriptionId()); - } - /** @hide */ public void clearSubscriptionInfo() { try { diff --git a/telephony/java/com/android/internal/telephony/ISub.aidl b/telephony/java/com/android/internal/telephony/ISub.aidl index 1e38b9215d76..917f35bc1b82 100755 --- a/telephony/java/com/android/internal/telephony/ISub.aidl +++ b/telephony/java/com/android/internal/telephony/ISub.aidl @@ -29,14 +29,6 @@ interface ISub { */ List getAllSubInfoList(String callingPackage, String callingFeatureId); - /** - * @param callingPackage The package maing the call. - * @param callingFeatureId The feature in the package - * @return the count of all subscriptions in the database, this includes - * all subscriptions that have been seen. - */ - int getAllSubInfoCount(String callingPackage, String callingFeatureId); - /** * Get the active SubscriptionInfo with the subId key * @param subId The unique SubscriptionInfo key in database