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

Commit f72579d4 authored by Jason Hsu's avatar Jason Hsu Committed by Automerger Merge Worker
Browse files

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

parents c6eb9c74 e0209b92
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() {