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

Commit 24e7f904 authored by Aswin Sankar's avatar Aswin Sankar
Browse files

NetworkService: quitSafely() on onDestroy()

- When IwlanNetworkService is un-bound, such as when phone app dies,
  the typical sequence is onUnbind() followed by onDestroy() immediately.
- Messages queued by onUnbind() are not processed, which leaves the
  IwlanNetworkService in an unexpected state for the next onBind().
- The change is applied to DataService.java as well for safety.

Bug: 237447534
Test:
Live test by crashing com.android.phone to verify fix to unbind/destroy
behavior.

Change-Id: I25d968867401bd7d285735c83c71e3649467c5db
parent f63f20af
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -265,7 +265,7 @@ public abstract class NetworkService extends Service {
    /** @hide */
    @Override
    public void onDestroy() {
        mHandlerThread.quit();
        mHandlerThread.quitSafely();
        super.onDestroy();
    }

+1 −1
Original line number Diff line number Diff line
@@ -725,7 +725,7 @@ public abstract class DataService extends Service {

    @Override
    public void onDestroy() {
        mHandlerThread.quit();
        mHandlerThread.quitSafely();
        super.onDestroy();
    }