Loading src/com/android/server/telecom/CallIntentProcessor.java +14 −4 Original line number Diff line number Diff line Loading @@ -127,11 +127,18 @@ public class CallIntentProcessor { VideoProfile.STATE_AUDIO_ONLY); clientExtras.putInt(TelecomManager.EXTRA_START_CALL_WITH_VIDEO_STATE, videoState); if (!callsManager.isSelfManaged(phoneAccountHandle, (UserHandle) intent.getParcelableExtra(KEY_INITIATING_USER))) { boolean fixedInitiatingUser = fixInitiatingUserIfNecessary(context, intent); // Show the toast to warn user that it is a personal call though initiated in work profile. // Show the toast to warn user that it is a personal call though initiated in work // profile. if (fixedInitiatingUser) { Toast.makeText(context, R.string.toast_personal_call_msg, Toast.LENGTH_LONG).show(); } } else { Log.i(CallIntentProcessor.class, "processOutgoingCallIntent: skip initiating user check"); } UserHandle initiatingUser = intent.getParcelableExtra(KEY_INITIATING_USER); Loading Loading @@ -182,6 +189,9 @@ public class CallIntentProcessor { userManager.getProfileParent( initiatingUser.getIdentifier()).getUserHandle(); intent.putExtra(KEY_INITIATING_USER, parentUserHandle); Log.i(CallIntentProcessor.class, "fixInitiatingUserIfNecessary: no dialer installed" + " for current user; setting initiator to parent %s" + parentUserHandle); return true; } } Loading src/com/android/server/telecom/CallsManager.java +7 −1 Original line number Diff line number Diff line Loading @@ -1293,7 +1293,13 @@ public class CallsManager extends Call.ListenerBase return accounts; } private boolean isSelfManaged(PhoneAccountHandle targetPhoneAccountHandle, /** * Determines if a {@link PhoneAccountHandle} is for a self-managed ConnectionService. * @param targetPhoneAccountHandle The phone account to check. * @param initiatingUser The user associated with the account. * @return {@code true} if the phone account is self-managed, {@code false} otherwise. */ public boolean isSelfManaged(PhoneAccountHandle targetPhoneAccountHandle, UserHandle initiatingUser) { PhoneAccount targetPhoneAccount = mPhoneAccountRegistrar.getPhoneAccount( targetPhoneAccountHandle, initiatingUser); Loading Loading
src/com/android/server/telecom/CallIntentProcessor.java +14 −4 Original line number Diff line number Diff line Loading @@ -127,11 +127,18 @@ public class CallIntentProcessor { VideoProfile.STATE_AUDIO_ONLY); clientExtras.putInt(TelecomManager.EXTRA_START_CALL_WITH_VIDEO_STATE, videoState); if (!callsManager.isSelfManaged(phoneAccountHandle, (UserHandle) intent.getParcelableExtra(KEY_INITIATING_USER))) { boolean fixedInitiatingUser = fixInitiatingUserIfNecessary(context, intent); // Show the toast to warn user that it is a personal call though initiated in work profile. // Show the toast to warn user that it is a personal call though initiated in work // profile. if (fixedInitiatingUser) { Toast.makeText(context, R.string.toast_personal_call_msg, Toast.LENGTH_LONG).show(); } } else { Log.i(CallIntentProcessor.class, "processOutgoingCallIntent: skip initiating user check"); } UserHandle initiatingUser = intent.getParcelableExtra(KEY_INITIATING_USER); Loading Loading @@ -182,6 +189,9 @@ public class CallIntentProcessor { userManager.getProfileParent( initiatingUser.getIdentifier()).getUserHandle(); intent.putExtra(KEY_INITIATING_USER, parentUserHandle); Log.i(CallIntentProcessor.class, "fixInitiatingUserIfNecessary: no dialer installed" + " for current user; setting initiator to parent %s" + parentUserHandle); return true; } } Loading
src/com/android/server/telecom/CallsManager.java +7 −1 Original line number Diff line number Diff line Loading @@ -1293,7 +1293,13 @@ public class CallsManager extends Call.ListenerBase return accounts; } private boolean isSelfManaged(PhoneAccountHandle targetPhoneAccountHandle, /** * Determines if a {@link PhoneAccountHandle} is for a self-managed ConnectionService. * @param targetPhoneAccountHandle The phone account to check. * @param initiatingUser The user associated with the account. * @return {@code true} if the phone account is self-managed, {@code false} otherwise. */ public boolean isSelfManaged(PhoneAccountHandle targetPhoneAccountHandle, UserHandle initiatingUser) { PhoneAccount targetPhoneAccount = mPhoneAccountRegistrar.getPhoneAccount( targetPhoneAccountHandle, initiatingUser); Loading