Loading services/core/java/com/android/server/power/ShutdownThread.java +14 −9 Original line number Diff line number Diff line Loading @@ -571,7 +571,7 @@ public final class ShutdownThread extends Thread { Thread t = new Thread() { public void run() { boolean nfcOff; boolean bluetoothOff; boolean bluetoothReadyForShutdown; boolean radioOff; final INfcAdapter nfc = Loading @@ -595,15 +595,15 @@ public final class ShutdownThread extends Thread { } try { bluetoothOff = bluetooth == null || bluetoothReadyForShutdown = bluetooth == null || bluetooth.getState() == BluetoothAdapter.STATE_OFF; if (!bluetoothOff) { if (!bluetoothReadyForShutdown) { Log.w(TAG, "Disabling Bluetooth..."); bluetooth.disable(mContext.getPackageName(), false); // disable but don't persist new state } } catch (RemoteException ex) { Log.e(TAG, "RemoteException during bluetooth shutdown", ex); bluetoothOff = true; bluetoothReadyForShutdown = true; } try { Loading @@ -628,14 +628,19 @@ public final class ShutdownThread extends Thread { sInstance.setRebootProgress(status, null); } if (!bluetoothOff) { if (!bluetoothReadyForShutdown) { try { bluetoothOff = bluetooth.getState() == BluetoothAdapter.STATE_OFF; // BLE only mode can happen when BT is turned off // We will continue shutting down in such case bluetoothReadyForShutdown = bluetooth.getState() == BluetoothAdapter.STATE_OFF || bluetooth.getState() == BluetoothAdapter.STATE_BLE_TURNING_OFF || bluetooth.getState() == BluetoothAdapter.STATE_BLE_ON; } catch (RemoteException ex) { Log.e(TAG, "RemoteException during bluetooth shutdown", ex); bluetoothOff = true; bluetoothReadyForShutdown = true; } if (bluetoothOff) { if (bluetoothReadyForShutdown) { Log.i(TAG, "Bluetooth turned off."); } } Loading @@ -662,7 +667,7 @@ public final class ShutdownThread extends Thread { } } if (radioOff && bluetoothOff && nfcOff) { if (radioOff && bluetoothReadyForShutdown && nfcOff) { Log.i(TAG, "NFC, Radio and Bluetooth shutdown complete."); done[0] = true; break; Loading Loading
services/core/java/com/android/server/power/ShutdownThread.java +14 −9 Original line number Diff line number Diff line Loading @@ -571,7 +571,7 @@ public final class ShutdownThread extends Thread { Thread t = new Thread() { public void run() { boolean nfcOff; boolean bluetoothOff; boolean bluetoothReadyForShutdown; boolean radioOff; final INfcAdapter nfc = Loading @@ -595,15 +595,15 @@ public final class ShutdownThread extends Thread { } try { bluetoothOff = bluetooth == null || bluetoothReadyForShutdown = bluetooth == null || bluetooth.getState() == BluetoothAdapter.STATE_OFF; if (!bluetoothOff) { if (!bluetoothReadyForShutdown) { Log.w(TAG, "Disabling Bluetooth..."); bluetooth.disable(mContext.getPackageName(), false); // disable but don't persist new state } } catch (RemoteException ex) { Log.e(TAG, "RemoteException during bluetooth shutdown", ex); bluetoothOff = true; bluetoothReadyForShutdown = true; } try { Loading @@ -628,14 +628,19 @@ public final class ShutdownThread extends Thread { sInstance.setRebootProgress(status, null); } if (!bluetoothOff) { if (!bluetoothReadyForShutdown) { try { bluetoothOff = bluetooth.getState() == BluetoothAdapter.STATE_OFF; // BLE only mode can happen when BT is turned off // We will continue shutting down in such case bluetoothReadyForShutdown = bluetooth.getState() == BluetoothAdapter.STATE_OFF || bluetooth.getState() == BluetoothAdapter.STATE_BLE_TURNING_OFF || bluetooth.getState() == BluetoothAdapter.STATE_BLE_ON; } catch (RemoteException ex) { Log.e(TAG, "RemoteException during bluetooth shutdown", ex); bluetoothOff = true; bluetoothReadyForShutdown = true; } if (bluetoothOff) { if (bluetoothReadyForShutdown) { Log.i(TAG, "Bluetooth turned off."); } } Loading @@ -662,7 +667,7 @@ public final class ShutdownThread extends Thread { } } if (radioOff && bluetoothOff && nfcOff) { if (radioOff && bluetoothReadyForShutdown && nfcOff) { Log.i(TAG, "NFC, Radio and Bluetooth shutdown complete."); done[0] = true; break; Loading