Loading src/java/com/android/ims/ImsCall.java +15 −1 Original line number Diff line number Diff line Loading @@ -3447,6 +3447,20 @@ public class ImsCall implements ICall { if (mCallProfile == null) { return false; } int radioTechnology = getRadioTechnology(); return radioTechnology == ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN; } } /** * Determines the radio access technology for the {@link ImsCall}. * @return The {@link ServiceState} {@code RIL_RADIO_TECHNOLOGY_*} code in use. */ public int getRadioTechnology() { synchronized(mLockObj) { if (mCallProfile == null) { return ServiceState.RIL_RADIO_TECHNOLOGY_UNKNOWN; } String callType = mCallProfile.getCallExtra(ImsCallProfile.EXTRA_CALL_RAT_TYPE); if (callType == null || callType.isEmpty()) { callType = mCallProfile.getCallExtra(ImsCallProfile.EXTRA_CALL_RAT_TYPE_ALT); Loading @@ -3461,7 +3475,7 @@ public class ImsCall implements ICall { radioTechnology = ServiceState.RIL_RADIO_TECHNOLOGY_UNKNOWN; } return radioTechnology == ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN; return radioTechnology; } } Loading src/java/com/android/ims/internal/ImsVideoCallProviderWrapper.java +30 −3 Original line number Diff line number Diff line Loading @@ -70,6 +70,7 @@ public class ImsVideoCallProviderWrapper extends Connection.VideoProvider { private VideoPauseTracker mVideoPauseTracker = new VideoPauseTracker(); private boolean mUseVideoPauseWorkaround = false; private int mCurrentVideoState; private boolean mIsVideoEnabled = true; private IBinder.DeathRecipient mDeathRecipient = new IBinder.DeathRecipient() { @Override Loading Loading @@ -151,8 +152,24 @@ public class ImsVideoCallProviderWrapper extends Connection.VideoProvider { public void handleMessage(Message msg) { SomeArgs args; switch (msg.what) { case MSG_RECEIVE_SESSION_MODIFY_REQUEST: receiveSessionModifyRequest((VideoProfile) msg.obj); case MSG_RECEIVE_SESSION_MODIFY_REQUEST: { VideoProfile videoProfile = (VideoProfile) msg.obj; if (!VideoProfile.isVideo(mCurrentVideoState) && VideoProfile.isVideo( videoProfile.getVideoState()) && !mIsVideoEnabled) { // Video is disabled, reject the request. Log.i(ImsVideoCallProviderWrapper.this, "receiveSessionModifyRequest: requestedVideoState=%s; rejecting " + "as video is disabled.", videoProfile.getVideoState()); try { mVideoCallProvider.sendSessionModifyResponse( new VideoProfile(VideoProfile.STATE_AUDIO_ONLY)); } catch (RemoteException e) { } return; } receiveSessionModifyRequest(videoProfile); } break; case MSG_RECEIVE_SESSION_MODIFY_RESPONSE: args = (SomeArgs) msg.obj; Loading Loading @@ -566,4 +583,14 @@ public class ImsVideoCallProviderWrapper extends Connection.VideoProvider { } mCurrentVideoState = newVideoState; } /** * Sets whether video is enabled locally or not. * Used to reject incoming video requests when video is disabled locally due to data being * disabled on a call where video calls are metered. * @param isVideoEnabled {@code true} if video is locally enabled, {@code false} otherwise. */ public void setIsVideoEnabled(boolean isVideoEnabled) { mIsVideoEnabled = isVideoEnabled; } } Loading
src/java/com/android/ims/ImsCall.java +15 −1 Original line number Diff line number Diff line Loading @@ -3447,6 +3447,20 @@ public class ImsCall implements ICall { if (mCallProfile == null) { return false; } int radioTechnology = getRadioTechnology(); return radioTechnology == ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN; } } /** * Determines the radio access technology for the {@link ImsCall}. * @return The {@link ServiceState} {@code RIL_RADIO_TECHNOLOGY_*} code in use. */ public int getRadioTechnology() { synchronized(mLockObj) { if (mCallProfile == null) { return ServiceState.RIL_RADIO_TECHNOLOGY_UNKNOWN; } String callType = mCallProfile.getCallExtra(ImsCallProfile.EXTRA_CALL_RAT_TYPE); if (callType == null || callType.isEmpty()) { callType = mCallProfile.getCallExtra(ImsCallProfile.EXTRA_CALL_RAT_TYPE_ALT); Loading @@ -3461,7 +3475,7 @@ public class ImsCall implements ICall { radioTechnology = ServiceState.RIL_RADIO_TECHNOLOGY_UNKNOWN; } return radioTechnology == ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN; return radioTechnology; } } Loading
src/java/com/android/ims/internal/ImsVideoCallProviderWrapper.java +30 −3 Original line number Diff line number Diff line Loading @@ -70,6 +70,7 @@ public class ImsVideoCallProviderWrapper extends Connection.VideoProvider { private VideoPauseTracker mVideoPauseTracker = new VideoPauseTracker(); private boolean mUseVideoPauseWorkaround = false; private int mCurrentVideoState; private boolean mIsVideoEnabled = true; private IBinder.DeathRecipient mDeathRecipient = new IBinder.DeathRecipient() { @Override Loading Loading @@ -151,8 +152,24 @@ public class ImsVideoCallProviderWrapper extends Connection.VideoProvider { public void handleMessage(Message msg) { SomeArgs args; switch (msg.what) { case MSG_RECEIVE_SESSION_MODIFY_REQUEST: receiveSessionModifyRequest((VideoProfile) msg.obj); case MSG_RECEIVE_SESSION_MODIFY_REQUEST: { VideoProfile videoProfile = (VideoProfile) msg.obj; if (!VideoProfile.isVideo(mCurrentVideoState) && VideoProfile.isVideo( videoProfile.getVideoState()) && !mIsVideoEnabled) { // Video is disabled, reject the request. Log.i(ImsVideoCallProviderWrapper.this, "receiveSessionModifyRequest: requestedVideoState=%s; rejecting " + "as video is disabled.", videoProfile.getVideoState()); try { mVideoCallProvider.sendSessionModifyResponse( new VideoProfile(VideoProfile.STATE_AUDIO_ONLY)); } catch (RemoteException e) { } return; } receiveSessionModifyRequest(videoProfile); } break; case MSG_RECEIVE_SESSION_MODIFY_RESPONSE: args = (SomeArgs) msg.obj; Loading Loading @@ -566,4 +583,14 @@ public class ImsVideoCallProviderWrapper extends Connection.VideoProvider { } mCurrentVideoState = newVideoState; } /** * Sets whether video is enabled locally or not. * Used to reject incoming video requests when video is disabled locally due to data being * disabled on a call where video calls are metered. * @param isVideoEnabled {@code true} if video is locally enabled, {@code false} otherwise. */ public void setIsVideoEnabled(boolean isVideoEnabled) { mIsVideoEnabled = isVideoEnabled; } }