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

Commit 28e0bc97 authored by Jack He's avatar Jack He Committed by android-build-merger
Browse files

Merge "[Manual] Assorted fixes for CheckStyle"

am: 4c3e92d0

Change-Id: I579175952844a6a72cff8f28e2eadd9790a176cb
parents af6fcfff 4c3e92d0
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
@@ -880,22 +880,21 @@ final class A2dpStateMachine extends StateMachine {
    boolean okToConnect(BluetoothDevice device) {
        AdapterService adapterService = AdapterService.getAdapterService();
        int priority = mService.getPriority(device);
        boolean ret = false;
        //check if this is an incoming connection in Quiet mode.
        if((adapterService == null) ||
           ((adapterService.isQuietModeEnabled()) &&
           (mTargetDevice == null))) {
            ret = false;
            return false;
        }
        // check priority and accept or reject the connection. if priority is undefined
        // it is likely that our SDP has not completed and peer is initiating the
        // connection. Allow this connection, provided the device is bonded
        else if((BluetoothProfile.PRIORITY_OFF < priority) ||
                ((BluetoothProfile.PRIORITY_UNDEFINED == priority) &&
                (device.getBondState() != BluetoothDevice.BOND_NONE))){
            ret= true;
        if ((BluetoothProfile.PRIORITY_OFF < priority) || (
                (BluetoothProfile.PRIORITY_UNDEFINED == priority) && (device.getBondState()
                        != BluetoothDevice.BOND_NONE))) {
            return true;
        }
        return ret;
        return false;
    }

    synchronized List<BluetoothDevice> getDevicesMatchingConnectionStates(int[] states) {
+5 −5
Original line number Diff line number Diff line
@@ -147,13 +147,13 @@ class PlayerApplicationSettings {
        try {
            if ((supportedSettings & settingSubset) == settingSubset) {
                for (Integer settingId : mSettings.keySet()) {
                    if ((settingId & settingSubset )== settingId &&
                        (!mSupportedValues.get(settingId).contains(settingsToCheck.
                            getSettingValue(settingId))))
                    // The setting is in both settings to check and supported settings but the
                    // value is not supported.
                    if ((settingId & settingSubset) == settingId && (!mSupportedValues.get(
                            settingId).contains(settingsToCheck.getSettingValue(settingId)))) {
                        return false;
                    }
                }
                return true;
            }
        } catch (NullPointerException e) {
+8 −16
Original line number Diff line number Diff line
@@ -226,10 +226,8 @@ public class GattService extends ProfileService {
    }

    boolean permissionCheck(UUID uuid) {
        if (isRestrictedCharUuid(uuid) && (0 != checkCallingOrSelfPermission(BLUETOOTH_PRIVILEGED)))
            return false;
        else
            return true;
        return !(isRestrictedCharUuid(uuid) && (0 != checkCallingOrSelfPermission(
                BLUETOOTH_PRIVILEGED)));
    }

    boolean permissionCheck(int connId, int handle) {
@@ -239,22 +237,16 @@ public class GattService extends ProfileService {
        for (BluetoothGattService service : db) {
            for (BluetoothGattCharacteristic characteristic: service.getCharacteristics()) {
                if (handle == characteristic.getInstanceId()) {
                    if ((isRestrictedCharUuid(characteristic.getUuid()) ||
                         isRestrictedSrvcUuid(service.getUuid())) &&
                        (0 != checkCallingOrSelfPermission(BLUETOOTH_PRIVILEGED)))
                        return false;
                    else
                        return true;
                    return !((isRestrictedCharUuid(characteristic.getUuid())
                            || isRestrictedSrvcUuid(service.getUuid()))
                            && (0 != checkCallingOrSelfPermission(BLUETOOTH_PRIVILEGED)));
                }

                for (BluetoothGattDescriptor descriptor: characteristic.getDescriptors()) {
                    if (handle == descriptor.getInstanceId()) {
                        if ((isRestrictedCharUuid(characteristic.getUuid()) ||
                             isRestrictedSrvcUuid(service.getUuid())) &&
                            (0 != checkCallingOrSelfPermission(BLUETOOTH_PRIVILEGED)))
                            return false;
                        else
                            return true;
                        return !((isRestrictedCharUuid(characteristic.getUuid())
                                || isRestrictedSrvcUuid(service.getUuid()))
                                && (0 != checkCallingOrSelfPermission(BLUETOOTH_PRIVILEGED)));
                    }
                }
            }
+2 −3
Original line number Diff line number Diff line
@@ -277,9 +277,8 @@ public class HealthService extends ProfileService {
                            Log.e(TAG, "failed to dup ParcelFileDescriptor");
                            break;
                        }
                    }
                    } else{
                        /*set the channel fd to null if channel state isnot equal to connected*/
                    else{
                        chan.mChannelFd = null;
                    }
                    callHealthChannelCallback(chan.mConfig, chan.mDevice, newState,
+3 −3
Original line number Diff line number Diff line
@@ -324,10 +324,10 @@ public class AtPhonebook {
                }
                String atCommand = (atString.split("="))[1];
                String[] indices = atCommand.split(",");
                for(int i = 0; i < indices.length; i++)
                //replace AT command separator ';' from the index if any
                for (int i = 0; i < indices.length; i++) {
                    indices[i] = indices[i].replace(';', ' ').trim();
                try {
                } try {
                    index1 = Integer.parseInt(indices[0]);
                    if (indices.length == 1)
                        index2 = index1;
Loading