Merge "Don't crash if SoundTriggerDetectionService client is gone or if there is a remote exception while finishing an opperation" into pi-dev
diff --git a/media/java/android/media/soundtrigger/SoundTriggerDetectionService.java b/media/java/android/media/soundtrigger/SoundTriggerDetectionService.java
index 7381d97..55cd1ab 100644
--- a/media/java/android/media/soundtrigger/SoundTriggerDetectionService.java
+++ b/media/java/android/media/soundtrigger/SoundTriggerDetectionService.java
@@ -191,13 +191,14 @@
                 client = mClients.get(uuid);
 
                 if (client == null) {
-                    throw new IllegalStateException("operationFinished called, but no client for "
+                    Log.w(LOG_TAG, "operationFinished called, but no client for "
                             + uuid + ". Was this called after onDisconnected?");
+                    return;
                 }
             }
             client.onOpFinished(opId);
         } catch (RemoteException e) {
-            e.rethrowFromSystemServer();
+            Log.e(LOG_TAG, "operationFinished, remote exception for client " + uuid, e);
         }
     }