Loading android/app/src/com/android/bluetooth/btservice/AdapterService.java +1 −1 Original line number Diff line number Diff line Loading @@ -2281,7 +2281,7 @@ public class AdapterService extends Service { try { // Wait for Bluetooth to be killed from its main thread Thread.sleep(950); // SystemServer is waiting 1000 ms, we need to wait less here Thread.sleep(1_000); // SystemServer is waiting 2000 ms, we need to wait less here } catch (InterruptedException e) { Log.e(TAG, "killBluetoothProcess: Interrupted while waiting for kill"); } Loading service/src/com/android/server/bluetooth/BluetoothManagerService.java +5 −2 Original line number Diff line number Diff line Loading @@ -1226,16 +1226,19 @@ class BluetoothManagerService { // TODO: b/339501753 - Properly stop Bluetooth without killing it mAdapter.killBluetoothProcess(); binderDead.get(1, TimeUnit.SECONDS); binderDead.get(2_000, TimeUnit.MILLISECONDS); } catch (android.os.DeadObjectException e) { // Reduce exception to info and skip waiting (Bluetooth is dead as wanted) Log.i(TAG, "Bluetooth already dead 💀"); } catch (RemoteException e) { Log.e(TAG, "Unexpected RemoteException when calling killBluetoothProcess", e); } catch (TimeoutException | InterruptedException | ExecutionException e) { Log.e(TAG, "Bluetooth death not received correctly", e); Log.e(TAG, "Bluetooth death not received correctly after > 2000ms", e); } // TODO: b/356931756 - Remove sleep SystemClock.sleep(100); // required to let the ActivityManager be notified of BT death mAdapter = null; mHandler.removeMessages(MESSAGE_TIMEOUT_BIND); } finally { Loading Loading
android/app/src/com/android/bluetooth/btservice/AdapterService.java +1 −1 Original line number Diff line number Diff line Loading @@ -2281,7 +2281,7 @@ public class AdapterService extends Service { try { // Wait for Bluetooth to be killed from its main thread Thread.sleep(950); // SystemServer is waiting 1000 ms, we need to wait less here Thread.sleep(1_000); // SystemServer is waiting 2000 ms, we need to wait less here } catch (InterruptedException e) { Log.e(TAG, "killBluetoothProcess: Interrupted while waiting for kill"); } Loading
service/src/com/android/server/bluetooth/BluetoothManagerService.java +5 −2 Original line number Diff line number Diff line Loading @@ -1226,16 +1226,19 @@ class BluetoothManagerService { // TODO: b/339501753 - Properly stop Bluetooth without killing it mAdapter.killBluetoothProcess(); binderDead.get(1, TimeUnit.SECONDS); binderDead.get(2_000, TimeUnit.MILLISECONDS); } catch (android.os.DeadObjectException e) { // Reduce exception to info and skip waiting (Bluetooth is dead as wanted) Log.i(TAG, "Bluetooth already dead 💀"); } catch (RemoteException e) { Log.e(TAG, "Unexpected RemoteException when calling killBluetoothProcess", e); } catch (TimeoutException | InterruptedException | ExecutionException e) { Log.e(TAG, "Bluetooth death not received correctly", e); Log.e(TAG, "Bluetooth death not received correctly after > 2000ms", e); } // TODO: b/356931756 - Remove sleep SystemClock.sleep(100); // required to let the ActivityManager be notified of BT death mAdapter = null; mHandler.removeMessages(MESSAGE_TIMEOUT_BIND); } finally { Loading