summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNitin Shivpure <nshivpur@codeaurora.org>2015-11-03 17:29:41 +0530
committerNitin Shivpure <nshivpur@codeaurora.org>2015-11-03 17:43:14 +0530
commitee991e9ed86e90ba56e56b9e05c89012097972d4 (patch)
tree2f486071698a700955c56bed4fb1547aafb9a8c7
parent614d2e0ffd618668d2d9593eeea460960b140b15 (diff)
downloadandroid_frameworks_opt_bluetooth-stable/cm-13.0-ZNH2KB.tar.gz
android_frameworks_opt_bluetooth-stable/cm-13.0-ZNH2KB.tar.bz2
android_frameworks_opt_bluetooth-stable/cm-13.0-ZNH2KB.zip
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.java10
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");
}
}