Merge "Add missing checks for the current session callback" into lmp-dev
diff --git a/media/java/android/media/tv/TvView.java b/media/java/android/media/tv/TvView.java
index 017645a..f4c761e 100644
--- a/media/java/android/media/tv/TvView.java
+++ b/media/java/android/media/tv/TvView.java
@@ -964,6 +964,9 @@
@Override
public void onContentBlocked(Session session, TvContentRating rating) {
+ if (this != mSessionCallback) {
+ return;
+ }
if (DEBUG) {
Log.d(TAG, "onContentBlocked()");
}
@@ -974,6 +977,9 @@
@Override
public void onLayoutSurface(Session session, int left, int top, int right, int bottom) {
+ if (this != mSessionCallback) {
+ return;
+ }
if (DEBUG) {
Log.d(TAG, "onLayoutSurface (left=" + left + ", top=" + top + ", right="
+ right + ", bottom=" + bottom + ",)");