Bug 1374146 - handle already released death recipient exception. r?esawin
MozReview-Commit-ID: G5Nfd2z4QlN
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/RemoteManager.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/RemoteManager.java
@@ -14,16 +14,17 @@ import android.media.MediaFormat;
import android.os.DeadObjectException;
import android.os.IBinder;
import android.os.RemoteException;
import android.view.Surface;
import android.util.Log;
import java.util.LinkedList;
import java.util.List;
+import java.util.NoSuchElementException;
import org.mozilla.gecko.gfx.GeckoSurface;
public final class RemoteManager implements IBinder.DeathRecipient {
private static final String LOGTAG = "GeckoRemoteManager";
private static final boolean DEBUG = false;
private static RemoteManager sRemoteManager = null;
private static ICrashReporter setCrashReporter = null;
@@ -53,17 +54,21 @@ public final class RemoteManager impleme
mRemote = IMediaManager.Stub.asInterface(service);
notify();
}
}
@Override
public void onServiceDisconnected(ComponentName name) {
if (DEBUG) Log.d(LOGTAG, "service disconnected");
- mRemote.asBinder().unlinkToDeath(RemoteManager.this, 0);
+ try {
+ mRemote.asBinder().unlinkToDeath(RemoteManager.this, 0);
+ } catch (NoSuchElementException e) {
+ Log.w(LOGTAG, "death recipient already released");
+ }
synchronized (this) {
mRemote = null;
notify();
}
}
private boolean connect() {
Context appCtxt = GeckoAppShell.getApplicationContext();