Merge "Wrap subManager creation with createForAllProfiles" into main
This commit is contained in:
@@ -49,7 +49,8 @@ class OpenNetworkSelectPagePreferenceControllerTest {
|
||||
}
|
||||
|
||||
private val mockSubscriptionManager = mock<SubscriptionManager> {
|
||||
on { activeSubscriptionInfoList } doAnswer { listOf(subscriptionInfo) }
|
||||
on { createForAllUserProfiles() } doReturn mock
|
||||
on { getActiveSubscriptionInfo(SUB_ID) } doReturn subscriptionInfo
|
||||
}
|
||||
|
||||
private val context: Context = spy(ApplicationProvider.getApplicationContext()) {
|
||||
|
@@ -77,6 +77,7 @@ public class ActiveSubscriptionsListenerTest {
|
||||
|
||||
mContext = spy(ApplicationProvider.getApplicationContext());
|
||||
when(mContext.getSystemService(SubscriptionManager.class)).thenReturn(mSubscriptionManager);
|
||||
doReturn(mSubscriptionManager).when(mSubscriptionManager).createForAllUserProfiles();
|
||||
|
||||
mActiveSubscriptions = new ArrayList<SubscriptionInfo>();
|
||||
addMockSubscription(SUB_ID1);
|
||||
|
@@ -77,6 +77,7 @@ public class UiccSlotUtilTest {
|
||||
when(mTelephonyManager.getUiccCardsInfo()).thenReturn(mUiccCardInfo);
|
||||
|
||||
when(mContext.getSystemService(SubscriptionManager.class)).thenReturn(mSubscriptionManager);
|
||||
when(mSubscriptionManager.createForAllUserProfiles()).thenReturn(mSubscriptionManager);
|
||||
when(mSubscriptionManager.getAllSubscriptionInfoList()).thenReturn(mSubscriptionInfoList);
|
||||
}
|
||||
|
||||
|
@@ -113,6 +113,7 @@ public class MobileNetworkUtilsTest {
|
||||
|
||||
mContext = spy(ApplicationProvider.getApplicationContext());
|
||||
when(mContext.getSystemService(SubscriptionManager.class)).thenReturn(mSubscriptionManager);
|
||||
when(mSubscriptionManager.createForAllUserProfiles()).thenReturn(mSubscriptionManager);
|
||||
when(mContext.getSystemService(TelephonyManager.class)).thenReturn(mTelephonyManager);
|
||||
when(mTelephonyManager.createForSubscriptionId(SUB_ID_1)).thenReturn(mTelephonyManager);
|
||||
when(mTelephonyManager.createForSubscriptionId(SUB_ID_2)).thenReturn(mTelephonyManager2);
|
||||
|
@@ -37,7 +37,6 @@ import android.telephony.CarrierConfigManager;
|
||||
import android.telephony.SubscriptionInfo;
|
||||
import android.telephony.SubscriptionManager;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.util.FeatureFlagUtils;
|
||||
|
||||
import androidx.preference.PreferenceCategory;
|
||||
import androidx.preference.PreferenceManager;
|
||||
@@ -100,6 +99,7 @@ public class NetworkProviderWifiCallingGroupTest {
|
||||
when(mContext.getSystemService(CarrierConfigManager.class)).thenReturn(
|
||||
mCarrierConfigManager);
|
||||
when(mContext.getSystemService(SubscriptionManager.class)).thenReturn(mSubscriptionManager);
|
||||
when(mSubscriptionManager.createForAllUserProfiles()).thenReturn(mSubscriptionManager);
|
||||
when(mContext.getSystemService(TelecomManager.class)).thenReturn(mTelecomManager);
|
||||
when(mContext.getSystemService(TelephonyManager.class)).thenReturn(mTelephonyManager);
|
||||
when(mTelephonyManager.createForSubscriptionId(SUB_ID)).thenReturn(mTelephonyManager);
|
||||
|
@@ -55,6 +55,7 @@ public class TelephonyBasePreferenceControllerTest {
|
||||
mContext = spy(ApplicationProvider.getApplicationContext());
|
||||
when(mContext.getSystemService(SubscriptionManager.class))
|
||||
.thenReturn(mSubscriptionManager);
|
||||
when(mSubscriptionManager.createForAllUserProfiles()).thenReturn(mSubscriptionManager);
|
||||
when(mSubscriptionInfo.getSubscriptionId()).thenReturn(VALID_SUB_ID);
|
||||
mPreferenceController = new TestPreferenceController(mContext, "prefKey");
|
||||
}
|
||||
|
Reference in New Issue
Block a user