From c03df5f6c71f522c13cf6093559e3b1a4c50125e Mon Sep 17 00:00:00 2001 From: chelseahao Date: Thu, 13 Jun 2024 16:43:52 +0800 Subject: [PATCH] Catch NoSuchMethodError as `isAutoOnSupported` is tagged as `FlaggedApi`. Test: Manual Bug: 346716614 Change-Id: I69b34c461ab71703490147a49f5c713a25275f51 --- .../settings/bluetooth/BluetoothAutoOnPreferenceController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/settings/bluetooth/BluetoothAutoOnPreferenceController.java b/src/com/android/settings/bluetooth/BluetoothAutoOnPreferenceController.java index 3aca85e7118..e3b758d431e 100644 --- a/src/com/android/settings/bluetooth/BluetoothAutoOnPreferenceController.java +++ b/src/com/android/settings/bluetooth/BluetoothAutoOnPreferenceController.java @@ -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; }