Merge "Catch NoSuchMethodError as isAutoOnSupported is tagged as FlaggedApi." into main

This commit is contained in:
Chelsea Hao
2024-06-13 11:44:48 +00:00
committed by Android (Google) Code Review

View File

@@ -93,7 +93,7 @@ public class BluetoothAutoOnPreferenceController extends TogglePreferenceControl
var unused = ThreadUtils.postOnBackgroundThread(this::updateValue);
}
return isSupported ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
} catch (Exception e) {
} catch (Exception | NoSuchMethodError e) {
// Server could throw TimeoutException, InterruptedException or ExecutionException
return UNSUPPORTED_ON_DEVICE;
}