Loading core/java/android/os/UserManager.java +5 −2 Original line number Diff line number Diff line Loading @@ -1296,8 +1296,11 @@ public class UserManager { mContext.getContentResolver(), Settings.Global.ALLOW_USER_SWITCHING_WHEN_SYSTEM_USER_LOCKED, 0) != 0; boolean isSystemUserUnlocked = isUserUnlocked(UserHandle.SYSTEM); boolean inCall = TelephonyManager.getDefault().getCallState() != TelephonyManager.CALL_STATE_IDLE; boolean inCall = false; TelephonyManager telephonyManager = mContext.getSystemService(TelephonyManager.class); if (telephonyManager != null) { inCall = telephonyManager.getCallState() != TelephonyManager.CALL_STATE_IDLE; } boolean isUserSwitchDisallowed = hasUserRestriction(DISALLOW_USER_SWITCH); return (allowUserSwitchingWhenSystemUserLocked || isSystemUserUnlocked) && !inCall && !isUserSwitchDisallowed; Loading core/java/com/android/internal/app/LocaleStore.java +1 −1 Original line number Diff line number Diff line Loading @@ -194,7 +194,7 @@ public class LocaleStore { private static Set<String> getSimCountries(Context context) { Set<String> result = new HashSet<>(); TelephonyManager tm = TelephonyManager.from(context); TelephonyManager tm = context.getSystemService(TelephonyManager.class); if (tm != null) { String iso = tm.getSimCountryIso().toUpperCase(Locale.US); Loading services/core/java/com/android/server/notification/NotificationManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -7402,7 +7402,7 @@ public class NotificationManagerService extends SystemService { } private void listenForCallState() { TelephonyManager.from(getContext()).listen(new PhoneStateListener() { getContext().getSystemService(TelephonyManager.class).listen(new PhoneStateListener() { @Override public void onCallStateChanged(int state, String incomingNumber) { if (mCallState == state) return; Loading services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -1939,7 +1939,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { } TelephonyManager getTelephonyManager() { return TelephonyManager.from(mContext); return mContext.getSystemService(TelephonyManager.class); } TrustManager getTrustManager() { Loading Loading
core/java/android/os/UserManager.java +5 −2 Original line number Diff line number Diff line Loading @@ -1296,8 +1296,11 @@ public class UserManager { mContext.getContentResolver(), Settings.Global.ALLOW_USER_SWITCHING_WHEN_SYSTEM_USER_LOCKED, 0) != 0; boolean isSystemUserUnlocked = isUserUnlocked(UserHandle.SYSTEM); boolean inCall = TelephonyManager.getDefault().getCallState() != TelephonyManager.CALL_STATE_IDLE; boolean inCall = false; TelephonyManager telephonyManager = mContext.getSystemService(TelephonyManager.class); if (telephonyManager != null) { inCall = telephonyManager.getCallState() != TelephonyManager.CALL_STATE_IDLE; } boolean isUserSwitchDisallowed = hasUserRestriction(DISALLOW_USER_SWITCH); return (allowUserSwitchingWhenSystemUserLocked || isSystemUserUnlocked) && !inCall && !isUserSwitchDisallowed; Loading
core/java/com/android/internal/app/LocaleStore.java +1 −1 Original line number Diff line number Diff line Loading @@ -194,7 +194,7 @@ public class LocaleStore { private static Set<String> getSimCountries(Context context) { Set<String> result = new HashSet<>(); TelephonyManager tm = TelephonyManager.from(context); TelephonyManager tm = context.getSystemService(TelephonyManager.class); if (tm != null) { String iso = tm.getSimCountryIso().toUpperCase(Locale.US); Loading
services/core/java/com/android/server/notification/NotificationManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -7402,7 +7402,7 @@ public class NotificationManagerService extends SystemService { } private void listenForCallState() { TelephonyManager.from(getContext()).listen(new PhoneStateListener() { getContext().getSystemService(TelephonyManager.class).listen(new PhoneStateListener() { @Override public void onCallStateChanged(int state, String incomingNumber) { if (mCallState == state) return; Loading
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -1939,7 +1939,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { } TelephonyManager getTelephonyManager() { return TelephonyManager.from(mContext); return mContext.getSystemService(TelephonyManager.class); } TrustManager getTrustManager() { Loading