From bc4474ee4ed9a9fd80f8bcf9e274afcd359391c8 Mon Sep 17 00:00:00 2001 From: Gil Cukierman Date: Fri, 27 Jan 2023 00:16:46 +0000 Subject: [PATCH] Add Testing Hook For TelephonyManager ISub Member New hook allows tests to set a mock for the SubscriptionManagerService Bug: 266472206 Test: atest GsmCdmaPhoneTest # see topic Change-Id: I585af448847a9bb73dc3e22757874d28e54bc7cc --- .../android/telephony/TelephonyManager.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 83b909852d8f3..0921834436bda 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -16355,6 +16355,7 @@ public class TelephonyManager { /** * Setup sIPhoneSubInfo for testing. + * * @hide */ @VisibleForTesting @@ -16365,9 +16366,21 @@ public class TelephonyManager { } /** - * Whether device can connect to 5G network when two SIMs are active. + * Setup sISub for testing. + * * @hide - * TODO b/153669716: remove or make system API. + */ + @VisibleForTesting + public static void setupISubForTest(ISub iSub) { + synchronized (sCacheLock) { + sISub = iSub; + } + } + + /** + * Whether device can connect to 5G network when two SIMs are active. + * + * @hide TODO b/153669716: remove or make system API. */ public boolean canConnectTo5GInDsdsMode() { ITelephony telephony = getITelephony();