Fix NPE in TvInputService and TvView
Bug: 14781233, Bug: 14629185 Change-Id: I8511674f4f3864b3deaa58f4c95b9c91e68f49f4
This commit is contained in:
@@ -489,7 +489,7 @@ public abstract class TvInputService extends Service {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mOverlayView == null) {
|
||||
if (mOverlayView == null || !mOverlayView.isAttachedToWindow()) {
|
||||
return Session.DISPATCH_NOT_HANDLED;
|
||||
}
|
||||
if (!mOverlayView.hasWindowFocus()) {
|
||||
|
||||
@@ -347,7 +347,9 @@ public class TvView extends SurfaceView {
|
||||
public void onSessionCreated(Session session) {
|
||||
if (this != mSessionCallback) {
|
||||
// This callback is obsolete.
|
||||
session.release();
|
||||
if (session != null) {
|
||||
session.release();
|
||||
}
|
||||
return;
|
||||
}
|
||||
mSession = session;
|
||||
|
||||
Reference in New Issue
Block a user