diff options
author | Nivedita Sarkar <nsarkar@codeaurora.org> | 2014-11-25 14:37:15 -0800 |
---|---|---|
committer | Arne Coucheron <arco68@gmail.com> | 2014-12-13 01:45:56 +0100 |
commit | 97982cd3f3a8508e159ed70fd4b1c6a9a2fa3ac2 (patch) | |
tree | 79d79a53f7e83375f435aa66fa1c5bb671737848 /src/com/android/incallui/InCallPresenter.java | |
parent | 0d4516c62121b077698d8553edbcf145ddcf5d93 (diff) | |
download | packages_apps_InCallUI-97982cd3f3a8508e159ed70fd4b1c6a9a2fa3ac2.tar.gz packages_apps_InCallUI-97982cd3f3a8508e159ed70fd4b1c6a9a2fa3ac2.tar.bz2 packages_apps_InCallUI-97982cd3f3a8508e159ed70fd4b1c6a9a2fa3ac2.zip |
Add null check for InCallActivity in setInCallAllowsOrientationChange
- In some cases, this API is called when InCallActivity is null.
This causes a null pointer exception. Fix is to add a null check.
Change-Id: I92f37084b4d00c4a6de83143415dc67769b03ad2
CRs-Fixed: 762840
Diffstat (limited to 'src/com/android/incallui/InCallPresenter.java')
-rw-r--r-- | src/com/android/incallui/InCallPresenter.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/com/android/incallui/InCallPresenter.java b/src/com/android/incallui/InCallPresenter.java index 655e79a9..7d96025c 100644 --- a/src/com/android/incallui/InCallPresenter.java +++ b/src/com/android/incallui/InCallPresenter.java @@ -1189,6 +1189,11 @@ public class InCallPresenter implements CallList.Listener, InCallPhoneListener { * and landscape. {@Code False} if the in-call UI should be locked in portrait. */ public void setInCallAllowsOrientationChange(boolean allowOrientationChange) { + if (mInCallActivity == null) { + Log.e(this, "InCallActivity is null. Can't set requested orientation."); + return; + } + if (!allowOrientationChange) { mInCallActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_NOSENSOR); } else { |