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
(cherry picked from commit b49f866054)
This commit is contained in:
Hansong Zhang
2020-12-09 14:25:15 -08:00
committed by Myles Watson
parent 32c1220518
commit b68b97f2e3

View File

@@ -127,7 +127,9 @@ class BluetoothAirplaneModeListener {
}
return;
}
mAirplaneHelper.onAirplaneModeChanged(mBluetoothManager);
if (mAirplaneHelper != null) {
mAirplaneHelper.onAirplaneModeChanged(mBluetoothManager);
}
}
@VisibleForTesting