summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jason Hsu <jasonwshsu@google.com> 2023-04-12 05:39:59 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2023-04-12 05:39:59 +0000
commite0209b9296ac50b7cf1dbeb6a5a5eed59382bd51 (patch)
treee4bc5cd43cde78c71d8d837b24f0eca461deceb6
parentf96f724eddb4281a785f901bf8cae051cb25a7d0 (diff)
parent91d7b18c963a88ca16b1d817748aabf644d282fb (diff)
Merge "Change to formal call for getDeviceSide() and getDeviceMode()" into udc-dev
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/bluetooth/HearingAidProfile.java25
1 files changed, 2 insertions, 23 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/HearingAidProfile.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/HearingAidProfile.java
index e22f3f0e720d..5fbb4c3e5712 100644
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/HearingAidProfile.java
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/HearingAidProfile.java
@@ -37,8 +37,6 @@ import com.android.settingslib.Utils;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
@@ -287,16 +285,7 @@ public class HearingAidProfile implements LocalBluetoothProfile {
return defaultValue;
}
- try {
- Method method = mService.getClass().getDeclaredMethod("getDeviceSideInternal",
- BluetoothDevice.class);
- method.setAccessible(true);
- return (int) method.invoke(mService, device);
- } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
- Log.e(TAG, "fail to get getDeviceSideInternal\n" + e.toString() + "\n"
- + Log.getStackTraceString(new Throwable()));
- return defaultValue;
- }
+ return mService.getDeviceSide(device);
}
/**
@@ -313,17 +302,7 @@ public class HearingAidProfile implements LocalBluetoothProfile {
return defaultValue;
}
- try {
- Method method = mService.getClass().getDeclaredMethod("getDeviceModeInternal",
- BluetoothDevice.class);
- method.setAccessible(true);
- return (int) method.invoke(mService, device);
- } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
- Log.e(TAG, "fail to get getDeviceModeInternal\n" + e.toString() + "\n"
- + Log.getStackTraceString(new Throwable()));
-
- return defaultValue;
- }
+ return mService.getDeviceMode(device);
}
public String toString() {