Fix crash when no Bluetooth feature in Settings
- Move PreferenceGroup init method out of isAvailable() condition, then PreferenceGroup will not be null. - Update getAvailabilityStatus(), since the controller now may have usb and dock. Bug: 110712414 Test: make -j42 RunSettingsRoboTests Change-Id: I4d85a42c26fb20d319e7321177b271933be3fdb0
This commit is contained in:
@@ -52,7 +52,8 @@ public class PreviouslyConnectedDevicePreferenceController extends BasePreferenc
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)
|
||||
return (mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)
|
||||
|| mSavedDockUpdater != null)
|
||||
? AVAILABLE
|
||||
: CONDITIONALLY_UNAVAILABLE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user