commit | b49f86605411035817a305bed6d1ef6c389c6c7b | [log] [tgz] |
---|---|---|
author | Hansong Zhang <hsz@google.com> | Wed Dec 09 14:25:15 2020 -0800 |
committer | Hansong Zhang <hsz@google.com> | Thu Dec 10 20:35:50 2020 +0000 |
tree | 8202475076df6605480cf332997cc28d2c75054f | |
parent | 39dd3d8868792fe69ed80aaefa03b26e3491abf6 [diff] |
Bluetooth airplane listener: Check for null Check mAirplaneHelper != null before accessing it. Note that this can be null if Settings.Global.RADIO_BLUETOOTH is enabled in AIRPLANE_MODE_RADIOS. We don't need to disable Bluetooth if it's allowed in airplane mode. Test: atest FrameworksServicesTests Bug: 174254527 Change-Id: I93ae4ec6b75b7ffb8e75848d7779ab64593221bd
diff --git a/services/core/java/com/android/server/BluetoothAirplaneModeListener.java b/services/core/java/com/android/server/BluetoothAirplaneModeListener.java index 4d9680c..aa56da5 100644 --- a/services/core/java/com/android/server/BluetoothAirplaneModeListener.java +++ b/services/core/java/com/android/server/BluetoothAirplaneModeListener.java
@@ -119,7 +119,9 @@ } return; } - mAirplaneHelper.onAirplaneModeChanged(mBluetoothManager); + if (mAirplaneHelper != null) { + mAirplaneHelper.onAirplaneModeChanged(mBluetoothManager); + } } @VisibleForTesting