Loading framework/java/android/bluetooth/BluetoothAdapter.java +3 −3 Original line number Original line Diff line number Diff line Loading @@ -2036,7 +2036,7 @@ public final class BluetoothAdapter { final private IBluetoothManagerCallback mManagerCallback = final private IBluetoothManagerCallback mManagerCallback = new IBluetoothManagerCallback.Stub() { new IBluetoothManagerCallback.Stub() { public void onBluetoothServiceUp(IBluetooth bluetoothService) { public void onBluetoothServiceUp(IBluetooth bluetoothService) { if (VDBG) Log.d(TAG, "onBluetoothServiceUp: " + bluetoothService); if (DBG) Log.d(TAG, "onBluetoothServiceUp: " + bluetoothService); mServiceLock.writeLock().lock(); mServiceLock.writeLock().lock(); mService = bluetoothService; mService = bluetoothService; Loading @@ -2058,7 +2058,7 @@ public final class BluetoothAdapter { } } public void onBluetoothServiceDown() { public void onBluetoothServiceDown() { if (VDBG) Log.d(TAG, "onBluetoothServiceDown: " + mService); if (DBG) Log.d(TAG, "onBluetoothServiceDown: " + mService); try { try { mServiceLock.writeLock().lock(); mServiceLock.writeLock().lock(); Loading Loading @@ -2086,7 +2086,7 @@ public final class BluetoothAdapter { } } public void onBrEdrDown() { public void onBrEdrDown() { if (VDBG) Log.i(TAG, "on QBrEdrDown: "); if (DBG) Log.i(TAG, "onBrEdrDown:"); } } }; }; Loading service/java/com/android/server/bluetooth/BluetoothManagerService.java +9 −4 Original line number Original line Diff line number Diff line Loading @@ -203,7 +203,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub { } finally { } finally { mBluetoothLock.readLock().unlock(); mBluetoothLock.readLock().unlock(); } } Slog.d(TAG, "state" + st); Slog.d(TAG, "Airplane Mode change - current state: " + st); if (isAirplaneModeOn()) { if (isAirplaneModeOn()) { // Clear registered LE apps to force shut-off // Clear registered LE apps to force shut-off Loading Loading @@ -266,6 +266,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub { mContext.registerReceiver(mReceiver, filter); mContext.registerReceiver(mReceiver, filter); loadStoredNameAndAddress(); loadStoredNameAndAddress(); if (isBluetoothPersistedStateOn()) { if (isBluetoothPersistedStateOn()) { if (DBG) Slog.d(TAG, "Startup: Bluetooth persisted state is ON."); mEnableExternal = true; mEnableExternal = true; } } Loading @@ -292,8 +293,10 @@ class BluetoothManagerService extends IBluetoothManager.Stub { * Returns true if the Bluetooth saved state is "on" * Returns true if the Bluetooth saved state is "on" */ */ private final boolean isBluetoothPersistedStateOn() { private final boolean isBluetoothPersistedStateOn() { return Settings.Global.getInt(mContentResolver, int state = Settings.Global.getInt(mContentResolver, Settings.Global.BLUETOOTH_ON, BLUETOOTH_ON_BLUETOOTH) != BLUETOOTH_OFF; Settings.Global.BLUETOOTH_ON, -1); if (DBG) Slog.d(TAG, "Bluetooth persisted state: " + state); return state != BLUETOOTH_OFF; } } /** /** Loading @@ -309,6 +312,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub { * * */ */ private void persistBluetoothSetting(int value) { private void persistBluetoothSetting(int value) { if (DBG) Slog.d(TAG, "Persisting Bluetooth Setting: " + value); Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.BLUETOOTH_ON, Settings.Global.BLUETOOTH_ON, value); value); Loading Loading @@ -1678,6 +1682,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub { private void bluetoothStateChangeHandler(int prevState, int newState) { private void bluetoothStateChangeHandler(int prevState, int newState) { boolean isStandardBroadcast = true; boolean isStandardBroadcast = true; if (DBG) Slog.d(TAG, "bluetoothStateChangeHandler: " + prevState + " -> " + newState); if (prevState != newState) { if (prevState != newState) { //Notify all proxy objects first of adapter state change //Notify all proxy objects first of adapter state change if (newState == BluetoothAdapter.STATE_BLE_ON || if (newState == BluetoothAdapter.STATE_BLE_ON || Loading Loading
framework/java/android/bluetooth/BluetoothAdapter.java +3 −3 Original line number Original line Diff line number Diff line Loading @@ -2036,7 +2036,7 @@ public final class BluetoothAdapter { final private IBluetoothManagerCallback mManagerCallback = final private IBluetoothManagerCallback mManagerCallback = new IBluetoothManagerCallback.Stub() { new IBluetoothManagerCallback.Stub() { public void onBluetoothServiceUp(IBluetooth bluetoothService) { public void onBluetoothServiceUp(IBluetooth bluetoothService) { if (VDBG) Log.d(TAG, "onBluetoothServiceUp: " + bluetoothService); if (DBG) Log.d(TAG, "onBluetoothServiceUp: " + bluetoothService); mServiceLock.writeLock().lock(); mServiceLock.writeLock().lock(); mService = bluetoothService; mService = bluetoothService; Loading @@ -2058,7 +2058,7 @@ public final class BluetoothAdapter { } } public void onBluetoothServiceDown() { public void onBluetoothServiceDown() { if (VDBG) Log.d(TAG, "onBluetoothServiceDown: " + mService); if (DBG) Log.d(TAG, "onBluetoothServiceDown: " + mService); try { try { mServiceLock.writeLock().lock(); mServiceLock.writeLock().lock(); Loading Loading @@ -2086,7 +2086,7 @@ public final class BluetoothAdapter { } } public void onBrEdrDown() { public void onBrEdrDown() { if (VDBG) Log.i(TAG, "on QBrEdrDown: "); if (DBG) Log.i(TAG, "onBrEdrDown:"); } } }; }; Loading
service/java/com/android/server/bluetooth/BluetoothManagerService.java +9 −4 Original line number Original line Diff line number Diff line Loading @@ -203,7 +203,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub { } finally { } finally { mBluetoothLock.readLock().unlock(); mBluetoothLock.readLock().unlock(); } } Slog.d(TAG, "state" + st); Slog.d(TAG, "Airplane Mode change - current state: " + st); if (isAirplaneModeOn()) { if (isAirplaneModeOn()) { // Clear registered LE apps to force shut-off // Clear registered LE apps to force shut-off Loading Loading @@ -266,6 +266,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub { mContext.registerReceiver(mReceiver, filter); mContext.registerReceiver(mReceiver, filter); loadStoredNameAndAddress(); loadStoredNameAndAddress(); if (isBluetoothPersistedStateOn()) { if (isBluetoothPersistedStateOn()) { if (DBG) Slog.d(TAG, "Startup: Bluetooth persisted state is ON."); mEnableExternal = true; mEnableExternal = true; } } Loading @@ -292,8 +293,10 @@ class BluetoothManagerService extends IBluetoothManager.Stub { * Returns true if the Bluetooth saved state is "on" * Returns true if the Bluetooth saved state is "on" */ */ private final boolean isBluetoothPersistedStateOn() { private final boolean isBluetoothPersistedStateOn() { return Settings.Global.getInt(mContentResolver, int state = Settings.Global.getInt(mContentResolver, Settings.Global.BLUETOOTH_ON, BLUETOOTH_ON_BLUETOOTH) != BLUETOOTH_OFF; Settings.Global.BLUETOOTH_ON, -1); if (DBG) Slog.d(TAG, "Bluetooth persisted state: " + state); return state != BLUETOOTH_OFF; } } /** /** Loading @@ -309,6 +312,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub { * * */ */ private void persistBluetoothSetting(int value) { private void persistBluetoothSetting(int value) { if (DBG) Slog.d(TAG, "Persisting Bluetooth Setting: " + value); Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.BLUETOOTH_ON, Settings.Global.BLUETOOTH_ON, value); value); Loading Loading @@ -1678,6 +1682,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub { private void bluetoothStateChangeHandler(int prevState, int newState) { private void bluetoothStateChangeHandler(int prevState, int newState) { boolean isStandardBroadcast = true; boolean isStandardBroadcast = true; if (DBG) Slog.d(TAG, "bluetoothStateChangeHandler: " + prevState + " -> " + newState); if (prevState != newState) { if (prevState != newState) { //Notify all proxy objects first of adapter state change //Notify all proxy objects first of adapter state change if (newState == BluetoothAdapter.STATE_BLE_ON || if (newState == BluetoothAdapter.STATE_BLE_ON || Loading