Merge "Initialize UwbManager only if supported on device."

This commit is contained in:
Joy Babafemi
2021-08-25 03:56:49 +00:00
committed by Android (Google) Code Review

View File

@@ -57,7 +57,9 @@ public class UwbPreferenceController extends TogglePreferenceController implemen
public UwbPreferenceController(Context context, String key) {
super(context, key);
mExecutor = Executors.newSingleThreadExecutor();
mUwbManager = context.getSystemService(UwbManager.class);
if (isUwbSupportedOnDevice()) {
mUwbManager = context.getSystemService(UwbManager.class);
}
mAirplaneModeOn = Settings.Global.getInt(mContext.getContentResolver(),
Settings.Global.AIRPLANE_MODE_ON, 0) == 1;
mAirplaneModeChangedReceiver = new BroadcastReceiver() {