diff options
author | Tyler Gunn <tgunn@google.com> | 2015-05-28 15:47:06 -0700 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2015-10-06 03:27:14 -0600 |
commit | 4dda7bbd0feee1ec8ec5ff35790d1f2a25825c63 (patch) | |
tree | 1ac896f761743ddb309dcf950a20bacb129b489f /telecomm | |
parent | fe2ae4daae9a12f716c9c46f5320676fb19f5c6a (diff) | |
download | frameworks_base-4dda7bbd0feee1ec8ec5ff35790d1f2a25825c63.zip frameworks_base-4dda7bbd0feee1ec8ec5ff35790d1f2a25825c63.tar.gz frameworks_base-4dda7bbd0feee1ec8ec5ff35790d1f2a25825c63.tar.bz2 |
Fix NullPointerException in VideoCallImpl.
There were instances of NPEs due to a null mHandler in the VideoCallImpl.
Traced the problem down to InCallService implementations which do not
register a VideoCall Callback (e.g. gearhead).
Added null checks for uses of mHandler.
Bug: 21474154
Change-Id: I44dffde5e46529cc62912d417ad23c7b7dd1a1ba
Diffstat (limited to 'telecomm')
-rw-r--r-- | telecomm/java/android/telecom/VideoCallImpl.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/telecomm/java/android/telecom/VideoCallImpl.java b/telecomm/java/android/telecom/VideoCallImpl.java index c8072d1..93484cd 100644 --- a/telecomm/java/android/telecom/VideoCallImpl.java +++ b/telecomm/java/android/telecom/VideoCallImpl.java @@ -57,13 +57,20 @@ public class VideoCallImpl extends VideoCall { private final class VideoCallListenerBinder extends IVideoCallback.Stub { @Override public void receiveSessionModifyRequest(VideoProfile videoProfile) { + if (mHandler == null) { + return; + } mHandler.obtainMessage(MessageHandler.MSG_RECEIVE_SESSION_MODIFY_REQUEST, videoProfile).sendToTarget(); + } @Override public void receiveSessionModifyResponse(int status, VideoProfile requestProfile, VideoProfile responseProfile) { + if (mHandler == null) { + return; + } SomeArgs args = SomeArgs.obtain(); args.arg1 = status; args.arg2 = requestProfile; @@ -74,12 +81,18 @@ public class VideoCallImpl extends VideoCall { @Override public void handleCallSessionEvent(int event) { + if (mHandler == null) { + return; + } mHandler.obtainMessage(MessageHandler.MSG_HANDLE_CALL_SESSION_EVENT, event) .sendToTarget(); } @Override public void changePeerDimensions(int width, int height) { + if (mHandler == null) { + return; + } SomeArgs args = SomeArgs.obtain(); args.arg1 = width; args.arg2 = height; @@ -88,18 +101,27 @@ public class VideoCallImpl extends VideoCall { @Override public void changeVideoQuality(int videoQuality) { + if (mHandler == null) { + return; + } mHandler.obtainMessage(MessageHandler.MSG_CHANGE_VIDEO_QUALITY, videoQuality, 0) .sendToTarget(); } @Override public void changeCallDataUsage(long dataUsage) { + if (mHandler == null) { + return; + } mHandler.obtainMessage(MessageHandler.MSG_CHANGE_CALL_DATA_USAGE, dataUsage) .sendToTarget(); } @Override public void changeCameraCapabilities(VideoProfile.CameraCapabilities cameraCapabilities) { + if (mHandler == null) { + return; + } mHandler.obtainMessage(MessageHandler.MSG_CHANGE_CAMERA_CAPABILITIES, cameraCapabilities).sendToTarget(); } |