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

Commit e4d721f7 authored by Felix Oghina's avatar Felix Oghina
Browse files

[speech] add binder alive check

We're seeing some exceptions happening when the connection is not null
but closed. Add a check to make sure the binder is actually alive.

Bug: 301307379
Bug: 308000873
Test: cts

Change-Id: I72855ee0d1a378165f53cb9e1db4fe7443b7f24d
parent 4831a63b
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -892,7 +892,7 @@ public class SpeechRecognizer {
    }
    }


    private boolean checkOpenConnection() {
    private boolean checkOpenConnection() {
        if (mService != null) {
        if (mService != null && mService.asBinder().isBinderAlive()) {
            return true;
            return true;
        }
        }
        mListener.onError(ERROR_CLIENT);
        mListener.onError(ERROR_CLIENT);