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

Commit f6b93772 authored by Ling Ma's avatar Ling Ma Committed by Android (Google) Code Review
Browse files

Merge "Wrap subManager creation with createForAllProfiles" into main

parents 4b804094 63f74b85
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -44,8 +44,9 @@ public class SimLockPreferenceController extends BasePreferenceController {
        mUserManager = (UserManager) context.getSystemService(Context.USER_SERVICE);
        mCarrierConfigManager = (CarrierConfigManager)
                mContext.getSystemService(Context.CARRIER_CONFIG_SERVICE);
        mSubscriptionManager = (SubscriptionManager) context
                .getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE);
        mSubscriptionManager = ((SubscriptionManager) context
                .getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE))
                .createForAllUserProfiles();
        mTelephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
    }

+1 −0
Original line number Diff line number Diff line
@@ -77,6 +77,7 @@ public class SimLockPreferenceControllerTest {
        ShadowApplication shadowApplication = ShadowApplication.getInstance();
        shadowApplication.setSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE,
                mSubscriptionManager);
        when(mSubscriptionManager.createForAllUserProfiles()).thenReturn(mSubscriptionManager);
        shadowApplication.setSystemService(Context.CARRIER_CONFIG_SERVICE, mCarrierManager);
        shadowApplication.setSystemService(Context.USER_SERVICE, mUserManager);
        shadowApplication.setSystemService(Context.TELEPHONY_SERVICE, mTelephonyManager);