Loading src/com/android/server/telecom/Call.java +9 −5 Original line number Diff line number Diff line Loading @@ -643,6 +643,10 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, } public void initAnalytics() { initAnalytics(null); } public void initAnalytics(String callingPackage) { int analyticsDirection; switch (mCallDirection) { case CALL_DIRECTION_OUTGOING: Loading @@ -658,7 +662,7 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, } mAnalytics = Analytics.initiateCallAnalytics(mId, analyticsDirection); mAnalytics.setCallIsEmergency(mIsEmergencyCall); Log.addEvent(this, LogUtils.Events.CREATED); Log.addEvent(this, LogUtils.Events.CREATED, callingPackage); } public Analytics.CallInfo getAnalytics() { Loading src/com/android/server/telecom/CallIntentProcessor.java +10 −7 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ import android.widget.Toast; public class CallIntentProcessor { public interface Adapter { void processOutgoingCallIntent(Context context, CallsManager callsManager, Intent intent); Intent intent, String callingPackage); void processIncomingCallIntent(CallsManager callsManager, Intent intent); void processUnknownCallIntent(CallsManager callsManager, Intent intent); } Loading @@ -36,8 +36,9 @@ public class CallIntentProcessor { public static class AdapterImpl implements Adapter { @Override public void processOutgoingCallIntent(Context context, CallsManager callsManager, Intent intent) { CallIntentProcessor.processOutgoingCallIntent(context, callsManager, intent); Intent intent, String callingPackage) { CallIntentProcessor.processOutgoingCallIntent(context, callsManager, intent, callingPackage); } @Override Loading Loading @@ -73,7 +74,7 @@ public class CallIntentProcessor { this.mCallsManager = callsManager; } public void processIntent(Intent intent) { public void processIntent(Intent intent, String callingPackage) { final boolean isUnknownCall = intent.getBooleanExtra(KEY_IS_UNKNOWN_CALL, false); Log.i(this, "onReceive - isUnknownCall: %s", isUnknownCall); Loading @@ -81,7 +82,7 @@ public class CallIntentProcessor { if (isUnknownCall) { processUnknownCallIntent(mCallsManager, intent); } else { processOutgoingCallIntent(mContext, mCallsManager, intent); processOutgoingCallIntent(mContext, mCallsManager, intent, callingPackage); } Trace.endSection(); } Loading @@ -91,11 +92,13 @@ public class CallIntentProcessor { * Processes CALL, CALL_PRIVILEGED, and CALL_EMERGENCY intents. * * @param intent Call intent containing data about the handle to call. * @param callingPackage The package which initiated the outgoing call (if known). */ static void processOutgoingCallIntent( Context context, CallsManager callsManager, Intent intent) { Intent intent, String callingPackage) { Uri handle = intent.getData(); String scheme = handle.getScheme(); Loading Loading @@ -145,7 +148,7 @@ public class CallIntentProcessor { // Send to CallsManager to ensure the InCallUI gets kicked off before the broadcast returns Call call = callsManager .startOutgoingCall(handle, phoneAccountHandle, clientExtras, initiatingUser, intent); intent, callingPackage); if (call != null) { sendNewOutgoingCallIntent(context, call, callsManager, intent); Loading src/com/android/server/telecom/CallsManager.java +8 −6 Original line number Diff line number Diff line Loading @@ -1163,10 +1163,11 @@ public class CallsManager extends Call.ListenerBase * @param extras The optional extras Bundle passed with the intent used for the incoming call. * @param initiatingUser {@link UserHandle} of user that place the outgoing call. * @param originalIntent * @param callingPackage the package name of the app which initiated the outgoing call. */ @VisibleForTesting public Call startOutgoingCall(Uri handle, PhoneAccountHandle phoneAccountHandle, Bundle extras, UserHandle initiatingUser, Intent originalIntent) { UserHandle initiatingUser, Intent originalIntent, String callingPackage) { boolean isReusedCall = true; Call call = reuseOutgoingCall(handle); Loading @@ -1192,7 +1193,7 @@ public class CallsManager extends Call.ListenerBase false /* forceAttachToExistingConnection */, false, /* isConference */ mClockProxy); call.initAnalytics(); call.initAnalytics(callingPackage); // Ensure new calls related to self-managed calls/connections are set as such. This // will be overridden when the actual connection is returned in startCreateConnection, Loading Loading @@ -3323,7 +3324,7 @@ public class CallsManager extends Call.ListenerBase /** * Used to confirm creation of an outgoing call which was marked as pending confirmation in * {@link #startOutgoingCall(Uri, PhoneAccountHandle, Bundle, UserHandle, Intent)}. * {@link #startOutgoingCall(Uri, PhoneAccountHandle, Bundle, UserHandle, Intent, String)}. * Called via {@link TelecomBroadcastIntentProcessor} for a call which was confirmed via * {@link ConfirmCallDialogActivity}. * @param callId The call ID of the call to confirm. Loading @@ -3348,7 +3349,7 @@ public class CallsManager extends Call.ListenerBase /** * Used to cancel an outgoing call which was marked as pending confirmation in * {@link #startOutgoingCall(Uri, PhoneAccountHandle, Bundle, UserHandle, Intent)}. * {@link #startOutgoingCall(Uri, PhoneAccountHandle, Bundle, UserHandle, Intent, String)}. * Called via {@link TelecomBroadcastIntentProcessor} for a call which was confirmed via * {@link ConfirmCallDialogActivity}. * @param callId The call ID of the call to cancel. Loading @@ -3364,7 +3365,7 @@ public class CallsManager extends Call.ListenerBase } /** * Called from {@link #startOutgoingCall(Uri, PhoneAccountHandle, Bundle, UserHandle, Intent)} when * Called from {@link #startOutgoingCall(Uri, PhoneAccountHandle, Bundle, UserHandle, Intent, String)} when * a managed call is added while there are ongoing self-managed calls. Starts * {@link ConfirmCallDialogActivity} to prompt the user to see if they wish to place the * outgoing call or not. Loading Loading @@ -3595,7 +3596,8 @@ public class CallsManager extends Call.ListenerBase extras.putParcelable(TelecomManager.EXTRA_CALL_AUDIO_STATE, mCallAudioManager.getCallAudioState()); Call handoverToCall = startOutgoingCall(handoverFromCall.getHandle(), handoverToHandle, extras, getCurrentUserHandle(), null /* originalIntent */); extras, getCurrentUserHandle(), null /* originalIntent */, null /* callingPackage */); if (handoverToCall == null) { handoverFromCall.sendCallEvent(android.telecom.Call.EVENT_HANDOVER_FAILED, null); return; Loading src/com/android/server/telecom/TelecomServiceImpl.java +1 −1 Original line number Diff line number Diff line Loading @@ -1657,7 +1657,7 @@ public class TelecomServiceImpl { try { Log.i(this, "handleCallIntent: handling call intent"); mCallIntentProcessorAdapter.processOutgoingCallIntent(mContext, mCallsManager, intent); mCallsManager, intent, null /* callingPackage */); } finally { Binder.restoreCallingIdentity(token); } Loading src/com/android/server/telecom/components/UserCallIntentProcessor.java +5 −3 Original line number Diff line number Diff line Loading @@ -159,7 +159,7 @@ public class UserCallIntentProcessor { // Save the user handle of current user before forwarding the intent to primary user. intent.putExtra(CallIntentProcessor.KEY_INITIATING_USER, mUserHandle); sendIntentToDestination(intent, isLocalInvocation); sendIntentToDestination(intent, isLocalInvocation, callingPackageName); } private boolean isDefaultOrSystemDialer(String callingPackageName) { Loading Loading @@ -193,7 +193,8 @@ public class UserCallIntentProcessor { * If the caller is local to the Telecom service, we send the intent to Telecom without * sending it through TelecomServiceImpl. */ private boolean sendIntentToDestination(Intent intent, boolean isLocalInvocation) { private boolean sendIntentToDestination(Intent intent, boolean isLocalInvocation, String callingPackage) { intent.putExtra(CallIntentProcessor.KEY_IS_INCOMING_CALL, false); intent.setFlags(Intent.FLAG_RECEIVER_FOREGROUND); if (isLocalInvocation) { Loading @@ -202,7 +203,8 @@ public class UserCallIntentProcessor { // TODO: We should not be using an intent here; this whole flows needs cleanup. Log.i(this, "sendIntentToDestination: send intent to Telecom directly."); synchronized (TelecomSystem.getInstance().getLock()) { TelecomSystem.getInstance().getCallIntentProcessor().processIntent(intent); TelecomSystem.getInstance().getCallIntentProcessor().processIntent(intent, callingPackage); } } else { // We're calling from the UserCallActivity, so the TelecomSystem is not in the same Loading Loading
src/com/android/server/telecom/Call.java +9 −5 Original line number Diff line number Diff line Loading @@ -643,6 +643,10 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, } public void initAnalytics() { initAnalytics(null); } public void initAnalytics(String callingPackage) { int analyticsDirection; switch (mCallDirection) { case CALL_DIRECTION_OUTGOING: Loading @@ -658,7 +662,7 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, } mAnalytics = Analytics.initiateCallAnalytics(mId, analyticsDirection); mAnalytics.setCallIsEmergency(mIsEmergencyCall); Log.addEvent(this, LogUtils.Events.CREATED); Log.addEvent(this, LogUtils.Events.CREATED, callingPackage); } public Analytics.CallInfo getAnalytics() { Loading
src/com/android/server/telecom/CallIntentProcessor.java +10 −7 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ import android.widget.Toast; public class CallIntentProcessor { public interface Adapter { void processOutgoingCallIntent(Context context, CallsManager callsManager, Intent intent); Intent intent, String callingPackage); void processIncomingCallIntent(CallsManager callsManager, Intent intent); void processUnknownCallIntent(CallsManager callsManager, Intent intent); } Loading @@ -36,8 +36,9 @@ public class CallIntentProcessor { public static class AdapterImpl implements Adapter { @Override public void processOutgoingCallIntent(Context context, CallsManager callsManager, Intent intent) { CallIntentProcessor.processOutgoingCallIntent(context, callsManager, intent); Intent intent, String callingPackage) { CallIntentProcessor.processOutgoingCallIntent(context, callsManager, intent, callingPackage); } @Override Loading Loading @@ -73,7 +74,7 @@ public class CallIntentProcessor { this.mCallsManager = callsManager; } public void processIntent(Intent intent) { public void processIntent(Intent intent, String callingPackage) { final boolean isUnknownCall = intent.getBooleanExtra(KEY_IS_UNKNOWN_CALL, false); Log.i(this, "onReceive - isUnknownCall: %s", isUnknownCall); Loading @@ -81,7 +82,7 @@ public class CallIntentProcessor { if (isUnknownCall) { processUnknownCallIntent(mCallsManager, intent); } else { processOutgoingCallIntent(mContext, mCallsManager, intent); processOutgoingCallIntent(mContext, mCallsManager, intent, callingPackage); } Trace.endSection(); } Loading @@ -91,11 +92,13 @@ public class CallIntentProcessor { * Processes CALL, CALL_PRIVILEGED, and CALL_EMERGENCY intents. * * @param intent Call intent containing data about the handle to call. * @param callingPackage The package which initiated the outgoing call (if known). */ static void processOutgoingCallIntent( Context context, CallsManager callsManager, Intent intent) { Intent intent, String callingPackage) { Uri handle = intent.getData(); String scheme = handle.getScheme(); Loading Loading @@ -145,7 +148,7 @@ public class CallIntentProcessor { // Send to CallsManager to ensure the InCallUI gets kicked off before the broadcast returns Call call = callsManager .startOutgoingCall(handle, phoneAccountHandle, clientExtras, initiatingUser, intent); intent, callingPackage); if (call != null) { sendNewOutgoingCallIntent(context, call, callsManager, intent); Loading
src/com/android/server/telecom/CallsManager.java +8 −6 Original line number Diff line number Diff line Loading @@ -1163,10 +1163,11 @@ public class CallsManager extends Call.ListenerBase * @param extras The optional extras Bundle passed with the intent used for the incoming call. * @param initiatingUser {@link UserHandle} of user that place the outgoing call. * @param originalIntent * @param callingPackage the package name of the app which initiated the outgoing call. */ @VisibleForTesting public Call startOutgoingCall(Uri handle, PhoneAccountHandle phoneAccountHandle, Bundle extras, UserHandle initiatingUser, Intent originalIntent) { UserHandle initiatingUser, Intent originalIntent, String callingPackage) { boolean isReusedCall = true; Call call = reuseOutgoingCall(handle); Loading @@ -1192,7 +1193,7 @@ public class CallsManager extends Call.ListenerBase false /* forceAttachToExistingConnection */, false, /* isConference */ mClockProxy); call.initAnalytics(); call.initAnalytics(callingPackage); // Ensure new calls related to self-managed calls/connections are set as such. This // will be overridden when the actual connection is returned in startCreateConnection, Loading Loading @@ -3323,7 +3324,7 @@ public class CallsManager extends Call.ListenerBase /** * Used to confirm creation of an outgoing call which was marked as pending confirmation in * {@link #startOutgoingCall(Uri, PhoneAccountHandle, Bundle, UserHandle, Intent)}. * {@link #startOutgoingCall(Uri, PhoneAccountHandle, Bundle, UserHandle, Intent, String)}. * Called via {@link TelecomBroadcastIntentProcessor} for a call which was confirmed via * {@link ConfirmCallDialogActivity}. * @param callId The call ID of the call to confirm. Loading @@ -3348,7 +3349,7 @@ public class CallsManager extends Call.ListenerBase /** * Used to cancel an outgoing call which was marked as pending confirmation in * {@link #startOutgoingCall(Uri, PhoneAccountHandle, Bundle, UserHandle, Intent)}. * {@link #startOutgoingCall(Uri, PhoneAccountHandle, Bundle, UserHandle, Intent, String)}. * Called via {@link TelecomBroadcastIntentProcessor} for a call which was confirmed via * {@link ConfirmCallDialogActivity}. * @param callId The call ID of the call to cancel. Loading @@ -3364,7 +3365,7 @@ public class CallsManager extends Call.ListenerBase } /** * Called from {@link #startOutgoingCall(Uri, PhoneAccountHandle, Bundle, UserHandle, Intent)} when * Called from {@link #startOutgoingCall(Uri, PhoneAccountHandle, Bundle, UserHandle, Intent, String)} when * a managed call is added while there are ongoing self-managed calls. Starts * {@link ConfirmCallDialogActivity} to prompt the user to see if they wish to place the * outgoing call or not. Loading Loading @@ -3595,7 +3596,8 @@ public class CallsManager extends Call.ListenerBase extras.putParcelable(TelecomManager.EXTRA_CALL_AUDIO_STATE, mCallAudioManager.getCallAudioState()); Call handoverToCall = startOutgoingCall(handoverFromCall.getHandle(), handoverToHandle, extras, getCurrentUserHandle(), null /* originalIntent */); extras, getCurrentUserHandle(), null /* originalIntent */, null /* callingPackage */); if (handoverToCall == null) { handoverFromCall.sendCallEvent(android.telecom.Call.EVENT_HANDOVER_FAILED, null); return; Loading
src/com/android/server/telecom/TelecomServiceImpl.java +1 −1 Original line number Diff line number Diff line Loading @@ -1657,7 +1657,7 @@ public class TelecomServiceImpl { try { Log.i(this, "handleCallIntent: handling call intent"); mCallIntentProcessorAdapter.processOutgoingCallIntent(mContext, mCallsManager, intent); mCallsManager, intent, null /* callingPackage */); } finally { Binder.restoreCallingIdentity(token); } Loading
src/com/android/server/telecom/components/UserCallIntentProcessor.java +5 −3 Original line number Diff line number Diff line Loading @@ -159,7 +159,7 @@ public class UserCallIntentProcessor { // Save the user handle of current user before forwarding the intent to primary user. intent.putExtra(CallIntentProcessor.KEY_INITIATING_USER, mUserHandle); sendIntentToDestination(intent, isLocalInvocation); sendIntentToDestination(intent, isLocalInvocation, callingPackageName); } private boolean isDefaultOrSystemDialer(String callingPackageName) { Loading Loading @@ -193,7 +193,8 @@ public class UserCallIntentProcessor { * If the caller is local to the Telecom service, we send the intent to Telecom without * sending it through TelecomServiceImpl. */ private boolean sendIntentToDestination(Intent intent, boolean isLocalInvocation) { private boolean sendIntentToDestination(Intent intent, boolean isLocalInvocation, String callingPackage) { intent.putExtra(CallIntentProcessor.KEY_IS_INCOMING_CALL, false); intent.setFlags(Intent.FLAG_RECEIVER_FOREGROUND); if (isLocalInvocation) { Loading @@ -202,7 +203,8 @@ public class UserCallIntentProcessor { // TODO: We should not be using an intent here; this whole flows needs cleanup. Log.i(this, "sendIntentToDestination: send intent to Telecom directly."); synchronized (TelecomSystem.getInstance().getLock()) { TelecomSystem.getInstance().getCallIntentProcessor().processIntent(intent); TelecomSystem.getInstance().getCallIntentProcessor().processIntent(intent, callingPackage); } } else { // We're calling from the UserCallActivity, so the TelecomSystem is not in the same Loading