commit | c31c450f5dd1436189fc4ac7a1ae26ef2fb19798 | [log] [tgz] |
---|---|---|
author | Youngsang Cho <youngsang@google.com> | Tue May 13 21:13:47 2014 +0900 |
committer | Youngsang Cho <youngsang@google.com> | Tue May 13 21:28:55 2014 +0900 |
tree | a7a19865dc2a43e4289c534eb182d6cae3c9dc62 | |
parent | 59618a1890e4b8691f2a482fbf392f4a19b711be [diff] |
Fix NPE in TvInputService and TvView Bug: 14781233, Bug: 14629185 Change-Id: I8511674f4f3864b3deaa58f4c95b9c91e68f49f4
diff --git a/core/java/android/tv/TvInputService.java b/core/java/android/tv/TvInputService.java index 1d6298d..eeb738d 100644 --- a/core/java/android/tv/TvInputService.java +++ b/core/java/android/tv/TvInputService.java
@@ -489,7 +489,7 @@ } } } - if (mOverlayView == null) { + if (mOverlayView == null || !mOverlayView.isAttachedToWindow()) { return Session.DISPATCH_NOT_HANDLED; } if (!mOverlayView.hasWindowFocus()) {
diff --git a/core/java/android/tv/TvView.java b/core/java/android/tv/TvView.java index 80501e8..7eaa86b 100644 --- a/core/java/android/tv/TvView.java +++ b/core/java/android/tv/TvView.java
@@ -347,7 +347,9 @@ public void onSessionCreated(Session session) { if (this != mSessionCallback) { // This callback is obsolete. - session.release(); + if (session != null) { + session.release(); + } return; } mSession = session;