Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e0209b92 authored by Jason Hsu's avatar Jason Hsu Committed by Android (Google) Code Review
Browse files

Merge "Change to formal call for getDeviceSide() and getDeviceMode()" into udc-dev

parents f96f724e 91d7b18c
Loading
Loading
Loading
Loading
+2 −23
Original line number Diff line number Diff line
@@ -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() {