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

Commit 83be4ae5 authored by Fabian Kozynski's avatar Fabian Kozynski
Browse files

Empty message queue on TileService#onDestroy

onDestroy is called by system_server asynchronously on the main thread.
If there are queued messages (from the binder interface), remove them.
This follows the contract that methods in the service will not be called
after onDestroy

Test: manual with test tile
Fixes: 172511340

Change-Id: I7d46c065d5a9597ce1d44bc5707e79b302b201f6
parent f48a5e3d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -176,6 +176,9 @@ public class TileService extends Service {

    @Override
    public void onDestroy() {
        // As this call will come asynchronously in the main thread, prevent calls from the binder
        // being processed after this.
        mHandler.removeCallbacksAndMessages(null);
        if (mListening) {
            onStopListening();
            mListening = false;