diff options
author | Himanshu Rawat <rwt@google.com> | 2022-03-29 11:06:00 +0000 |
---|---|---|
committer | Himanshu Rawat <rwt@google.com> | 2022-04-07 09:03:47 +0000 |
commit | 1143b5db9e10d0c286b01bc7314370ca77affb41 (patch) | |
tree | 67b7c883d18796a0495e2cd5447db300ed8cbc7c /service/java/com/android/server/bluetooth/BluetoothManagerService.java | |
parent | 3d794a25d3507fbf321c539a80809175e86c8a66 (diff) |
Disallow BLE enable in airplane mode
If BLE enable is called when airplane mode is set, it may prevent BT from turning OFF completely.
Bug: 208950823
Test: act.py -c test_config.json -tc BtStressTest:test_toggle_bluetooth; Or continuously toggle BT in airplane mode.
Change-Id: Id2c9f8cbc49d455d133afe3b251b781ba925741e
Diffstat (limited to 'service/java/com/android/server/bluetooth/BluetoothManagerService.java')
-rw-r--r-- | service/java/com/android/server/bluetooth/BluetoothManagerService.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/service/java/com/android/server/bluetooth/BluetoothManagerService.java b/service/java/com/android/server/bluetooth/BluetoothManagerService.java index bd6dfc984f..1bae07de45 100644 --- a/service/java/com/android/server/bluetooth/BluetoothManagerService.java +++ b/service/java/com/android/server/bluetooth/BluetoothManagerService.java @@ -1067,7 +1067,8 @@ class BluetoothManagerService extends IBluetoothManager.Stub { public boolean enableBle(AttributionSource attributionSource, IBinder token) throws RemoteException { final String packageName = attributionSource.getPackageName(); - if (!checkBluetoothPermissions(attributionSource, "enableBle", false)) { + if (!checkBluetoothPermissions(attributionSource, "enableBle", false) + || isAirplaneModeOn()) { if (DBG) { Slog.d(TAG, "enableBle(): bluetooth disallowed"); } |