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

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

Correctly propagate service state change

Due to a surprising behavior of Handler.obtainMessage(), the argument
that indicated whether the service is available was always read as 0
(enabled), and we never correctly handled the service being
unavailable (due to concurrent capture).

Bug: 157496890
Test: Enabled debug logging and verified that the message is now
      passed correctly and that indeed that models get inactivated
      when capture starts and reactivated when it stops.
Change-Id: Ibf4ecdb4e4dd0f5a02d5a388afddb205c29eb2ea
parent 7caef40a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -303,7 +303,7 @@ public class SoundTriggerModule {
                                    (SoundTrigger.RecognitionEvent) msg.obj);
                            break;
                        case EVENT_SERVICE_STATE_CHANGE:
                            listener.onServiceStateChange(msg.arg1);
                            listener.onServiceStateChange((int) msg.obj);
                            break;
                        case EVENT_SERVICE_DIED:
                            listener.onServiceDied();