Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ff7fe379 authored by Ytai Ben-Tsvi's avatar Ytai Ben-Tsvi
Browse files

Correctly detect dead soundtrigger HAL process

This is a follow-up to b/160169016, which changes how
HwBinder presents a dead server to the client.

Test: Changed the code to cause the HAL process do occasionally die in
the middle of a call and observed the logs to verify that the death is
recognized correctly and recovered from.

Change-Id: Ic510fa6cbafa4cee5c53a5a6a28823c34c3d05c1
parent cc9c9c10
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -192,10 +192,7 @@ public class SoundTriggerHw2Enforcer implements ISoundTriggerHw2 {
    }

    private static RuntimeException handleException(RuntimeException e) {
        // TODO(b/160169016): There is currently no other way to distinguish dead object from other
        //   exceptions.
        if (e.getCause() instanceof RemoteException &&
                e.getCause().getMessage().equals("HwBinder Error: (-32)")) {
        if (e.getCause() instanceof DeadObjectException) {
            // Server is dead, no need to reboot.
            Log.e(TAG, "HAL died");
        } else {