am 71191442: TIF: Do not call session callbacks when the session is already released

* commit '711914421896ad15ab3c944c3adc838ac67cf2a6':
  TIF: Do not call session callbacks when the session is already released
This commit is contained in:
Jae Seo
2015-01-29 00:33:29 +00:00
committed by Android Git Automerger

View File

@ -310,7 +310,9 @@ public abstract class TvInputService extends Service {
public void run() { public void run() {
try { try {
if (DEBUG) Log.d(TAG, "notifySessionEvent(" + eventType + ")"); if (DEBUG) Log.d(TAG, "notifySessionEvent(" + eventType + ")");
if (mSessionCallback != null) {
mSessionCallback.onSessionEvent(eventType, eventArgs); mSessionCallback.onSessionEvent(eventType, eventArgs);
}
} catch (RemoteException e) { } catch (RemoteException e) {
Log.w(TAG, "error in sending event (event=" + eventType + ")"); Log.w(TAG, "error in sending event (event=" + eventType + ")");
} }
@ -329,7 +331,9 @@ public abstract class TvInputService extends Service {
public void run() { public void run() {
try { try {
if (DEBUG) Log.d(TAG, "notifyChannelRetuned"); if (DEBUG) Log.d(TAG, "notifyChannelRetuned");
if (mSessionCallback != null) {
mSessionCallback.onChannelRetuned(channelUri); mSessionCallback.onChannelRetuned(channelUri);
}
} catch (RemoteException e) { } catch (RemoteException e) {
Log.w(TAG, "error in notifyChannelRetuned"); Log.w(TAG, "error in notifyChannelRetuned");
} }
@ -366,7 +370,9 @@ public abstract class TvInputService extends Service {
public void run() { public void run() {
try { try {
if (DEBUG) Log.d(TAG, "notifyTracksChanged"); if (DEBUG) Log.d(TAG, "notifyTracksChanged");
if (mSessionCallback != null) {
mSessionCallback.onTracksChanged(tracks); mSessionCallback.onTracksChanged(tracks);
}
} catch (RemoteException e) { } catch (RemoteException e) {
Log.w(TAG, "error in notifyTracksChanged"); Log.w(TAG, "error in notifyTracksChanged");
} }
@ -394,7 +400,9 @@ public abstract class TvInputService extends Service {
public void run() { public void run() {
try { try {
if (DEBUG) Log.d(TAG, "notifyTrackSelected"); if (DEBUG) Log.d(TAG, "notifyTrackSelected");
if (mSessionCallback != null) {
mSessionCallback.onTrackSelected(type, trackId); mSessionCallback.onTrackSelected(type, trackId);
}
} catch (RemoteException e) { } catch (RemoteException e) {
Log.w(TAG, "error in notifyTrackSelected"); Log.w(TAG, "error in notifyTrackSelected");
} }
@ -415,7 +423,9 @@ public abstract class TvInputService extends Service {
public void run() { public void run() {
try { try {
if (DEBUG) Log.d(TAG, "notifyVideoAvailable"); if (DEBUG) Log.d(TAG, "notifyVideoAvailable");
if (mSessionCallback != null) {
mSessionCallback.onVideoAvailable(); mSessionCallback.onVideoAvailable();
}
} catch (RemoteException e) { } catch (RemoteException e) {
Log.w(TAG, "error in notifyVideoAvailable"); Log.w(TAG, "error in notifyVideoAvailable");
} }
@ -447,7 +457,9 @@ public abstract class TvInputService extends Service {
public void run() { public void run() {
try { try {
if (DEBUG) Log.d(TAG, "notifyVideoUnavailable"); if (DEBUG) Log.d(TAG, "notifyVideoUnavailable");
if (mSessionCallback != null) {
mSessionCallback.onVideoUnavailable(reason); mSessionCallback.onVideoUnavailable(reason);
}
} catch (RemoteException e) { } catch (RemoteException e) {
Log.w(TAG, "error in notifyVideoUnavailable"); Log.w(TAG, "error in notifyVideoUnavailable");
} }
@ -486,7 +498,9 @@ public abstract class TvInputService extends Service {
public void run() { public void run() {
try { try {
if (DEBUG) Log.d(TAG, "notifyContentAllowed"); if (DEBUG) Log.d(TAG, "notifyContentAllowed");
if (mSessionCallback != null) {
mSessionCallback.onContentAllowed(); mSessionCallback.onContentAllowed();
}
} catch (RemoteException e) { } catch (RemoteException e) {
Log.w(TAG, "error in notifyContentAllowed"); Log.w(TAG, "error in notifyContentAllowed");
} }
@ -526,7 +540,9 @@ public abstract class TvInputService extends Service {
public void run() { public void run() {
try { try {
if (DEBUG) Log.d(TAG, "notifyContentBlocked"); if (DEBUG) Log.d(TAG, "notifyContentBlocked");
if (mSessionCallback != null) {
mSessionCallback.onContentBlocked(rating.flattenToString()); mSessionCallback.onContentBlocked(rating.flattenToString());
}
} catch (RemoteException e) { } catch (RemoteException e) {
Log.w(TAG, "error in notifyContentBlocked"); Log.w(TAG, "error in notifyContentBlocked");
} }
@ -557,7 +573,9 @@ public abstract class TvInputService extends Service {
try { try {
if (DEBUG) Log.d(TAG, "layoutSurface (l=" + left + ", t=" + top + ", r=" if (DEBUG) Log.d(TAG, "layoutSurface (l=" + left + ", t=" + top + ", r="
+ right + ", b=" + bottom + ",)"); + right + ", b=" + bottom + ",)");
if (mSessionCallback != null) {
mSessionCallback.onLayoutSurface(left, top, right, bottom); mSessionCallback.onLayoutSurface(left, top, right, bottom);
}
} catch (RemoteException e) { } catch (RemoteException e) {
Log.w(TAG, "error in layoutSurface"); Log.w(TAG, "error in layoutSurface");
} }