summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorJae Seo <jaeseo@google.com>2015-01-28 15:50:08 -0800
committerJae Seo <jaeseo@google.com>2015-01-28 15:50:08 -0800
commit711914421896ad15ab3c944c3adc838ac67cf2a6 (patch)
treea6d2d7be2d7b17a62086b6fc50e91a1c171276ce /media
parenta17ab21d4c81ecc80b00b14fe56ce721b4e757ae (diff)
downloadframeworks_base-711914421896ad15ab3c944c3adc838ac67cf2a6.zip
frameworks_base-711914421896ad15ab3c944c3adc838ac67cf2a6.tar.gz
frameworks_base-711914421896ad15ab3c944c3adc838ac67cf2a6.tar.bz2
TIF: Do not call session callbacks when the session is already released
Bug: 19146382 Change-Id: I5592d4bf033478e5e5e1013bd2ad5ea572df44dd
Diffstat (limited to 'media')
-rw-r--r--media/java/android/media/tv/TvInputService.java36
1 files changed, 27 insertions, 9 deletions
diff --git a/media/java/android/media/tv/TvInputService.java b/media/java/android/media/tv/TvInputService.java
index b19a1fb..b7e766b 100644
--- a/media/java/android/media/tv/TvInputService.java
+++ b/media/java/android/media/tv/TvInputService.java
@@ -310,7 +310,9 @@ public abstract class TvInputService extends Service {
public void run() {
try {
if (DEBUG) Log.d(TAG, "notifySessionEvent(" + eventType + ")");
- mSessionCallback.onSessionEvent(eventType, eventArgs);
+ if (mSessionCallback != null) {
+ mSessionCallback.onSessionEvent(eventType, eventArgs);
+ }
} catch (RemoteException e) {
Log.w(TAG, "error in sending event (event=" + eventType + ")");
}
@@ -329,7 +331,9 @@ public abstract class TvInputService extends Service {
public void run() {
try {
if (DEBUG) Log.d(TAG, "notifyChannelRetuned");
- mSessionCallback.onChannelRetuned(channelUri);
+ if (mSessionCallback != null) {
+ mSessionCallback.onChannelRetuned(channelUri);
+ }
} catch (RemoteException e) {
Log.w(TAG, "error in notifyChannelRetuned");
}
@@ -366,7 +370,9 @@ public abstract class TvInputService extends Service {
public void run() {
try {
if (DEBUG) Log.d(TAG, "notifyTracksChanged");
- mSessionCallback.onTracksChanged(tracks);
+ if (mSessionCallback != null) {
+ mSessionCallback.onTracksChanged(tracks);
+ }
} catch (RemoteException e) {
Log.w(TAG, "error in notifyTracksChanged");
}
@@ -394,7 +400,9 @@ public abstract class TvInputService extends Service {
public void run() {
try {
if (DEBUG) Log.d(TAG, "notifyTrackSelected");
- mSessionCallback.onTrackSelected(type, trackId);
+ if (mSessionCallback != null) {
+ mSessionCallback.onTrackSelected(type, trackId);
+ }
} catch (RemoteException e) {
Log.w(TAG, "error in notifyTrackSelected");
}
@@ -415,7 +423,9 @@ public abstract class TvInputService extends Service {
public void run() {
try {
if (DEBUG) Log.d(TAG, "notifyVideoAvailable");
- mSessionCallback.onVideoAvailable();
+ if (mSessionCallback != null) {
+ mSessionCallback.onVideoAvailable();
+ }
} catch (RemoteException e) {
Log.w(TAG, "error in notifyVideoAvailable");
}
@@ -447,7 +457,9 @@ public abstract class TvInputService extends Service {
public void run() {
try {
if (DEBUG) Log.d(TAG, "notifyVideoUnavailable");
- mSessionCallback.onVideoUnavailable(reason);
+ if (mSessionCallback != null) {
+ mSessionCallback.onVideoUnavailable(reason);
+ }
} catch (RemoteException e) {
Log.w(TAG, "error in notifyVideoUnavailable");
}
@@ -486,7 +498,9 @@ public abstract class TvInputService extends Service {
public void run() {
try {
if (DEBUG) Log.d(TAG, "notifyContentAllowed");
- mSessionCallback.onContentAllowed();
+ if (mSessionCallback != null) {
+ mSessionCallback.onContentAllowed();
+ }
} catch (RemoteException e) {
Log.w(TAG, "error in notifyContentAllowed");
}
@@ -526,7 +540,9 @@ public abstract class TvInputService extends Service {
public void run() {
try {
if (DEBUG) Log.d(TAG, "notifyContentBlocked");
- mSessionCallback.onContentBlocked(rating.flattenToString());
+ if (mSessionCallback != null) {
+ mSessionCallback.onContentBlocked(rating.flattenToString());
+ }
} catch (RemoteException e) {
Log.w(TAG, "error in notifyContentBlocked");
}
@@ -557,7 +573,9 @@ public abstract class TvInputService extends Service {
try {
if (DEBUG) Log.d(TAG, "layoutSurface (l=" + left + ", t=" + top + ", r="
+ right + ", b=" + bottom + ",)");
- mSessionCallback.onLayoutSurface(left, top, right, bottom);
+ if (mSessionCallback != null) {
+ mSessionCallback.onLayoutSurface(left, top, right, bottom);
+ }
} catch (RemoteException e) {
Log.w(TAG, "error in layoutSurface");
}