diff options
author | Nitin Shivpure <nshivpur@codeaurora.org> | 2015-11-03 17:29:41 +0530 |
---|---|---|
committer | Nitin Shivpure <nshivpur@codeaurora.org> | 2015-11-03 17:43:14 +0530 |
commit | ee991e9ed86e90ba56e56b9e05c89012097972d4 (patch) | |
tree | 2f486071698a700955c56bed4fb1547aafb9a8c7 | |
parent | 614d2e0ffd618668d2d9593eeea460960b140b15 (diff) | |
download | android_frameworks_opt_bluetooth-ee991e9ed86e90ba56e56b9e05c89012097972d4.tar.gz android_frameworks_opt_bluetooth-ee991e9ed86e90ba56e56b9e05c89012097972d4.tar.bz2 android_frameworks_opt_bluetooth-ee991e9ed86e90ba56e56b9e05c89012097972d4.zip |
MAP: Start new thread properly to prevent ANRHEADreplicant-6.0-0004-transitionreplicant-6.0-0004-rc6replicant-6.0-0004-rc5-transitionreplicant-6.0-0004-rc5replicant-6.0-0004-rc4replicant-6.0-0004-rc3replicant-6.0-0004-rc2replicant-6.0-0004-rc1replicant-6.0-0004replicant-6.0-0003replicant-6.0-0002replicant-6.0-0001stable/cm-13.0-ZNH5Ystable/cm-13.0-ZNH2KBstable/cm-13.0-ZNH2Kcm-13.0
As MapClient thread join was happening in main thread
So if client is fetching the large data & do disconnect.
It causes the ANR. Starting MapClient thread join into
new thread properly to prevent ANR.
CRs-fixed: 934429
Change-Id: Ife121a05ba102a2f4b8e274051bbb068374faf54
-rw-r--r-- | src/android/bluetooth/client/map/BluetoothMasObexClientSession.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/android/bluetooth/client/map/BluetoothMasObexClientSession.java b/src/android/bluetooth/client/map/BluetoothMasObexClientSession.java index 37f758c..4aa0cf4 100644 --- a/src/android/bluetooth/client/map/BluetoothMasObexClientSession.java +++ b/src/android/bluetooth/client/map/BluetoothMasObexClientSession.java @@ -179,9 +179,9 @@ class BluetoothMasObexClientSession { if (mClientThread != null) { mClientThread.shutdown(); - (new Thread() { - @Override - public void run() { + Thread t = new Thread(new Runnable() { + public void run () { + Log.d(TAG, "Spawning a new thread for stopping obex session"); try { mClientThread.join(); mClientThread = null; @@ -189,7 +189,9 @@ class BluetoothMasObexClientSession { Log.w(TAG, "Interrupted while waiting for thread to join"); } } - }).run(); + }); + t.start(); + Log.d(TAG, "Exiting from the stopping thread"); } } |