Loading src/com/android/server/telecom/InCallController.java +45 −31 Original line number Diff line number Diff line Loading @@ -45,7 +45,6 @@ import android.os.RemoteException; import android.os.Trace; import android.os.UserHandle; import android.os.UserManager; import android.provider.DeviceConfig; import android.telecom.CallAudioState; import android.telecom.ConnectionService; import android.telecom.InCallService; Loading Loading @@ -282,7 +281,16 @@ public class InCallController extends CallsManagerListenerBase implements @Override public int connect(Call call) { if (mIsConnected) { Log.addEvent(call, LogUtils.Events.INFO, "Already connected, ignoring request."); Log.addEvent(call, LogUtils.Events.INFO, "Already connected, ignoring request: " + mInCallServiceInfo); if (call != null) { // Track the call if we don't already know about it. addCall(call); // Notify this new added call sendCallToService(call, mInCallServiceInfo, mInCallServices.get(mInCallServiceInfo)); } return CONNECTION_SUCCEEDED; } Loading Loading @@ -1864,11 +1872,29 @@ public class InCallController extends CallsManagerListenerBase implements "calls", calls.size(), info.getComponentName()); int numCallsSent = 0; for (Call call : calls) { numCallsSent += sendCallToService(call, info, inCallService); } try { inCallService.onCallAudioStateChanged(mCallsManager.getAudioState()); inCallService.onCanAddCallChanged(mCallsManager.canAddCall()); } catch (RemoteException ignored) { } // Don't complete the binding future for non-ui incalls if (info.getType() != IN_CALL_SERVICE_TYPE_NON_UI && !mBindingFuture.isDone()) { mBindingFuture.complete(true); } Log.i(this, "%s calls sent to InCallService.", numCallsSent); return true; } private int sendCallToService(Call call, InCallServiceInfo info, IInCallService inCallService) { try { if ((call.isSelfManaged() && (!info.isSelfManagedCallsSupported() || !call.visibleToInCallService())) || (call.isExternalCall() && !info.isExternalCallsSupported())) { continue; return 0; } // Only send the RTT call if it's a UI in-call service Loading @@ -1879,7 +1905,6 @@ public class InCallController extends CallsManagerListenerBase implements // Track the call if we don't already know about it. addCall(call); numCallsSent += 1; ParcelableCall parcelableCall = ParcelableCallUtils.toParcelableCall( call, true /* includeVideoProvider */, Loading @@ -1890,21 +1915,10 @@ public class InCallController extends CallsManagerListenerBase implements info.getType() == IN_CALL_SERVICE_TYPE_NON_UI); inCallService.addCall(sanitizeParcelableCallForService(info, parcelableCall)); updateCallTracking(call, info, true /* isAdd */); return 1; } catch (RemoteException ignored) { } } try { inCallService.onCallAudioStateChanged(mCallsManager.getAudioState()); inCallService.onCanAddCallChanged(mCallsManager.canAddCall()); } catch (RemoteException ignored) { } // Don't complete the binding future for non-ui incalls if (info.getType() != IN_CALL_SERVICE_TYPE_NON_UI) { mBindingFuture.complete(true); } Log.i(this, "%s calls sent to InCallService.", numCallsSent); return true; return 0; } /** Loading Loading
src/com/android/server/telecom/InCallController.java +45 −31 Original line number Diff line number Diff line Loading @@ -45,7 +45,6 @@ import android.os.RemoteException; import android.os.Trace; import android.os.UserHandle; import android.os.UserManager; import android.provider.DeviceConfig; import android.telecom.CallAudioState; import android.telecom.ConnectionService; import android.telecom.InCallService; Loading Loading @@ -282,7 +281,16 @@ public class InCallController extends CallsManagerListenerBase implements @Override public int connect(Call call) { if (mIsConnected) { Log.addEvent(call, LogUtils.Events.INFO, "Already connected, ignoring request."); Log.addEvent(call, LogUtils.Events.INFO, "Already connected, ignoring request: " + mInCallServiceInfo); if (call != null) { // Track the call if we don't already know about it. addCall(call); // Notify this new added call sendCallToService(call, mInCallServiceInfo, mInCallServices.get(mInCallServiceInfo)); } return CONNECTION_SUCCEEDED; } Loading Loading @@ -1864,11 +1872,29 @@ public class InCallController extends CallsManagerListenerBase implements "calls", calls.size(), info.getComponentName()); int numCallsSent = 0; for (Call call : calls) { numCallsSent += sendCallToService(call, info, inCallService); } try { inCallService.onCallAudioStateChanged(mCallsManager.getAudioState()); inCallService.onCanAddCallChanged(mCallsManager.canAddCall()); } catch (RemoteException ignored) { } // Don't complete the binding future for non-ui incalls if (info.getType() != IN_CALL_SERVICE_TYPE_NON_UI && !mBindingFuture.isDone()) { mBindingFuture.complete(true); } Log.i(this, "%s calls sent to InCallService.", numCallsSent); return true; } private int sendCallToService(Call call, InCallServiceInfo info, IInCallService inCallService) { try { if ((call.isSelfManaged() && (!info.isSelfManagedCallsSupported() || !call.visibleToInCallService())) || (call.isExternalCall() && !info.isExternalCallsSupported())) { continue; return 0; } // Only send the RTT call if it's a UI in-call service Loading @@ -1879,7 +1905,6 @@ public class InCallController extends CallsManagerListenerBase implements // Track the call if we don't already know about it. addCall(call); numCallsSent += 1; ParcelableCall parcelableCall = ParcelableCallUtils.toParcelableCall( call, true /* includeVideoProvider */, Loading @@ -1890,21 +1915,10 @@ public class InCallController extends CallsManagerListenerBase implements info.getType() == IN_CALL_SERVICE_TYPE_NON_UI); inCallService.addCall(sanitizeParcelableCallForService(info, parcelableCall)); updateCallTracking(call, info, true /* isAdd */); return 1; } catch (RemoteException ignored) { } } try { inCallService.onCallAudioStateChanged(mCallsManager.getAudioState()); inCallService.onCanAddCallChanged(mCallsManager.canAddCall()); } catch (RemoteException ignored) { } // Don't complete the binding future for non-ui incalls if (info.getType() != IN_CALL_SERVICE_TYPE_NON_UI) { mBindingFuture.complete(true); } Log.i(this, "%s calls sent to InCallService.", numCallsSent); return true; return 0; } /** Loading