Loading src/com/android/server/telecom/Call.java +1 −1 Original line number Diff line number Diff line Loading @@ -2083,7 +2083,7 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, userHandle = mTargetPhoneAccountHandle.getUserHandle(); } if (userHandle != null) { isWorkCall = UserUtil.isManagedProfile(mContext, userHandle); isWorkCall = UserUtil.isManagedProfile(mContext, userHandle, mFlags); } isCallRecordingToneSupported = (phoneAccount.hasCapabilities( Loading src/com/android/server/telecom/CallIntentProcessor.java +10 −7 Original line number Diff line number Diff line Loading @@ -168,7 +168,8 @@ public class CallIntentProcessor { if (!callsManager.isSelfManaged(phoneAccountHandle, (UserHandle) intent.getParcelableExtra(KEY_INITIATING_USER))) { boolean fixedInitiatingUser = fixInitiatingUserIfNecessary(context, intent); boolean fixedInitiatingUser = fixInitiatingUserIfNecessary( context, intent, featureFlags); // Show the toast to warn user that it is a personal call though initiated in work // profile. if (fixedInitiatingUser) { Loading Loading @@ -226,16 +227,18 @@ public class CallIntentProcessor { * * @return whether the initiating user is fixed. */ static boolean fixInitiatingUserIfNecessary(Context context, Intent intent) { static boolean fixInitiatingUserIfNecessary(Context context, Intent intent, FeatureFlags featureFlags) { final UserHandle initiatingUser = intent.getParcelableExtra(KEY_INITIATING_USER); if (UserUtil.isManagedProfile(context, initiatingUser)) { if (UserUtil.isManagedProfile(context, initiatingUser, featureFlags)) { boolean noDialerInstalled = DefaultDialerManager.getInstalledDialerApplications(context, initiatingUser.getIdentifier()).size() == 0; if (noDialerInstalled) { final UserManager userManager = UserManager.get(context); UserHandle parentUserHandle = userManager.getProfileParent( initiatingUser.getIdentifier()).getUserHandle(); final UserManager userManager = context.getSystemService(UserManager.class); UserHandle parentUserHandle = featureFlags.telecomResolveHiddenDependencies() ? userManager.getProfileParent(initiatingUser) : userManager.getProfileParent(initiatingUser.getIdentifier()) .getUserHandle(); intent.putExtra(KEY_INITIATING_USER, parentUserHandle); Log.i(CallIntentProcessor.class, "fixInitiatingUserIfNecessary: no dialer installed" Loading src/com/android/server/telecom/CallLogManager.java +5 −2 Original line number Diff line number Diff line Loading @@ -369,7 +369,7 @@ public final class CallLogManager extends CallsManagerListenerBase { if (phoneAccount != null && phoneAccount.hasCapabilities(PhoneAccount.CAPABILITY_MULTI_USER)) { if (initiatingUser != null && UserUtil.isManagedProfile(mContext, initiatingUser)) { UserUtil.isManagedProfile(mContext, initiatingUser, mFeatureFlags)) { paramBuilder.setUserToBeInsertedTo(initiatingUser); paramBuilder.setAddForAllUsers(false); } else { Loading Loading @@ -706,7 +706,10 @@ public final class CallLogManager extends CallsManagerListenerBase { // Use shadow provider based on current user unlock state. Uri providerUri; if (userManager.isUserUnlocked(currentUserId)) { boolean isCurrentUserUnlocked = mFeatureFlags.telecomResolveHiddenDependencies() ? userManager.isUserUnlocked(UserHandle.CURRENT) : userManager.isUserUnlocked(currentUserId); if (isCurrentUserUnlocked) { providerUri = Calls.CONTENT_URI; } else { providerUri = Calls.SHADOW_CONTENT_URI; Loading src/com/android/server/telecom/CallsManager.java +62 −23 Original line number Diff line number Diff line Loading @@ -675,7 +675,7 @@ public class CallsManager extends Call.ListenerBase () -> audioManager.getStreamVolume(AudioManager.STREAM_RING) > 0); SystemSettingsUtil systemSettingsUtil = new SystemSettingsUtil(); RingtoneFactory ringtoneFactory = new RingtoneFactory(this, context); RingtoneFactory ringtoneFactory = new RingtoneFactory(this, context, featureFlags); SystemVibrator systemVibrator = new SystemVibrator(context); mInCallController = inCallControllerFactory.create(context, mLock, this, systemStateHelper, defaultDialerCache, mTimeoutsAdapter, Loading Loading @@ -749,7 +749,7 @@ public class CallsManager extends Call.ListenerBase mVoipCallMonitor.startMonitor(); // There is no USER_SWITCHED broadcast for user 0, handle it here explicitly. final UserManager userManager = UserManager.get(mContext); final UserManager userManager = mContext.getSystemService(UserManager.class); // Don't load missed call if it is run in split user model. if (userManager.isPrimaryUser()) { onUserSwitch(Process.myUserHandle()); Loading Loading @@ -1677,9 +1677,15 @@ public class CallsManager extends Call.ListenerBase boolean isCallHiddenFromProfile = !isCallVisibleForUser(call, mCurrentUserHandle); // For admins, we should check if the work profile is paused in order to reject // the call. if (mUserManager.isUserAdmin(mCurrentUserHandle.getIdentifier())) { isCallHiddenFromProfile &= mUserManager.isQuietModeEnabled( call.getAssociatedUser()); UserManager currentUserManager = mContext.createContextAsUser(mCurrentUserHandle, 0) .getSystemService(UserManager.class); boolean isCurrentUserAdmin = mFeatureFlags.telecomResolveHiddenDependencies() ? currentUserManager.isAdminUser() : mUserManager.isUserAdmin(mCurrentUserHandle.getIdentifier()); if (isCurrentUserAdmin) { isCallHiddenFromProfile &= mFeatureFlags.telecomResolveHiddenDependencies() ? currentUserManager.isQuietModeEnabled(call.getAssociatedUser()) : mUserManager.isQuietModeEnabled(call.getAssociatedUser()); } // We should always allow emergency calls and also allow non-emergency calls when ECBM Loading Loading @@ -2136,7 +2142,7 @@ public class CallsManager extends Call.ListenerBase Uri callUri = callToPlace.getHandle(); if (PhoneAccount.SCHEME_TEL.equals(callUri.getScheme())) { int managedProfileUserId = getManagedProfileUserId(mContext, initiatingUser.getIdentifier()); initiatingUser.getIdentifier(), mFeatureFlags); if (managedProfileUserId != UserHandle.USER_NULL && mPhoneAccountRegistrar.getCallCapablePhoneAccounts( Loading Loading @@ -2311,10 +2317,29 @@ public class CallsManager extends Call.ListenerBase return mLatestPostSelectionProcessingFuture; } private static int getManagedProfileUserId(Context context, int userId) { UserManager um = context.getSystemService(UserManager.class); List<UserInfo> userProfiles = um.getProfiles(userId); for (UserInfo uInfo : userProfiles) { private static int getManagedProfileUserId(Context context, int userId, FeatureFlags featureFlags) { UserManager um; UserHandle userHandle = UserHandle.of(userId); um = featureFlags.telecomResolveHiddenDependencies() ? context.createContextAsUser(userHandle, 0).getSystemService(UserManager.class) : context.getSystemService(UserManager.class); if (featureFlags.telecomResolveHiddenDependencies()) { List<UserHandle> userProfiles = um.getAllProfiles(); for (UserHandle userProfile : userProfiles) { UserManager profileUserManager = context.createContextAsUser(userProfile, 0) .getSystemService(UserManager.class); if (userProfile.getIdentifier() == userId) { continue; } if (profileUserManager.isManagedProfile()) { return userProfile.getIdentifier(); } } } else { List<UserInfo> userInfoProfiles = um.getProfiles(userId); for (UserInfo uInfo : userInfoProfiles) { if (uInfo.id == userId) { continue; } Loading @@ -2322,6 +2347,7 @@ public class CallsManager extends Call.ListenerBase return uInfo.id; } } } return UserHandle.USER_NULL; } Loading Loading @@ -2432,8 +2458,8 @@ public class CallsManager extends Call.ListenerBase boolean isSelfManaged = account != null && account.isSelfManaged(); // Enforce outgoing call restriction for conference calls. This is handled via // UserCallIntentProcessor for normal MO calls. if (UserUtil.hasOutgoingCallsUserRestriction(mContext, initiatingUser, null, isSelfManaged, CallsManager.class.getCanonicalName())) { if (UserUtil.hasOutgoingCallsUserRestriction(mContext, initiatingUser, null, isSelfManaged, CallsManager.class.getCanonicalName(), mFeatureFlags)) { return; } CompletableFuture<Call> callFuture = startOutgoingCall(participants, phoneAccountHandle, Loading Loading @@ -5524,19 +5550,30 @@ public class CallsManager extends Call.ListenerBase mCurrentUserHandle = userHandle; mMissedCallNotifier.setCurrentUserHandle(userHandle); mRoleManagerAdapter.setCurrentUserHandle(userHandle); final UserManager userManager = UserManager.get(mContext); List<UserInfo> profiles = userManager.getEnabledProfiles(userHandle.getIdentifier()); for (UserInfo profile : profiles) { final UserManager userManager = mFeatureFlags.telecomResolveHiddenDependencies() ? mContext.createContextAsUser(userHandle, 0).getSystemService( UserManager.class) : mContext.getSystemService(UserManager.class); List<UserHandle> profiles = userManager.getUserProfiles(); List<UserInfo> userInfoProfiles = userManager.getEnabledProfiles( userHandle.getIdentifier()); if (mFeatureFlags.telecomResolveHiddenDependencies()) { for (UserHandle profileUser : profiles) { reloadMissedCallsOfUser(profileUser); } } else { for (UserInfo profile : userInfoProfiles) { reloadMissedCallsOfUser(profile.getUserHandle()); } } } /** * Because there may be chances that profiles are not started yet though its parent user is * switched, we reload missed calls of profile that are just started here. */ void onUserStarting(UserHandle userHandle) { if (UserUtil.isProfile(mContext, userHandle)) { if (UserUtil.isProfile(mContext, userHandle, mFeatureFlags)) { reloadMissedCallsOfUser(userHandle); } } Loading Loading @@ -5645,8 +5682,10 @@ public class CallsManager extends Call.ListenerBase UserManager userManager = mContext.getSystemService(UserManager.class); KeyguardManager keyguardManager = mContext.getSystemService(KeyguardManager.class); boolean isUserRestricted = userManager != null && userManager.hasUserRestriction(UserManager.DISALLOW_SMS, callingUser); boolean hasUserRestriction = mFeatureFlags.telecomResolveHiddenDependencies() ? userManager.hasUserRestrictionForUser(UserManager.DISALLOW_SMS, callingUser) : userManager.hasUserRestriction(UserManager.DISALLOW_SMS, callingUser); boolean isUserRestricted = userManager != null && hasUserRestriction; boolean isLockscreenRestricted = keyguardManager != null && keyguardManager.isDeviceLocked(); Log.d(this, "isReplyWithSmsAllowed: isUserRestricted: %s, isLockscreenRestricted: %s", Loading src/com/android/server/telecom/InCallController.java +10 −4 Original line number Diff line number Diff line Loading @@ -361,7 +361,8 @@ public class InCallController extends CallsManagerListenerBase implements Log.i(this, "Attempting to bind to InCall %s, with %s", mInCallServiceInfo, intent); mIsConnected = true; mInCallServiceInfo.setBindingStartTime(mClockProxy.elapsedRealtime()); boolean isManagedProfile = UserUtil.isManagedProfile(mContext, userFromCall); boolean isManagedProfile = UserUtil.isManagedProfile(mContext, userFromCall, mFeatureFlags); // Note that UserHandle.CURRENT fails to capture the work profile, so we need to handle // it separately to ensure that the ICS is bound to the appropriate user. If ECBM is // active, we know that a work sim was previously used to place a MO emergency call. We Loading Loading @@ -3111,7 +3112,13 @@ public class InCallController extends CallsManagerListenerBase implements return mCallsManager.getCurrentUserHandle(); } else { UserHandle userFromCall = call.getAssociatedUser(); UserManager userManager = mContext.getSystemService(UserManager.class); UserManager userManager = mFeatureFlags.telecomResolveHiddenDependencies() ? mContext.createContextAsUser(mCallsManager.getCurrentUserHandle(), 0) .getSystemService(UserManager.class) : mContext.getSystemService(UserManager.class); boolean isCurrentUserAdmin = mFeatureFlags.telecomResolveHiddenDependencies() ? userManager.isAdminUser() : userManager.isUserAdmin(mCallsManager.getCurrentUserHandle().getIdentifier()); // Emergency call should never be blocked, so if the user associated with the target // phone account handle user is in quiet mode, use the current user for the ecall. // Note, that this only applies to incoming calls that are received on assigned Loading @@ -3121,8 +3128,7 @@ public class InCallController extends CallsManagerListenerBase implements && (userManager.isQuietModeEnabled(userFromCall) // We should also account for secondary/guest users where the profile may not // necessarily be paused. || !userManager.isUserAdmin(mCallsManager.getCurrentUserHandle() .getIdentifier()))) { || !isCurrentUserAdmin)) { return mCallsManager.getCurrentUserHandle(); } return userFromCall; Loading Loading
src/com/android/server/telecom/Call.java +1 −1 Original line number Diff line number Diff line Loading @@ -2083,7 +2083,7 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, userHandle = mTargetPhoneAccountHandle.getUserHandle(); } if (userHandle != null) { isWorkCall = UserUtil.isManagedProfile(mContext, userHandle); isWorkCall = UserUtil.isManagedProfile(mContext, userHandle, mFlags); } isCallRecordingToneSupported = (phoneAccount.hasCapabilities( Loading
src/com/android/server/telecom/CallIntentProcessor.java +10 −7 Original line number Diff line number Diff line Loading @@ -168,7 +168,8 @@ public class CallIntentProcessor { if (!callsManager.isSelfManaged(phoneAccountHandle, (UserHandle) intent.getParcelableExtra(KEY_INITIATING_USER))) { boolean fixedInitiatingUser = fixInitiatingUserIfNecessary(context, intent); boolean fixedInitiatingUser = fixInitiatingUserIfNecessary( context, intent, featureFlags); // Show the toast to warn user that it is a personal call though initiated in work // profile. if (fixedInitiatingUser) { Loading Loading @@ -226,16 +227,18 @@ public class CallIntentProcessor { * * @return whether the initiating user is fixed. */ static boolean fixInitiatingUserIfNecessary(Context context, Intent intent) { static boolean fixInitiatingUserIfNecessary(Context context, Intent intent, FeatureFlags featureFlags) { final UserHandle initiatingUser = intent.getParcelableExtra(KEY_INITIATING_USER); if (UserUtil.isManagedProfile(context, initiatingUser)) { if (UserUtil.isManagedProfile(context, initiatingUser, featureFlags)) { boolean noDialerInstalled = DefaultDialerManager.getInstalledDialerApplications(context, initiatingUser.getIdentifier()).size() == 0; if (noDialerInstalled) { final UserManager userManager = UserManager.get(context); UserHandle parentUserHandle = userManager.getProfileParent( initiatingUser.getIdentifier()).getUserHandle(); final UserManager userManager = context.getSystemService(UserManager.class); UserHandle parentUserHandle = featureFlags.telecomResolveHiddenDependencies() ? userManager.getProfileParent(initiatingUser) : userManager.getProfileParent(initiatingUser.getIdentifier()) .getUserHandle(); intent.putExtra(KEY_INITIATING_USER, parentUserHandle); Log.i(CallIntentProcessor.class, "fixInitiatingUserIfNecessary: no dialer installed" Loading
src/com/android/server/telecom/CallLogManager.java +5 −2 Original line number Diff line number Diff line Loading @@ -369,7 +369,7 @@ public final class CallLogManager extends CallsManagerListenerBase { if (phoneAccount != null && phoneAccount.hasCapabilities(PhoneAccount.CAPABILITY_MULTI_USER)) { if (initiatingUser != null && UserUtil.isManagedProfile(mContext, initiatingUser)) { UserUtil.isManagedProfile(mContext, initiatingUser, mFeatureFlags)) { paramBuilder.setUserToBeInsertedTo(initiatingUser); paramBuilder.setAddForAllUsers(false); } else { Loading Loading @@ -706,7 +706,10 @@ public final class CallLogManager extends CallsManagerListenerBase { // Use shadow provider based on current user unlock state. Uri providerUri; if (userManager.isUserUnlocked(currentUserId)) { boolean isCurrentUserUnlocked = mFeatureFlags.telecomResolveHiddenDependencies() ? userManager.isUserUnlocked(UserHandle.CURRENT) : userManager.isUserUnlocked(currentUserId); if (isCurrentUserUnlocked) { providerUri = Calls.CONTENT_URI; } else { providerUri = Calls.SHADOW_CONTENT_URI; Loading
src/com/android/server/telecom/CallsManager.java +62 −23 Original line number Diff line number Diff line Loading @@ -675,7 +675,7 @@ public class CallsManager extends Call.ListenerBase () -> audioManager.getStreamVolume(AudioManager.STREAM_RING) > 0); SystemSettingsUtil systemSettingsUtil = new SystemSettingsUtil(); RingtoneFactory ringtoneFactory = new RingtoneFactory(this, context); RingtoneFactory ringtoneFactory = new RingtoneFactory(this, context, featureFlags); SystemVibrator systemVibrator = new SystemVibrator(context); mInCallController = inCallControllerFactory.create(context, mLock, this, systemStateHelper, defaultDialerCache, mTimeoutsAdapter, Loading Loading @@ -749,7 +749,7 @@ public class CallsManager extends Call.ListenerBase mVoipCallMonitor.startMonitor(); // There is no USER_SWITCHED broadcast for user 0, handle it here explicitly. final UserManager userManager = UserManager.get(mContext); final UserManager userManager = mContext.getSystemService(UserManager.class); // Don't load missed call if it is run in split user model. if (userManager.isPrimaryUser()) { onUserSwitch(Process.myUserHandle()); Loading Loading @@ -1677,9 +1677,15 @@ public class CallsManager extends Call.ListenerBase boolean isCallHiddenFromProfile = !isCallVisibleForUser(call, mCurrentUserHandle); // For admins, we should check if the work profile is paused in order to reject // the call. if (mUserManager.isUserAdmin(mCurrentUserHandle.getIdentifier())) { isCallHiddenFromProfile &= mUserManager.isQuietModeEnabled( call.getAssociatedUser()); UserManager currentUserManager = mContext.createContextAsUser(mCurrentUserHandle, 0) .getSystemService(UserManager.class); boolean isCurrentUserAdmin = mFeatureFlags.telecomResolveHiddenDependencies() ? currentUserManager.isAdminUser() : mUserManager.isUserAdmin(mCurrentUserHandle.getIdentifier()); if (isCurrentUserAdmin) { isCallHiddenFromProfile &= mFeatureFlags.telecomResolveHiddenDependencies() ? currentUserManager.isQuietModeEnabled(call.getAssociatedUser()) : mUserManager.isQuietModeEnabled(call.getAssociatedUser()); } // We should always allow emergency calls and also allow non-emergency calls when ECBM Loading Loading @@ -2136,7 +2142,7 @@ public class CallsManager extends Call.ListenerBase Uri callUri = callToPlace.getHandle(); if (PhoneAccount.SCHEME_TEL.equals(callUri.getScheme())) { int managedProfileUserId = getManagedProfileUserId(mContext, initiatingUser.getIdentifier()); initiatingUser.getIdentifier(), mFeatureFlags); if (managedProfileUserId != UserHandle.USER_NULL && mPhoneAccountRegistrar.getCallCapablePhoneAccounts( Loading Loading @@ -2311,10 +2317,29 @@ public class CallsManager extends Call.ListenerBase return mLatestPostSelectionProcessingFuture; } private static int getManagedProfileUserId(Context context, int userId) { UserManager um = context.getSystemService(UserManager.class); List<UserInfo> userProfiles = um.getProfiles(userId); for (UserInfo uInfo : userProfiles) { private static int getManagedProfileUserId(Context context, int userId, FeatureFlags featureFlags) { UserManager um; UserHandle userHandle = UserHandle.of(userId); um = featureFlags.telecomResolveHiddenDependencies() ? context.createContextAsUser(userHandle, 0).getSystemService(UserManager.class) : context.getSystemService(UserManager.class); if (featureFlags.telecomResolveHiddenDependencies()) { List<UserHandle> userProfiles = um.getAllProfiles(); for (UserHandle userProfile : userProfiles) { UserManager profileUserManager = context.createContextAsUser(userProfile, 0) .getSystemService(UserManager.class); if (userProfile.getIdentifier() == userId) { continue; } if (profileUserManager.isManagedProfile()) { return userProfile.getIdentifier(); } } } else { List<UserInfo> userInfoProfiles = um.getProfiles(userId); for (UserInfo uInfo : userInfoProfiles) { if (uInfo.id == userId) { continue; } Loading @@ -2322,6 +2347,7 @@ public class CallsManager extends Call.ListenerBase return uInfo.id; } } } return UserHandle.USER_NULL; } Loading Loading @@ -2432,8 +2458,8 @@ public class CallsManager extends Call.ListenerBase boolean isSelfManaged = account != null && account.isSelfManaged(); // Enforce outgoing call restriction for conference calls. This is handled via // UserCallIntentProcessor for normal MO calls. if (UserUtil.hasOutgoingCallsUserRestriction(mContext, initiatingUser, null, isSelfManaged, CallsManager.class.getCanonicalName())) { if (UserUtil.hasOutgoingCallsUserRestriction(mContext, initiatingUser, null, isSelfManaged, CallsManager.class.getCanonicalName(), mFeatureFlags)) { return; } CompletableFuture<Call> callFuture = startOutgoingCall(participants, phoneAccountHandle, Loading Loading @@ -5524,19 +5550,30 @@ public class CallsManager extends Call.ListenerBase mCurrentUserHandle = userHandle; mMissedCallNotifier.setCurrentUserHandle(userHandle); mRoleManagerAdapter.setCurrentUserHandle(userHandle); final UserManager userManager = UserManager.get(mContext); List<UserInfo> profiles = userManager.getEnabledProfiles(userHandle.getIdentifier()); for (UserInfo profile : profiles) { final UserManager userManager = mFeatureFlags.telecomResolveHiddenDependencies() ? mContext.createContextAsUser(userHandle, 0).getSystemService( UserManager.class) : mContext.getSystemService(UserManager.class); List<UserHandle> profiles = userManager.getUserProfiles(); List<UserInfo> userInfoProfiles = userManager.getEnabledProfiles( userHandle.getIdentifier()); if (mFeatureFlags.telecomResolveHiddenDependencies()) { for (UserHandle profileUser : profiles) { reloadMissedCallsOfUser(profileUser); } } else { for (UserInfo profile : userInfoProfiles) { reloadMissedCallsOfUser(profile.getUserHandle()); } } } /** * Because there may be chances that profiles are not started yet though its parent user is * switched, we reload missed calls of profile that are just started here. */ void onUserStarting(UserHandle userHandle) { if (UserUtil.isProfile(mContext, userHandle)) { if (UserUtil.isProfile(mContext, userHandle, mFeatureFlags)) { reloadMissedCallsOfUser(userHandle); } } Loading Loading @@ -5645,8 +5682,10 @@ public class CallsManager extends Call.ListenerBase UserManager userManager = mContext.getSystemService(UserManager.class); KeyguardManager keyguardManager = mContext.getSystemService(KeyguardManager.class); boolean isUserRestricted = userManager != null && userManager.hasUserRestriction(UserManager.DISALLOW_SMS, callingUser); boolean hasUserRestriction = mFeatureFlags.telecomResolveHiddenDependencies() ? userManager.hasUserRestrictionForUser(UserManager.DISALLOW_SMS, callingUser) : userManager.hasUserRestriction(UserManager.DISALLOW_SMS, callingUser); boolean isUserRestricted = userManager != null && hasUserRestriction; boolean isLockscreenRestricted = keyguardManager != null && keyguardManager.isDeviceLocked(); Log.d(this, "isReplyWithSmsAllowed: isUserRestricted: %s, isLockscreenRestricted: %s", Loading
src/com/android/server/telecom/InCallController.java +10 −4 Original line number Diff line number Diff line Loading @@ -361,7 +361,8 @@ public class InCallController extends CallsManagerListenerBase implements Log.i(this, "Attempting to bind to InCall %s, with %s", mInCallServiceInfo, intent); mIsConnected = true; mInCallServiceInfo.setBindingStartTime(mClockProxy.elapsedRealtime()); boolean isManagedProfile = UserUtil.isManagedProfile(mContext, userFromCall); boolean isManagedProfile = UserUtil.isManagedProfile(mContext, userFromCall, mFeatureFlags); // Note that UserHandle.CURRENT fails to capture the work profile, so we need to handle // it separately to ensure that the ICS is bound to the appropriate user. If ECBM is // active, we know that a work sim was previously used to place a MO emergency call. We Loading Loading @@ -3111,7 +3112,13 @@ public class InCallController extends CallsManagerListenerBase implements return mCallsManager.getCurrentUserHandle(); } else { UserHandle userFromCall = call.getAssociatedUser(); UserManager userManager = mContext.getSystemService(UserManager.class); UserManager userManager = mFeatureFlags.telecomResolveHiddenDependencies() ? mContext.createContextAsUser(mCallsManager.getCurrentUserHandle(), 0) .getSystemService(UserManager.class) : mContext.getSystemService(UserManager.class); boolean isCurrentUserAdmin = mFeatureFlags.telecomResolveHiddenDependencies() ? userManager.isAdminUser() : userManager.isUserAdmin(mCallsManager.getCurrentUserHandle().getIdentifier()); // Emergency call should never be blocked, so if the user associated with the target // phone account handle user is in quiet mode, use the current user for the ecall. // Note, that this only applies to incoming calls that are received on assigned Loading @@ -3121,8 +3128,7 @@ public class InCallController extends CallsManagerListenerBase implements && (userManager.isQuietModeEnabled(userFromCall) // We should also account for secondary/guest users where the profile may not // necessarily be paused. || !userManager.isUserAdmin(mCallsManager.getCurrentUserHandle() .getIdentifier()))) { || !isCurrentUserAdmin)) { return mCallsManager.getCurrentUserHandle(); } return userFromCall; Loading