Loading src/com/android/server/telecom/CallActivity.java +4 −10 Original line number Diff line number Diff line Loading @@ -124,13 +124,7 @@ public class CallActivity extends Activity { intent.putExtra(CallReceiver.KEY_IS_DEFAULT_DIALER, isDefaultDialer()); if (UserHandle.myUserId() == UserHandle.USER_OWNER) { Trace.beginSection("processOutgoingCallIntent"); CallReceiver.processOutgoingCallIntent(getApplicationContext(), intent); Trace.endSection(); } else { sendBroadcastToReceiver(intent, false /* isIncoming */); } sendBroadcastToReceiver(intent); } private boolean isDefaultDialer() { Loading Loading @@ -159,11 +153,11 @@ public class CallActivity extends Activity { /** * Trampolines the intent to the broadcast receiver that runs only as the primary user. */ private boolean sendBroadcastToReceiver(Intent intent, boolean incoming) { intent.putExtra(CallReceiver.KEY_IS_INCOMING_CALL, incoming); private boolean sendBroadcastToReceiver(Intent intent) { intent.putExtra(CallReceiver.KEY_IS_INCOMING_CALL, false); intent.setFlags(Intent.FLAG_RECEIVER_FOREGROUND); intent.setClass(this, CallReceiver.class); Log.d(this, "Sending broadcast as user to CallReceiver- isIncoming: %s", incoming); Log.d(this, "Sending broadcast as user to CallReceiver"); sendBroadcastAsUser(intent, UserHandle.OWNER); return true; } Loading src/com/android/server/telecom/CallReceiver.java +3 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ import android.content.Context; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.os.Trace; import android.os.UserHandle; import android.telecom.PhoneAccount; import android.telecom.PhoneAccountHandle; Loading Loading @@ -33,11 +34,13 @@ public class CallReceiver extends BroadcastReceiver { final boolean isUnknownCall = intent.getBooleanExtra(KEY_IS_UNKNOWN_CALL, false); Log.i(this, "onReceive - isUnknownCall: %s", isUnknownCall); Trace.beginSection("processNewCallCallIntent"); if (isUnknownCall) { processUnknownCallIntent(intent); } else { processOutgoingCallIntent(context, intent); } Trace.endSection(); } /** Loading src/com/android/server/telecom/InCallController.java +17 −7 Original line number Diff line number Diff line Loading @@ -39,8 +39,6 @@ import android.telecom.ParcelableCall; import android.telecom.TelecomManager; import android.util.ArrayMap; // TODO: Needed for move to system service: import com.android.internal.R; import com.android.internal.telecom.IInCallService; import com.android.internal.util.IndentingPrintWriter; Loading Loading @@ -154,7 +152,7 @@ public final class InCallController extends CallsManagerListenerBase { @Override public void onCallAdded(Call call) { if (mInCallServices.isEmpty()) { bind(); bind(call); } else { Log.i(this, "onCallAdded: %s", call); // Track the call if we don't already know about it. Loading Loading @@ -274,8 +272,10 @@ public final class InCallController extends CallsManagerListenerBase { /** * Binds to the in-call app if not already connected by binding directly to the saved * component name of the {@link IInCallService} implementation. * * @param call The newly added call that triggered the binding to the in-call services. */ private void bind() { private void bind(Call call) { ThreadUtil.checkOnMainThread(); if (mInCallServices.isEmpty()) { PackageManager packageManager = mContext.getPackageManager(); Loading Loading @@ -316,9 +316,19 @@ public final class InCallController extends CallsManagerListenerBase { Intent intent = new Intent(InCallService.SERVICE_INTERFACE); intent.setComponent(componentName); final int bindFlags = mInCallComponentName.equals(componentName) ? Context.BIND_AUTO_CREATE | Context.BIND_IMPORTANT : Context.BIND_AUTO_CREATE; final int bindFlags; if (mInCallComponentName.equals(componentName)) { bindFlags = Context.BIND_AUTO_CREATE | Context.BIND_IMPORTANT; if (!call.isIncoming()) { intent.putExtra(TelecomManager.EXTRA_OUTGOING_CALL_EXTRAS, call.getExtras()); intent.putExtra(TelecomManager.EXTRA_PHONE_ACCOUNT_HANDLE, call.getTargetPhoneAccount()); } } else { bindFlags = Context.BIND_AUTO_CREATE; } if (mContext.bindServiceAsUser(intent, inCallServiceConnection, bindFlags, UserHandle.CURRENT)) { mServiceConnections.put(componentName, inCallServiceConnection); Loading src/com/android/server/telecom/Timeouts.java +1 −1 Original line number Diff line number Diff line Loading @@ -60,6 +60,6 @@ public final class Timeouts { * in-call UI. */ public static long getNewOutgoingCallCancelMillis(ContentResolver contentResolver) { return get(contentResolver, "new_outgoing_call_cancel_ms", 200L); return get(contentResolver, "new_outgoing_call_cancel_ms", 300L); } } tests/src/com/android/server/telecom/testapps/CallServiceNotifier.java +2 −0 Original line number Diff line number Diff line Loading @@ -111,6 +111,7 @@ public class CallServiceNotifier { .setSubscriptionAddress(Uri.parse("tel:555-TEST")) .setCapabilities(PhoneAccount.CAPABILITY_CALL_PROVIDER) .setIcon(context, R.drawable.stat_sys_phone_call, Color.RED) .setHighlightColor(Color.RED) .setShortDescription("a short description for the call provider") .setSupportedUriSchemes(Arrays.asList("tel")) .build()); Loading @@ -125,6 +126,7 @@ public class CallServiceNotifier { .setCapabilities(PhoneAccount.CAPABILITY_CALL_PROVIDER | PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION) .setIcon(context, R.drawable.stat_sys_phone_call, Color.GREEN) .setHighlightColor(Color.GREEN) .setShortDescription("a short description for the sim subscription") .build()); Loading Loading
src/com/android/server/telecom/CallActivity.java +4 −10 Original line number Diff line number Diff line Loading @@ -124,13 +124,7 @@ public class CallActivity extends Activity { intent.putExtra(CallReceiver.KEY_IS_DEFAULT_DIALER, isDefaultDialer()); if (UserHandle.myUserId() == UserHandle.USER_OWNER) { Trace.beginSection("processOutgoingCallIntent"); CallReceiver.processOutgoingCallIntent(getApplicationContext(), intent); Trace.endSection(); } else { sendBroadcastToReceiver(intent, false /* isIncoming */); } sendBroadcastToReceiver(intent); } private boolean isDefaultDialer() { Loading Loading @@ -159,11 +153,11 @@ public class CallActivity extends Activity { /** * Trampolines the intent to the broadcast receiver that runs only as the primary user. */ private boolean sendBroadcastToReceiver(Intent intent, boolean incoming) { intent.putExtra(CallReceiver.KEY_IS_INCOMING_CALL, incoming); private boolean sendBroadcastToReceiver(Intent intent) { intent.putExtra(CallReceiver.KEY_IS_INCOMING_CALL, false); intent.setFlags(Intent.FLAG_RECEIVER_FOREGROUND); intent.setClass(this, CallReceiver.class); Log.d(this, "Sending broadcast as user to CallReceiver- isIncoming: %s", incoming); Log.d(this, "Sending broadcast as user to CallReceiver"); sendBroadcastAsUser(intent, UserHandle.OWNER); return true; } Loading
src/com/android/server/telecom/CallReceiver.java +3 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ import android.content.Context; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.os.Trace; import android.os.UserHandle; import android.telecom.PhoneAccount; import android.telecom.PhoneAccountHandle; Loading Loading @@ -33,11 +34,13 @@ public class CallReceiver extends BroadcastReceiver { final boolean isUnknownCall = intent.getBooleanExtra(KEY_IS_UNKNOWN_CALL, false); Log.i(this, "onReceive - isUnknownCall: %s", isUnknownCall); Trace.beginSection("processNewCallCallIntent"); if (isUnknownCall) { processUnknownCallIntent(intent); } else { processOutgoingCallIntent(context, intent); } Trace.endSection(); } /** Loading
src/com/android/server/telecom/InCallController.java +17 −7 Original line number Diff line number Diff line Loading @@ -39,8 +39,6 @@ import android.telecom.ParcelableCall; import android.telecom.TelecomManager; import android.util.ArrayMap; // TODO: Needed for move to system service: import com.android.internal.R; import com.android.internal.telecom.IInCallService; import com.android.internal.util.IndentingPrintWriter; Loading Loading @@ -154,7 +152,7 @@ public final class InCallController extends CallsManagerListenerBase { @Override public void onCallAdded(Call call) { if (mInCallServices.isEmpty()) { bind(); bind(call); } else { Log.i(this, "onCallAdded: %s", call); // Track the call if we don't already know about it. Loading Loading @@ -274,8 +272,10 @@ public final class InCallController extends CallsManagerListenerBase { /** * Binds to the in-call app if not already connected by binding directly to the saved * component name of the {@link IInCallService} implementation. * * @param call The newly added call that triggered the binding to the in-call services. */ private void bind() { private void bind(Call call) { ThreadUtil.checkOnMainThread(); if (mInCallServices.isEmpty()) { PackageManager packageManager = mContext.getPackageManager(); Loading Loading @@ -316,9 +316,19 @@ public final class InCallController extends CallsManagerListenerBase { Intent intent = new Intent(InCallService.SERVICE_INTERFACE); intent.setComponent(componentName); final int bindFlags = mInCallComponentName.equals(componentName) ? Context.BIND_AUTO_CREATE | Context.BIND_IMPORTANT : Context.BIND_AUTO_CREATE; final int bindFlags; if (mInCallComponentName.equals(componentName)) { bindFlags = Context.BIND_AUTO_CREATE | Context.BIND_IMPORTANT; if (!call.isIncoming()) { intent.putExtra(TelecomManager.EXTRA_OUTGOING_CALL_EXTRAS, call.getExtras()); intent.putExtra(TelecomManager.EXTRA_PHONE_ACCOUNT_HANDLE, call.getTargetPhoneAccount()); } } else { bindFlags = Context.BIND_AUTO_CREATE; } if (mContext.bindServiceAsUser(intent, inCallServiceConnection, bindFlags, UserHandle.CURRENT)) { mServiceConnections.put(componentName, inCallServiceConnection); Loading
src/com/android/server/telecom/Timeouts.java +1 −1 Original line number Diff line number Diff line Loading @@ -60,6 +60,6 @@ public final class Timeouts { * in-call UI. */ public static long getNewOutgoingCallCancelMillis(ContentResolver contentResolver) { return get(contentResolver, "new_outgoing_call_cancel_ms", 200L); return get(contentResolver, "new_outgoing_call_cancel_ms", 300L); } }
tests/src/com/android/server/telecom/testapps/CallServiceNotifier.java +2 −0 Original line number Diff line number Diff line Loading @@ -111,6 +111,7 @@ public class CallServiceNotifier { .setSubscriptionAddress(Uri.parse("tel:555-TEST")) .setCapabilities(PhoneAccount.CAPABILITY_CALL_PROVIDER) .setIcon(context, R.drawable.stat_sys_phone_call, Color.RED) .setHighlightColor(Color.RED) .setShortDescription("a short description for the call provider") .setSupportedUriSchemes(Arrays.asList("tel")) .build()); Loading @@ -125,6 +126,7 @@ public class CallServiceNotifier { .setCapabilities(PhoneAccount.CAPABILITY_CALL_PROVIDER | PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION) .setIcon(context, R.drawable.stat_sys_phone_call, Color.GREEN) .setHighlightColor(Color.GREEN) .setShortDescription("a short description for the sim subscription") .build()); Loading