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

Commit d574d2d9 authored by William Escande's avatar William Escande
Browse files

Framework: stop rethrowing remote exception

It makes no sense to rethrow a remote exception as this means that the
bluetooth became off in the midle of the call and we already gracefully
handle the case when the bluetooth is not available.

Test: m Bluetooth | this logic is edge case and goes untested
Flag: Exempt, global refactor to follow good practices
Bug: 367362592
Fix: 367362592
Change-Id: Id24d8c312a33738205d12d57bc9579971969185b
parent db360885
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -4243,14 +4243,14 @@ public final class BluetoothAdapter {
                        IBluetooth.Stub.asInterface(
                                mManagerService.registerAdapter(sManagerCallback));
            } catch (RemoteException e) {
                throw e.rethrowAsRuntimeException();
                throw e.rethrowFromSystemServer();
            }
        } else {
            try {
                mManagerService.unregisterAdapter(sManagerCallback);
                sService = null;
            } catch (RemoteException e) {
                throw e.rethrowAsRuntimeException();
                throw e.rethrowFromSystemServer();
            }
        }
        sServiceRegistered = wantRegistered;
+9 −9
Original line number Diff line number Diff line
@@ -294,7 +294,7 @@ public final class BluetoothCsipSetCoordinator implements BluetoothProfile, Auto
                final ParcelUuid ret = service.lockGroup(groupId, delegate, mAttributionSource);
                return ret == null ? null : ret.getUuid();
            } catch (RemoteException e) {
                throw e.rethrowAsRuntimeException();
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            }
        }
        return null;
@@ -323,7 +323,7 @@ public final class BluetoothCsipSetCoordinator implements BluetoothProfile, Auto
                service.unlockGroup(new ParcelUuid(lockUuid), mAttributionSource);
                return true;
            } catch (RemoteException e) {
                throw e.rethrowAsRuntimeException();
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            }
        }
        return false;
@@ -350,7 +350,7 @@ public final class BluetoothCsipSetCoordinator implements BluetoothProfile, Auto
            try {
                return service.getGroupUuidMapByDevice(device, mAttributionSource);
            } catch (RemoteException e) {
                throw e.rethrowAsRuntimeException();
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            }
        }
        return new HashMap<>();
@@ -375,7 +375,7 @@ public final class BluetoothCsipSetCoordinator implements BluetoothProfile, Auto
            try {
                return service.getAllGroupIds(uuid, mAttributionSource);
            } catch (RemoteException e) {
                throw e.rethrowAsRuntimeException();
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            }
        }
        return Collections.emptyList();
@@ -395,7 +395,7 @@ public final class BluetoothCsipSetCoordinator implements BluetoothProfile, Auto
            try {
                return service.getConnectedDevices(mAttributionSource);
            } catch (RemoteException e) {
                throw e.rethrowAsRuntimeException();
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            }
        }
        return Collections.emptyList();
@@ -416,7 +416,7 @@ public final class BluetoothCsipSetCoordinator implements BluetoothProfile, Auto
            try {
                return service.getDevicesMatchingConnectionStates(states, mAttributionSource);
            } catch (RemoteException e) {
                throw e.rethrowAsRuntimeException();
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            }
        }
        return Collections.emptyList();
@@ -437,7 +437,7 @@ public final class BluetoothCsipSetCoordinator implements BluetoothProfile, Auto
            try {
                return service.getConnectionState(device, mAttributionSource);
            } catch (RemoteException e) {
                throw e.rethrowAsRuntimeException();
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            }
        }
        return BluetoothProfile.STATE_DISCONNECTED;
@@ -472,7 +472,7 @@ public final class BluetoothCsipSetCoordinator implements BluetoothProfile, Auto
            try {
                return service.setConnectionPolicy(device, connectionPolicy, mAttributionSource);
            } catch (RemoteException e) {
                throw e.rethrowAsRuntimeException();
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            }
        }
        return false;
@@ -501,7 +501,7 @@ public final class BluetoothCsipSetCoordinator implements BluetoothProfile, Auto
            try {
                return service.getConnectionPolicy(device, mAttributionSource);
            } catch (RemoteException e) {
                throw e.rethrowAsRuntimeException();
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            }
        }
        return BluetoothProfile.CONNECTION_POLICY_FORBIDDEN;
+25 −125
Original line number Diff line number Diff line
@@ -280,11 +280,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
     */
    @SuppressLint("ActionValue")
    @RequiresBluetoothConnectPermission
    @RequiresPermission(
            allOf = {
                BLUETOOTH_CONNECT,
                BLUETOOTH_PRIVILEGED,
            })
    @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED})
    @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
    @SystemApi
    public static final String ACTION_SWITCH_BUFFER_SIZE =
@@ -308,11 +304,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
     */
    @FlaggedApi(Flags.FLAG_KEY_MISSING_BROADCAST)
    @SuppressLint("ActionValue")
    @RequiresPermission(
            allOf = {
                BLUETOOTH_CONNECT,
                BLUETOOTH_PRIVILEGED,
            })
    @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED})
    @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
    @SystemApi
    @BroadcastBehavior(includeBackground = true, protectedBroadcast = true)
@@ -1592,11 +1584,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
     */
    @SystemApi
    @RequiresBluetoothConnectPermission
    @RequiresPermission(
            allOf = {
                BLUETOOTH_CONNECT,
                BLUETOOTH_PRIVILEGED,
            })
    @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED})
    public @Nullable String getIdentityAddress() {
        if (DBG) log("getIdentityAddress()");
        final IBluetooth service = getService();
@@ -1745,7 +1733,6 @@ public final class BluetoothDevice implements Parcelable, Attributable {
                return service.setRemoteAlias(this, alias, mAttributionSource);
            } catch (RemoteException e) {
                Log.e(TAG, "", e);
                throw e.rethrowAsRuntimeException();
            }
        }
        return BluetoothStatusCodes.ERROR_BLUETOOTH_NOT_ENABLED;
@@ -2064,11 +2051,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
     * @hide
     */
    @SystemApi
    @RequiresPermission(
            allOf = {
                BLUETOOTH_CONNECT,
                BLUETOOTH_PRIVILEGED,
            })
    @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED})
    public boolean canBondWithoutDialog() {
        if (DBG) log("canBondWithoutDialog, device: " + this);
        final IBluetooth service = getService();
@@ -2093,13 +2076,8 @@ public final class BluetoothDevice implements Parcelable, Attributable {
     * @hide
     */
    @SystemApi
    @Nullable
    @RequiresPermission(
            allOf = {
                BLUETOOTH_CONNECT,
                BLUETOOTH_PRIVILEGED,
            })
    public String getPackageNameOfBondingApplication() {
    @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED})
    public @Nullable String getPackageNameOfBondingApplication() {
        if (DBG) log("getPackageNameOfBondingApplication()");
        final IBluetooth service = getService();
        if (service == null || !isBluetoothEnabled()) {
@@ -2142,12 +2120,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
     */
    @SystemApi
    @RequiresBluetoothConnectPermission
    @RequiresPermission(
            allOf = {
                BLUETOOTH_CONNECT,
                BLUETOOTH_PRIVILEGED,
                MODIFY_PHONE_STATE,
            })
    @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED, MODIFY_PHONE_STATE})
    public @ConnectionReturnValues int connect() {
        if (DBG) log("connect()");
        if (!BluetoothAdapter.checkBluetoothAddress(getAddress())) {
@@ -2162,7 +2135,6 @@ public final class BluetoothDevice implements Parcelable, Attributable {
                return service.connectAllEnabledProfiles(this, mAttributionSource);
            } catch (RemoteException e) {
                Log.e(TAG, "", e);
                throw e.rethrowAsRuntimeException();
            }
        }
        return BluetoothStatusCodes.ERROR_BLUETOOTH_NOT_ENABLED;
@@ -2185,11 +2157,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
     */
    @SystemApi
    @RequiresBluetoothConnectPermission
    @RequiresPermission(
            allOf = {
                BLUETOOTH_CONNECT,
                BLUETOOTH_PRIVILEGED,
            })
    @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED})
    public @ConnectionReturnValues int disconnect() {
        if (DBG) log("disconnect()");
        if (!BluetoothAdapter.checkBluetoothAddress(getAddress())) {
@@ -2204,7 +2172,6 @@ public final class BluetoothDevice implements Parcelable, Attributable {
                return service.disconnectAllEnabledProfiles(this, mAttributionSource);
            } catch (RemoteException e) {
                Log.e(TAG, "", e);
                throw e.rethrowAsRuntimeException();
            }
        }
        return BluetoothStatusCodes.ERROR_BLUETOOTH_NOT_ENABLED;
@@ -2251,11 +2218,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
     * @hide
     */
    @SystemApi
    @RequiresPermission(
            allOf = {
                BLUETOOTH_CONNECT,
                BLUETOOTH_PRIVILEGED,
            })
    @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED})
    public int getConnectionHandle(@Transport int transport) {
        if (DBG) {
            log("getConnectionHandle()");
@@ -2406,10 +2369,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
     */
    @SystemApi
    @RequiresPermission(
            allOf = {
                BLUETOOTH_CONNECT,
                BLUETOOTH_PRIVILEGED,
            },
            allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED},
            conditional = true)
    public boolean fetchUuidsWithSdp(@Transport int transport) {
        if (DBG) log("fetchUuidsWithSdp()");
@@ -2510,11 +2470,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
     *
     * @return true confirmation has been sent out false for error
     */
    @RequiresPermission(
            allOf = {
                BLUETOOTH_CONNECT,
                BLUETOOTH_PRIVILEGED,
            })
    @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED})
    public boolean setPairingConfirmation(boolean confirm) {
        if (DBG) log("setPairingConfirmation()");
        final IBluetooth service = getService();
@@ -2587,11 +2543,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
     * @hide
     */
    @SystemApi
    @RequiresPermission(
            allOf = {
                BLUETOOTH_CONNECT,
                BLUETOOTH_PRIVILEGED,
            })
    @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED})
    public boolean setSilenceMode(boolean silence) {
        if (DBG) log("setSilenceMode()");
        final IBluetooth service = getService();
@@ -2615,11 +2567,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
     * @hide
     */
    @SystemApi
    @RequiresPermission(
            allOf = {
                BLUETOOTH_CONNECT,
                BLUETOOTH_PRIVILEGED,
            })
    @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED})
    public boolean isInSilenceMode() {
        if (DBG) log("isInSilenceMode()");
        final IBluetooth service = getService();
@@ -2644,11 +2592,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
     * @hide
     */
    @SystemApi
    @RequiresPermission(
            allOf = {
                BLUETOOTH_CONNECT,
                BLUETOOTH_PRIVILEGED,
            })
    @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED})
    public boolean setPhonebookAccessPermission(@AccessPermission int value) {
        if (DBG) log("setPhonebookAccessPermission()");
        final IBluetooth service = getService();
@@ -2701,11 +2645,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
     * @hide
     */
    @SystemApi
    @RequiresPermission(
            allOf = {
                BLUETOOTH_CONNECT,
                BLUETOOTH_PRIVILEGED,
            })
    @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED})
    public boolean setMessageAccessPermission(@AccessPermission int value) {
        // Validates param value is one of the accepted constants
        if (value != ACCESS_ALLOWED && value != ACCESS_REJECTED && value != ACCESS_UNKNOWN) {
@@ -2762,11 +2702,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
     * @hide
     */
    @SystemApi
    @RequiresPermission(
            allOf = {
                BLUETOOTH_CONNECT,
                BLUETOOTH_PRIVILEGED,
            })
    @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED})
    public boolean setSimAccessPermission(int value) {
        if (DBG) log("setSimAccessPermission()");
        final IBluetooth service = getService();
@@ -3272,11 +3208,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
     * @hide
     */
    @SystemApi
    @RequiresPermission(
            allOf = {
                BLUETOOTH_CONNECT,
                BLUETOOTH_PRIVILEGED,
            })
    @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED})
    public boolean setMetadata(@MetadataKey int key, @NonNull byte[] value) {
        if (DBG) log("setMetadata()");
        final IBluetooth service = getService();
@@ -3304,13 +3236,8 @@ public final class BluetoothDevice implements Parcelable, Attributable {
     * @hide
     */
    @SystemApi
    @Nullable
    @RequiresPermission(
            allOf = {
                BLUETOOTH_CONNECT,
                BLUETOOTH_PRIVILEGED,
            })
    public byte[] getMetadata(@MetadataKey int key) {
    @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED})
    public @Nullable byte[] getMetadata(@MetadataKey int key) {
        if (DBG) log("getMetadata()");
        final IBluetooth service = getService();
        if (service == null || !isBluetoothEnabled()) {
@@ -3380,11 +3307,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
     */
    @SystemApi
    @RequiresBluetoothConnectPermission
    @RequiresPermission(
            allOf = {
                BLUETOOTH_CONNECT,
                BLUETOOTH_PRIVILEGED,
            })
    @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED})
    public @AudioPolicyRemoteSupport int isRequestAudioPolicyAsSinkSupported() {
        if (DBG) log("isRequestAudioPolicyAsSinkSupported()");
        final IBluetooth service = getService();
@@ -3396,7 +3319,6 @@ public final class BluetoothDevice implements Parcelable, Attributable {
                return service.isRequestAudioPolicyAsSinkSupported(this, mAttributionSource);
            } catch (RemoteException e) {
                Log.e(TAG, "", e);
                throw e.rethrowAsRuntimeException();
            }
        }
        return BluetoothStatusCodes.FEATURE_NOT_CONFIGURED;
@@ -3419,11 +3341,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
     */
    @SystemApi
    @RequiresBluetoothConnectPermission
    @RequiresPermission(
            allOf = {
                BLUETOOTH_CONNECT,
                BLUETOOTH_PRIVILEGED,
            })
    @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED})
    public @AudioPolicyReturnValues int requestAudioPolicyAsSink(
            @NonNull BluetoothSinkAudioPolicy policies) {
        if (DBG) log("requestAudioPolicyAsSink");
@@ -3461,11 +3379,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
     */
    @SystemApi
    @RequiresBluetoothConnectPermission
    @RequiresPermission(
            allOf = {
                BLUETOOTH_CONNECT,
                BLUETOOTH_PRIVILEGED,
            })
    @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED})
    public @Nullable BluetoothSinkAudioPolicy getRequestedAudioPolicyAsSink() {
        if (DBG) log("getRequestedAudioPolicyAsSink");
        final IBluetooth service = getService();
@@ -3492,11 +3406,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
     */
    @SystemApi
    @RequiresBluetoothConnectPermission
    @RequiresPermission(
            allOf = {
                BLUETOOTH_CONNECT,
                BLUETOOTH_PRIVILEGED,
            })
    @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED})
    public boolean setLowLatencyAudioAllowed(boolean allowed) {
        if (DBG) log("setLowLatencyAudioAllowed(" + allowed + ")");
        final IBluetooth service = getService();
@@ -3556,11 +3466,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
    @FlaggedApi(Flags.FLAG_METADATA_API_INACTIVE_AUDIO_DEVICE_UPON_CONNECTION)
    @SystemApi
    @RequiresBluetoothConnectPermission
    @RequiresPermission(
            allOf = {
                BLUETOOTH_CONNECT,
                BLUETOOTH_PRIVILEGED,
            })
    @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED})
    public @SetActiveAudioDevicePolicyReturnValues int setActiveAudioDevicePolicy(
            @ActiveAudioDevicePolicy int activeAudioDevicePolicy) {
        if (DBG) log("setActiveAudioDevicePolicy(" + activeAudioDevicePolicy + ")");
@@ -3578,7 +3484,6 @@ public final class BluetoothDevice implements Parcelable, Attributable {
                        this, activeAudioDevicePolicy, mAttributionSource);
            } catch (RemoteException e) {
                Log.e(TAG, "", e);
                throw e.rethrowAsRuntimeException();
            }
        }
        return BluetoothStatusCodes.ERROR_BLUETOOTH_NOT_ENABLED;
@@ -3593,11 +3498,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
    @FlaggedApi(Flags.FLAG_METADATA_API_INACTIVE_AUDIO_DEVICE_UPON_CONNECTION)
    @SystemApi
    @RequiresBluetoothConnectPermission
    @RequiresPermission(
            allOf = {
                BLUETOOTH_CONNECT,
                BLUETOOTH_PRIVILEGED,
            })
    @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED})
    public @ActiveAudioDevicePolicy int getActiveAudioDevicePolicy() {
        if (DBG) log("getActiveAudioDevicePolicy");
        final IBluetooth service = getService();
@@ -3609,7 +3510,6 @@ public final class BluetoothDevice implements Parcelable, Attributable {
                return service.getActiveAudioDevicePolicy(this, mAttributionSource);
            } catch (RemoteException e) {
                Log.e(TAG, "", e);
                throw e.rethrowAsRuntimeException();
            }
        }
        return ACTIVE_AUDIO_DEVICE_POLICY_DEFAULT;
+19 −19
Original line number Diff line number Diff line
@@ -589,7 +589,7 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable
            try {
                return service.setConnectionPolicy(device, connectionPolicy, mAttributionSource);
            } catch (RemoteException e) {
                throw e.rethrowAsRuntimeException();
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            }
        }
        return false;
@@ -617,7 +617,7 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable
            try {
                return service.getConnectionPolicy(device, mAttributionSource);
            } catch (RemoteException e) {
                throw e.rethrowAsRuntimeException();
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            }
        }
        return BluetoothProfile.CONNECTION_POLICY_FORBIDDEN;
@@ -641,7 +641,7 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable
                return Attributable.setAttributionSource(
                        service.getConnectedDevices(mAttributionSource), mAttributionSource);
            } catch (RemoteException e) {
                throw e.rethrowAsRuntimeException();
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            }
        }
        return Collections.emptyList();
@@ -667,7 +667,7 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable
                        service.getDevicesMatchingConnectionStates(states, mAttributionSource),
                        mAttributionSource);
            } catch (RemoteException e) {
                throw e.rethrowAsRuntimeException();
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            }
        }
        return Collections.emptyList();
@@ -691,7 +691,7 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable
            try {
                return service.getConnectionState(device, mAttributionSource);
            } catch (RemoteException e) {
                throw e.rethrowAsRuntimeException();
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            }
        }
        return BluetoothProfile.STATE_DISCONNECTED;
@@ -727,7 +727,7 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable
            try {
                return service.getHapGroup(device, mAttributionSource);
            } catch (RemoteException e) {
                throw e.rethrowAsRuntimeException();
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            }
        }
        return BluetoothCsipSetCoordinator.GROUP_ID_INVALID;
@@ -752,7 +752,7 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable
            try {
                return service.getActivePresetIndex(device, mAttributionSource);
            } catch (RemoteException e) {
                throw e.rethrowAsRuntimeException();
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            }
        }
        return PRESET_INDEX_UNAVAILABLE;
@@ -777,7 +777,7 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable
            try {
                return service.getActivePresetInfo(device, mAttributionSource);
            } catch (RemoteException e) {
                throw e.rethrowAsRuntimeException();
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            }
        }

@@ -806,7 +806,7 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable
            try {
                service.selectPreset(device, presetIndex, mAttributionSource);
            } catch (RemoteException e) {
                throw e.rethrowAsRuntimeException();
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            }
        }
    }
@@ -837,7 +837,7 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable
            try {
                service.selectPresetForGroup(groupId, presetIndex, mAttributionSource);
            } catch (RemoteException e) {
                throw e.rethrowAsRuntimeException();
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            }
        }
    }
@@ -863,7 +863,7 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable
            try {
                service.switchToNextPreset(device, mAttributionSource);
            } catch (RemoteException e) {
                throw e.rethrowAsRuntimeException();
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            }
        }
    }
@@ -892,7 +892,7 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable
            try {
                service.switchToNextPresetForGroup(groupId, mAttributionSource);
            } catch (RemoteException e) {
                throw e.rethrowAsRuntimeException();
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            }
        }
    }
@@ -918,7 +918,7 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable
            try {
                service.switchToPreviousPreset(device, mAttributionSource);
            } catch (RemoteException e) {
                throw e.rethrowAsRuntimeException();
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            }
        }
    }
@@ -947,7 +947,7 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable
            try {
                service.switchToPreviousPresetForGroup(groupId, mAttributionSource);
            } catch (RemoteException e) {
                throw e.rethrowAsRuntimeException();
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            }
        }
    }
@@ -973,7 +973,7 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable
            try {
                return service.getPresetInfo(device, presetIndex, mAttributionSource);
            } catch (RemoteException e) {
                throw e.rethrowAsRuntimeException();
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            }
        }
        return null;
@@ -997,7 +997,7 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable
            try {
                return service.getAllPresetInfo(device, mAttributionSource);
            } catch (RemoteException e) {
                throw e.rethrowAsRuntimeException();
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            }
        }
        return Collections.emptyList();
@@ -1020,7 +1020,7 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable
            try {
                return service.getFeatures(device, mAttributionSource);
            } catch (RemoteException e) {
                throw e.rethrowAsRuntimeException();
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            }
        }
        return 0x00;
@@ -1126,7 +1126,7 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable
            try {
                service.setPresetName(device, presetIndex, name, mAttributionSource);
            } catch (RemoteException e) {
                throw e.rethrowAsRuntimeException();
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            }
        }
    }
@@ -1157,7 +1157,7 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable
            try {
                service.setPresetNameForGroup(groupId, presetIndex, name, mAttributionSource);
            } catch (RemoteException e) {
                throw e.rethrowAsRuntimeException();
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            }
        }
    }
+8 −45

File changed.

Preview size limit exceeded, changes collapsed.

Loading