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
This commit is contained in:
@@ -265,7 +265,7 @@ public abstract class NetworkService extends Service {
|
||||
/** @hide */
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
mHandlerThread.quit();
|
||||
mHandlerThread.quitSafely();
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
|
||||
@@ -725,7 +725,7 @@ public abstract class DataService extends Service {
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
mHandlerThread.quit();
|
||||
mHandlerThread.quitSafely();
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user