Loading src/com/android/server/telecom/Call.java +6 −0 Original line number Diff line number Diff line Loading @@ -136,6 +136,7 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, void onPhoneAccountChanged(Call call); void onConferenceableCallsChanged(Call call); void onConferenceStateChanged(Call call, boolean isConference); void onCdmaConferenceSwap(Call call); boolean onCanceledViaNewOutgoingCallBroadcast(Call call, long disconnectionTimeout); void onHoldToneRequested(Call call); void onCallHoldFailed(Call call); Loading Loading @@ -208,6 +209,8 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, @Override public void onConferenceStateChanged(Call call, boolean isConference) {} @Override public void onCdmaConferenceSwap(Call call) {} @Override public boolean onCanceledViaNewOutgoingCallBroadcast(Call call, long disconnectionTimeout) { return false; } Loading Loading @@ -2421,6 +2424,9 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, mConferenceLevelActiveCall = null; break; } for (Listener l : mListeners) { l.onCdmaConferenceSwap(this); } } } Loading src/com/android/server/telecom/CallsManager.java +9 −0 Original line number Diff line number Diff line Loading @@ -165,6 +165,7 @@ public class CallsManager extends Call.ListenerBase void onDisconnectedTonePlaying(boolean isTonePlaying); void onConnectionTimeChanged(Call call); void onConferenceStateChanged(Call call, boolean isConference); void onCdmaConferenceSwap(Call call); } /** Interface used to define the action which is executed delay under some condition. */ Loading Loading @@ -927,6 +928,14 @@ public class CallsManager extends Call.ListenerBase } } @Override public void onCdmaConferenceSwap(Call call) { // SWAP was executed on a CDMA conference for (CallsManagerListener listener : mListeners) { listener.onCdmaConferenceSwap(call); } } @Override public void onIsVoipAudioModeChanged(Call call) { for (CallsManagerListener listener : mListeners) { Loading src/com/android/server/telecom/CallsManagerListenerBase.java +4 −0 Original line number Diff line number Diff line Loading @@ -100,4 +100,8 @@ public class CallsManagerListenerBase implements CallsManager.CallsManagerListen @Override public void onConferenceStateChanged(Call call, boolean isConference) { } @Override public void onCdmaConferenceSwap(Call call) { } } src/com/android/server/telecom/InCallController.java +30 −6 Original line number Diff line number Diff line Loading @@ -865,7 +865,7 @@ public class InCallController extends CallsManagerListenerBase { info.isExternalCallsSupported(), includeRttCall, info.getType() == IN_CALL_SERVICE_TYPE_SYSTEM_UI); try { inCallService.addCall(parcelableCall); inCallService.addCall(sanitizeParcelableCallForService(info, parcelableCall)); } catch (RemoteException ignored) { } } Loading Loading @@ -929,7 +929,7 @@ public class InCallController extends CallsManagerListenerBase { info.isExternalCallsSupported(), includeRttCall, info.getType() == IN_CALL_SERVICE_TYPE_SYSTEM_UI); try { inCallService.addCall(parcelableCall); inCallService.addCall(sanitizeParcelableCallForService(info, parcelableCall)); } catch (RemoteException ignored) { } } Loading Loading @@ -961,7 +961,8 @@ public class InCallController extends CallsManagerListenerBase { ); try { inCallService.updateCall(parcelableCall); inCallService.updateCall( sanitizeParcelableCallForService(info, parcelableCall)); } catch (RemoteException ignored) { } } Loading Loading @@ -1046,6 +1047,12 @@ public class InCallController extends CallsManagerListenerBase { updateCall(call); } @Override public void onCdmaConferenceSwap(Call call) { Log.d(this, "onCdmaConferenceSwap %s", call); updateCall(call); } void bringToForeground(boolean showDialpad) { if (!mInCallServices.isEmpty()) { for (IInCallService inCallService : mInCallServices.values()) { Loading Loading @@ -1446,13 +1453,14 @@ public class InCallController extends CallsManagerListenerBase { // Track the call if we don't already know about it. addCall(call); numCallsSent += 1; inCallService.addCall(ParcelableCallUtils.toParcelableCall( ParcelableCall parcelableCall = ParcelableCallUtils.toParcelableCall( call, true /* includeVideoProvider */, mCallsManager.getPhoneAccountRegistrar(), info.isExternalCallsSupported(), includeRttCall, info.getType() == IN_CALL_SERVICE_TYPE_SYSTEM_UI)); info.getType() == IN_CALL_SERVICE_TYPE_SYSTEM_UI); inCallService.addCall(sanitizeParcelableCallForService(info, parcelableCall)); } catch (RemoteException ignored) { } } Loading Loading @@ -1522,7 +1530,8 @@ public class InCallController extends CallsManagerListenerBase { componentsUpdated.add(componentName); try { inCallService.updateCall(parcelableCall); inCallService.updateCall( sanitizeParcelableCallForService(info, parcelableCall)); } catch (RemoteException ignored) { } } Loading Loading @@ -1654,6 +1663,21 @@ public class InCallController extends CallsManagerListenerBase { return childCalls; } private ParcelableCall sanitizeParcelableCallForService( InCallServiceInfo info, ParcelableCall parcelableCall) { ParcelableCall.ParcelableCallBuilder builder = ParcelableCall.ParcelableCallBuilder.fromParcelableCall(parcelableCall); // Check for contacts permission. If it's not there, remove the contactsDisplayName. PackageManager pm = mContext.getPackageManager(); if (pm.checkPermission(Manifest.permission.READ_CONTACTS, info.getComponentName().getPackageName()) != PackageManager.PERMISSION_GRANTED) { builder.setContactDisplayName(null); } // TODO: move all the other service-specific sanitizations in here return builder.createParcelableCall(); } @VisibleForTesting public Handler getHandler() { return mHandler; Loading src/com/android/server/telecom/ParcelableCallUtils.java +69 −62 Original line number Diff line number Diff line Loading @@ -29,14 +29,10 @@ import android.telecom.ParcelableRttCall; import android.telecom.TelecomManager; import android.text.TextUtils; import com.android.internal.annotations.VisibleForTesting; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; /** * Utilities dealing with {@link ParcelableCall}. Loading Loading @@ -224,6 +220,11 @@ public class ParcelableCallUtils { callDirection = DIRECTION_OUTGOING; } String activeChildCallId = null; if (call.getConferenceLevelActiveCall() != null) { activeChildCallId = call.getConferenceLevelActiveCall().getId(); } Bundle extras; if (isForSystemDialer) { extras = call.getExtras(); Loading @@ -231,35 +232,38 @@ public class ParcelableCallUtils { extras = sanitizeExtras(call.getExtras()); } return new ParcelableCall( call.getId(), state, call.getDisconnectCause(), call.getCannedSmsResponses(), capabilities, properties, supportedAudioRoutes, connectTimeMillis, handle, call.getHandlePresentation(), callerDisplayName, call.getCallerDisplayNamePresentation(), call.getGatewayInfo(), call.getTargetPhoneAccount(), includeVideoProvider, includeVideoProvider ? call.getVideoProvider() : null, includeRttCall, rttCall, parentCallId, childCallIds, call.getStatusHints(), call.getVideoState(), conferenceableCallIds, call.getIntentExtras(), extras, call.getCreationTimeMillis(), callDirection, call.getCallerNumberVerificationStatus()); return new ParcelableCall.ParcelableCallBuilder() .setId(call.getId()) .setState(state) .setDisconnectCause(call.getDisconnectCause()) .setCannedSmsResponses(call.getCannedSmsResponses()) .setCapabilities(capabilities) .setProperties(properties) .setSupportedAudioRoutes(supportedAudioRoutes) .setConnectTimeMillis(connectTimeMillis) .setHandle(handle) .setHandlePresentation(call.getHandlePresentation()) .setCallerDisplayName(callerDisplayName) .setCallerDisplayNamePresentation(call.getCallerDisplayNamePresentation()) .setGatewayInfo(call.getGatewayInfo()) .setAccountHandle(call.getTargetPhoneAccount()) .setIsVideoCallProviderChanged(includeVideoProvider) .setVideoCallProvider(includeVideoProvider ? call.getVideoProvider() : null) .setIsRttCallChanged(includeRttCall) .setRttCall(rttCall) .setParentCallId(parentCallId) .setChildCallIds(childCallIds) .setStatusHints(call.getStatusHints()) .setVideoState(call.getVideoState()) .setConferenceableCallIds(conferenceableCallIds) .setIntentExtras(call.getIntentExtras()) .setExtras(extras) .setCreationTimeMillis(call.getCreationTimeMillis()) .setCallDirection(callDirection) .setCallerNumberVerificationStatus(call.getCallerNumberVerificationStatus()) .setContactDisplayName(call.getName()) .setActiveChildCallId(activeChildCallId) .createParcelableCall(); } /** Loading Loading @@ -303,35 +307,38 @@ public class ParcelableCallUtils { callExtras = new Bundle(); } return new ParcelableCall( call.getId(), getParcelableState(call, false /* supportsExternalCalls */), new DisconnectCause(DisconnectCause.UNKNOWN), null, /* cannedSmsResponses */ 0, /* capabilities */ 0, /* properties */ 0, /* supportedAudioRoutes */ call.getConnectTimeMillis(), handle, call.getHandlePresentation(), null, /* callerDisplayName */ 0 /* callerDisplayNamePresentation */, null, /* gatewayInfo */ null, /* targetPhoneAccount */ false, /* includeVideoProvider */ null, /* videoProvider */ false, /* includeRttCall */ null, /* rttCall */ null, /* parentCallId */ null, /* childCallIds */ null, /* statusHints */ 0, /* videoState */ Collections.emptyList(), /* conferenceableCallIds */ null, /* intentExtras */ callExtras, /* callExtras */ call.getCreationTimeMillis(), callDirection, call.getCallerNumberVerificationStatus()); return new ParcelableCall.ParcelableCallBuilder() .setId(call.getId()) .setState(getParcelableState(call, false /* supportsExternalCalls */)) .setDisconnectCause(new DisconnectCause(DisconnectCause.UNKNOWN)) .setCannedSmsResponses(null) .setCapabilities(0) .setProperties(0) .setSupportedAudioRoutes(0) .setConnectTimeMillis(call.getConnectTimeMillis()) .setHandle(handle) .setHandlePresentation(call.getHandlePresentation()) .setCallerDisplayName(null) .setCallerDisplayNamePresentation(0) .setGatewayInfo(null) .setAccountHandle(null) .setIsVideoCallProviderChanged(false) .setVideoCallProvider(null) .setIsRttCallChanged(false) .setRttCall(null) .setParentCallId(null) .setChildCallIds(null) .setStatusHints(null) .setVideoState(0) .setConferenceableCallIds(Collections.emptyList()) .setIntentExtras(null) .setExtras(callExtras) .setCreationTimeMillis(call.getCreationTimeMillis()) .setCallDirection(callDirection) .setCallerNumberVerificationStatus(call.getCallerNumberVerificationStatus()) .setContactDisplayName(null) .setActiveChildCallId(null) .createParcelableCall(); } /** Loading Loading
src/com/android/server/telecom/Call.java +6 −0 Original line number Diff line number Diff line Loading @@ -136,6 +136,7 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, void onPhoneAccountChanged(Call call); void onConferenceableCallsChanged(Call call); void onConferenceStateChanged(Call call, boolean isConference); void onCdmaConferenceSwap(Call call); boolean onCanceledViaNewOutgoingCallBroadcast(Call call, long disconnectionTimeout); void onHoldToneRequested(Call call); void onCallHoldFailed(Call call); Loading Loading @@ -208,6 +209,8 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, @Override public void onConferenceStateChanged(Call call, boolean isConference) {} @Override public void onCdmaConferenceSwap(Call call) {} @Override public boolean onCanceledViaNewOutgoingCallBroadcast(Call call, long disconnectionTimeout) { return false; } Loading Loading @@ -2421,6 +2424,9 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, mConferenceLevelActiveCall = null; break; } for (Listener l : mListeners) { l.onCdmaConferenceSwap(this); } } } Loading
src/com/android/server/telecom/CallsManager.java +9 −0 Original line number Diff line number Diff line Loading @@ -165,6 +165,7 @@ public class CallsManager extends Call.ListenerBase void onDisconnectedTonePlaying(boolean isTonePlaying); void onConnectionTimeChanged(Call call); void onConferenceStateChanged(Call call, boolean isConference); void onCdmaConferenceSwap(Call call); } /** Interface used to define the action which is executed delay under some condition. */ Loading Loading @@ -927,6 +928,14 @@ public class CallsManager extends Call.ListenerBase } } @Override public void onCdmaConferenceSwap(Call call) { // SWAP was executed on a CDMA conference for (CallsManagerListener listener : mListeners) { listener.onCdmaConferenceSwap(call); } } @Override public void onIsVoipAudioModeChanged(Call call) { for (CallsManagerListener listener : mListeners) { Loading
src/com/android/server/telecom/CallsManagerListenerBase.java +4 −0 Original line number Diff line number Diff line Loading @@ -100,4 +100,8 @@ public class CallsManagerListenerBase implements CallsManager.CallsManagerListen @Override public void onConferenceStateChanged(Call call, boolean isConference) { } @Override public void onCdmaConferenceSwap(Call call) { } }
src/com/android/server/telecom/InCallController.java +30 −6 Original line number Diff line number Diff line Loading @@ -865,7 +865,7 @@ public class InCallController extends CallsManagerListenerBase { info.isExternalCallsSupported(), includeRttCall, info.getType() == IN_CALL_SERVICE_TYPE_SYSTEM_UI); try { inCallService.addCall(parcelableCall); inCallService.addCall(sanitizeParcelableCallForService(info, parcelableCall)); } catch (RemoteException ignored) { } } Loading Loading @@ -929,7 +929,7 @@ public class InCallController extends CallsManagerListenerBase { info.isExternalCallsSupported(), includeRttCall, info.getType() == IN_CALL_SERVICE_TYPE_SYSTEM_UI); try { inCallService.addCall(parcelableCall); inCallService.addCall(sanitizeParcelableCallForService(info, parcelableCall)); } catch (RemoteException ignored) { } } Loading Loading @@ -961,7 +961,8 @@ public class InCallController extends CallsManagerListenerBase { ); try { inCallService.updateCall(parcelableCall); inCallService.updateCall( sanitizeParcelableCallForService(info, parcelableCall)); } catch (RemoteException ignored) { } } Loading Loading @@ -1046,6 +1047,12 @@ public class InCallController extends CallsManagerListenerBase { updateCall(call); } @Override public void onCdmaConferenceSwap(Call call) { Log.d(this, "onCdmaConferenceSwap %s", call); updateCall(call); } void bringToForeground(boolean showDialpad) { if (!mInCallServices.isEmpty()) { for (IInCallService inCallService : mInCallServices.values()) { Loading Loading @@ -1446,13 +1453,14 @@ public class InCallController extends CallsManagerListenerBase { // Track the call if we don't already know about it. addCall(call); numCallsSent += 1; inCallService.addCall(ParcelableCallUtils.toParcelableCall( ParcelableCall parcelableCall = ParcelableCallUtils.toParcelableCall( call, true /* includeVideoProvider */, mCallsManager.getPhoneAccountRegistrar(), info.isExternalCallsSupported(), includeRttCall, info.getType() == IN_CALL_SERVICE_TYPE_SYSTEM_UI)); info.getType() == IN_CALL_SERVICE_TYPE_SYSTEM_UI); inCallService.addCall(sanitizeParcelableCallForService(info, parcelableCall)); } catch (RemoteException ignored) { } } Loading Loading @@ -1522,7 +1530,8 @@ public class InCallController extends CallsManagerListenerBase { componentsUpdated.add(componentName); try { inCallService.updateCall(parcelableCall); inCallService.updateCall( sanitizeParcelableCallForService(info, parcelableCall)); } catch (RemoteException ignored) { } } Loading Loading @@ -1654,6 +1663,21 @@ public class InCallController extends CallsManagerListenerBase { return childCalls; } private ParcelableCall sanitizeParcelableCallForService( InCallServiceInfo info, ParcelableCall parcelableCall) { ParcelableCall.ParcelableCallBuilder builder = ParcelableCall.ParcelableCallBuilder.fromParcelableCall(parcelableCall); // Check for contacts permission. If it's not there, remove the contactsDisplayName. PackageManager pm = mContext.getPackageManager(); if (pm.checkPermission(Manifest.permission.READ_CONTACTS, info.getComponentName().getPackageName()) != PackageManager.PERMISSION_GRANTED) { builder.setContactDisplayName(null); } // TODO: move all the other service-specific sanitizations in here return builder.createParcelableCall(); } @VisibleForTesting public Handler getHandler() { return mHandler; Loading
src/com/android/server/telecom/ParcelableCallUtils.java +69 −62 Original line number Diff line number Diff line Loading @@ -29,14 +29,10 @@ import android.telecom.ParcelableRttCall; import android.telecom.TelecomManager; import android.text.TextUtils; import com.android.internal.annotations.VisibleForTesting; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; /** * Utilities dealing with {@link ParcelableCall}. Loading Loading @@ -224,6 +220,11 @@ public class ParcelableCallUtils { callDirection = DIRECTION_OUTGOING; } String activeChildCallId = null; if (call.getConferenceLevelActiveCall() != null) { activeChildCallId = call.getConferenceLevelActiveCall().getId(); } Bundle extras; if (isForSystemDialer) { extras = call.getExtras(); Loading @@ -231,35 +232,38 @@ public class ParcelableCallUtils { extras = sanitizeExtras(call.getExtras()); } return new ParcelableCall( call.getId(), state, call.getDisconnectCause(), call.getCannedSmsResponses(), capabilities, properties, supportedAudioRoutes, connectTimeMillis, handle, call.getHandlePresentation(), callerDisplayName, call.getCallerDisplayNamePresentation(), call.getGatewayInfo(), call.getTargetPhoneAccount(), includeVideoProvider, includeVideoProvider ? call.getVideoProvider() : null, includeRttCall, rttCall, parentCallId, childCallIds, call.getStatusHints(), call.getVideoState(), conferenceableCallIds, call.getIntentExtras(), extras, call.getCreationTimeMillis(), callDirection, call.getCallerNumberVerificationStatus()); return new ParcelableCall.ParcelableCallBuilder() .setId(call.getId()) .setState(state) .setDisconnectCause(call.getDisconnectCause()) .setCannedSmsResponses(call.getCannedSmsResponses()) .setCapabilities(capabilities) .setProperties(properties) .setSupportedAudioRoutes(supportedAudioRoutes) .setConnectTimeMillis(connectTimeMillis) .setHandle(handle) .setHandlePresentation(call.getHandlePresentation()) .setCallerDisplayName(callerDisplayName) .setCallerDisplayNamePresentation(call.getCallerDisplayNamePresentation()) .setGatewayInfo(call.getGatewayInfo()) .setAccountHandle(call.getTargetPhoneAccount()) .setIsVideoCallProviderChanged(includeVideoProvider) .setVideoCallProvider(includeVideoProvider ? call.getVideoProvider() : null) .setIsRttCallChanged(includeRttCall) .setRttCall(rttCall) .setParentCallId(parentCallId) .setChildCallIds(childCallIds) .setStatusHints(call.getStatusHints()) .setVideoState(call.getVideoState()) .setConferenceableCallIds(conferenceableCallIds) .setIntentExtras(call.getIntentExtras()) .setExtras(extras) .setCreationTimeMillis(call.getCreationTimeMillis()) .setCallDirection(callDirection) .setCallerNumberVerificationStatus(call.getCallerNumberVerificationStatus()) .setContactDisplayName(call.getName()) .setActiveChildCallId(activeChildCallId) .createParcelableCall(); } /** Loading Loading @@ -303,35 +307,38 @@ public class ParcelableCallUtils { callExtras = new Bundle(); } return new ParcelableCall( call.getId(), getParcelableState(call, false /* supportsExternalCalls */), new DisconnectCause(DisconnectCause.UNKNOWN), null, /* cannedSmsResponses */ 0, /* capabilities */ 0, /* properties */ 0, /* supportedAudioRoutes */ call.getConnectTimeMillis(), handle, call.getHandlePresentation(), null, /* callerDisplayName */ 0 /* callerDisplayNamePresentation */, null, /* gatewayInfo */ null, /* targetPhoneAccount */ false, /* includeVideoProvider */ null, /* videoProvider */ false, /* includeRttCall */ null, /* rttCall */ null, /* parentCallId */ null, /* childCallIds */ null, /* statusHints */ 0, /* videoState */ Collections.emptyList(), /* conferenceableCallIds */ null, /* intentExtras */ callExtras, /* callExtras */ call.getCreationTimeMillis(), callDirection, call.getCallerNumberVerificationStatus()); return new ParcelableCall.ParcelableCallBuilder() .setId(call.getId()) .setState(getParcelableState(call, false /* supportsExternalCalls */)) .setDisconnectCause(new DisconnectCause(DisconnectCause.UNKNOWN)) .setCannedSmsResponses(null) .setCapabilities(0) .setProperties(0) .setSupportedAudioRoutes(0) .setConnectTimeMillis(call.getConnectTimeMillis()) .setHandle(handle) .setHandlePresentation(call.getHandlePresentation()) .setCallerDisplayName(null) .setCallerDisplayNamePresentation(0) .setGatewayInfo(null) .setAccountHandle(null) .setIsVideoCallProviderChanged(false) .setVideoCallProvider(null) .setIsRttCallChanged(false) .setRttCall(null) .setParentCallId(null) .setChildCallIds(null) .setStatusHints(null) .setVideoState(0) .setConferenceableCallIds(Collections.emptyList()) .setIntentExtras(null) .setExtras(callExtras) .setCreationTimeMillis(call.getCreationTimeMillis()) .setCallDirection(callDirection) .setCallerNumberVerificationStatus(call.getCallerNumberVerificationStatus()) .setContactDisplayName(null) .setActiveChildCallId(null) .createParcelableCall(); } /** Loading