Fix runtime exception when cachedDevice is null
Finish the activity after call super.onAttach(). Bug: 143187915 Test: make -j42 RunSettingsRoboTests Change-Id: I8f205ef60797bd9eb96617d413f554613008f65b
This commit is contained in:
@@ -92,7 +92,8 @@ public class AdvancedBluetoothDetailsHeaderController extends BasePreferenceCont
|
||||
public int getAvailabilityStatus() {
|
||||
final boolean advancedEnabled = DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_SETTINGS_UI,
|
||||
SettingsUIDeviceConfig.BT_ADVANCED_HEADER_ENABLED, true);
|
||||
final boolean untetheredHeadset = BluetoothUtils.getBooleanMetaData(
|
||||
final boolean untetheredHeadset = mCachedDevice != null
|
||||
&& BluetoothUtils.getBooleanMetaData(
|
||||
mCachedDevice.getDevice(), BluetoothDevice.METADATA_IS_UNTETHERED_HEADSET);
|
||||
return advancedEnabled && untetheredHeadset ? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user