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

Commit 9d862105 authored by Jack He's avatar Jack He
Browse files

[Manual] Fix checkstyle errors (2/2)

* Mannually fixed several styles errors that cannot be corrected through
  automatic formatter

Bug: 63597465
Test: make checkbuild, no functional changes
Change-Id: Idc1763b6be431f8cb3bc5f6807973e45512d99ef
parent 944f8d07
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -301,14 +301,14 @@ public final class Utils {
     */
    public static boolean checkCallerHasLocationPermission(Context context, AppOpsManager appOps,
            String callingPackage) {
        if (context.checkCallingOrSelfPermission(android.Manifest.permission.
                ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED && isAppOppAllowed(
        if (context.checkCallingOrSelfPermission(android.Manifest.permission.ACCESS_FINE_LOCATION)
                == PackageManager.PERMISSION_GRANTED && isAppOppAllowed(
                        appOps, AppOpsManager.OP_FINE_LOCATION, callingPackage)) {
            return true;
        }

        if (context.checkCallingOrSelfPermission(android.Manifest.permission.
                ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED && isAppOppAllowed(
        if (context.checkCallingOrSelfPermission(android.Manifest.permission.ACCESS_COARSE_LOCATION)
                == PackageManager.PERMISSION_GRANTED && isAppOppAllowed(
                        appOps, AppOpsManager.OP_COARSE_LOCATION, callingPackage)) {
            return true;
        }
+23 −20
Original line number Diff line number Diff line
@@ -314,8 +314,9 @@ public class AvrcpControllerService extends ProfileService {
            return;
        }
        enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
        Message msg = mAvrcpCtSm.obtainMessage(AvrcpControllerStateMachine.
                MESSAGE_SEND_GROUP_NAVIGATION_CMD, keyCode, keyState, device);
        Message msg = mAvrcpCtSm.obtainMessage(
                AvrcpControllerStateMachine.MESSAGE_SEND_GROUP_NAVIGATION_CMD,
                keyCode, keyState, device);
        mAvrcpCtSm.sendMessage(msg);
    }

@@ -820,8 +821,9 @@ public class AvrcpControllerService extends ProfileService {
            Log.e(TAG, "handleRegisterNotificationAbsVol device not found " + address);
            return;
        }
        Message msg = mAvrcpCtSm.obtainMessage(AvrcpControllerStateMachine.
                MESSAGE_PROCESS_REGISTER_ABS_VOL_NOTIFICATION, (int) label, 0);
        Message msg = mAvrcpCtSm.obtainMessage(
                AvrcpControllerStateMachine.MESSAGE_PROCESS_REGISTER_ABS_VOL_NOTIFICATION,
                (int) label, 0);
        mAvrcpCtSm.sendMessage(msg);
    }

@@ -859,8 +861,8 @@ public class AvrcpControllerService extends ProfileService {
        if (DBG) {
            Log.d(TAG, "onTrackChanged " + trackInfo);
        }
        Message msg = mAvrcpCtSm.obtainMessage(AvrcpControllerStateMachine.
                MESSAGE_PROCESS_TRACK_CHANGED, trackInfo);
        Message msg = mAvrcpCtSm.obtainMessage(
                AvrcpControllerStateMachine.MESSAGE_PROCESS_TRACK_CHANGED, trackInfo);
        mAvrcpCtSm.sendMessage(msg);
    }

@@ -875,8 +877,9 @@ public class AvrcpControllerService extends ProfileService {
            Log.e(TAG, "onPlayPositionChanged not found device not found " + address);
            return;
        }
        Message msg = mAvrcpCtSm.obtainMessage(AvrcpControllerStateMachine.
                MESSAGE_PROCESS_PLAY_POS_CHANGED, songLen, currSongPosition);
        Message msg = mAvrcpCtSm.obtainMessage(
                AvrcpControllerStateMachine.MESSAGE_PROCESS_PLAY_POS_CHANGED,
                songLen, currSongPosition);
        mAvrcpCtSm.sendMessage(msg);
    }

@@ -910,8 +913,8 @@ public class AvrcpControllerService extends ProfileService {
            default:
                playbackState = PlaybackState.STATE_NONE;
        }
        Message msg = mAvrcpCtSm.obtainMessage(AvrcpControllerStateMachine.
                MESSAGE_PROCESS_PLAY_STATUS_CHANGED, playbackState);
        Message msg = mAvrcpCtSm.obtainMessage(
                AvrcpControllerStateMachine.MESSAGE_PROCESS_PLAY_STATUS_CHANGED, playbackState);
        mAvrcpCtSm.sendMessage(msg);
    }

@@ -926,8 +929,8 @@ public class AvrcpControllerService extends ProfileService {
            Log.e(TAG, "handlePlayerAppSetting not found device not found " + address);
            return;
        }
        PlayerApplicationSettings supportedSettings = PlayerApplicationSettings.
                makeSupportedSettings(playerAttribRsp);
        PlayerApplicationSettings supportedSettings =
                PlayerApplicationSettings.makeSupportedSettings(playerAttribRsp);
        /* Do nothing */
    }

@@ -941,8 +944,8 @@ public class AvrcpControllerService extends ProfileService {
            Log.e(TAG, "onPlayerAppSettingChanged not found device not found " + address);
            return;
        }
        PlayerApplicationSettings desiredSettings = PlayerApplicationSettings.
                makeSettings(playerAttribRsp);
        PlayerApplicationSettings desiredSettings =
                PlayerApplicationSettings.makeSettings(playerAttribRsp);
        /* Do nothing */
    }

@@ -957,8 +960,8 @@ public class AvrcpControllerService extends ProfileService {
            Log.w(TAG, "Sending out of range message.");
            // Send a special message since this could be used by state machine
            // to take as a signal that fetch is finished.
            Message msg = mAvrcpCtSm.obtainMessage(AvrcpControllerStateMachine.
                    MESSAGE_PROCESS_GET_FOLDER_ITEMS_OUT_OF_RANGE);
            Message msg = mAvrcpCtSm.obtainMessage(
                    AvrcpControllerStateMachine.MESSAGE_PROCESS_GET_FOLDER_ITEMS_OUT_OF_RANGE);
            mAvrcpCtSm.sendMessage(msg);
            return;
        }
@@ -972,8 +975,8 @@ public class AvrcpControllerService extends ProfileService {
        for (MediaItem item : items) {
            itemsList.add(item);
        }
        Message msg = mAvrcpCtSm.obtainMessage(AvrcpControllerStateMachine.
                MESSAGE_PROCESS_GET_FOLDER_ITEMS, itemsList);
        Message msg = mAvrcpCtSm.obtainMessage(
                AvrcpControllerStateMachine.MESSAGE_PROCESS_GET_FOLDER_ITEMS, itemsList);
        mAvrcpCtSm.sendMessage(msg);
    }

@@ -991,8 +994,8 @@ public class AvrcpControllerService extends ProfileService {
            itemsList.add(p);
        }

        Message msg = mAvrcpCtSm.obtainMessage(AvrcpControllerStateMachine.
                MESSAGE_PROCESS_GET_PLAYER_ITEMS, itemsList);
        Message msg = mAvrcpCtSm.obtainMessage(
                AvrcpControllerStateMachine.MESSAGE_PROCESS_GET_PLAYER_ITEMS, itemsList);
        mAvrcpCtSm.sendMessage(msg);
    }

+10 −10
Original line number Diff line number Diff line
@@ -420,8 +420,8 @@ class AvrcpControllerStateMachine extends StateMachine {
                    case MESSAGE_PROCESS_TRACK_CHANGED:
                        mAddressedPlayer.updateCurrentTrack((TrackInfo) msg.obj);
                        if (mBroadcastMetadata) {
                            broadcastMetaDataChanged(mAddressedPlayer.getCurrentTrack().
                                    getMediaMetaData());
                            broadcastMetaDataChanged(
                                    mAddressedPlayer.getCurrentTrack().getMediaMetaData());
                        }
                        break;

@@ -1133,23 +1133,23 @@ class AvrcpControllerStateMachine extends StateMachine {
        }
        if ((supportedSetting & BluetoothAvrcpPlayerSettings.SETTING_EQUALIZER) != 0) {
            sb.append(" EQ : ");
            sb.append(Integer.toString(mSett.getSettingValue(BluetoothAvrcpPlayerSettings.
                    SETTING_EQUALIZER)));
            sb.append(Integer.toString(mSett.getSettingValue(
                    BluetoothAvrcpPlayerSettings.SETTING_EQUALIZER)));
        }
        if ((supportedSetting & BluetoothAvrcpPlayerSettings.SETTING_REPEAT) != 0) {
            sb.append(" REPEAT : ");
            sb.append(Integer.toString(mSett.getSettingValue(BluetoothAvrcpPlayerSettings.
                    SETTING_REPEAT)));
            sb.append(Integer.toString(mSett.getSettingValue(
                    BluetoothAvrcpPlayerSettings.SETTING_REPEAT)));
        }
        if ((supportedSetting & BluetoothAvrcpPlayerSettings.SETTING_SHUFFLE) != 0) {
            sb.append(" SHUFFLE : ");
            sb.append(Integer.toString(mSett.getSettingValue(BluetoothAvrcpPlayerSettings.
                    SETTING_SHUFFLE)));
            sb.append(Integer.toString(mSett.getSettingValue(
                    BluetoothAvrcpPlayerSettings.SETTING_SHUFFLE)));
        }
        if ((supportedSetting & BluetoothAvrcpPlayerSettings.SETTING_SCAN) != 0) {
            sb.append(" SCAN : ");
            sb.append(Integer.toString(mSett.getSettingValue(BluetoothAvrcpPlayerSettings.
                    SETTING_SCAN)));
            sb.append(Integer.toString(mSett.getSettingValue(
                    BluetoothAvrcpPlayerSettings.SETTING_SCAN)));
        }
        return sb.toString();
    }
+3 −4
Original line number Diff line number Diff line
@@ -263,10 +263,9 @@ public class GattService extends ProfileService {
        for (BluetoothGattService service : db) {
            for (BluetoothGattCharacteristic characteristic : service.getCharacteristics()) {
                if (handle == characteristic.getInstanceId()) {
                    return !(
                            (isRestrictedCharUuid(characteristic.getUuid()) || isRestrictedSrvcUuid(
                                    service.getUuid())) && (0 != checkCallingOrSelfPermission(
                                    BLUETOOTH_PRIVILEGED)));
                    return !((isRestrictedCharUuid(characteristic.getUuid())
                            || isRestrictedSrvcUuid(service.getUuid()))
                            && (0 != checkCallingOrSelfPermission(BLUETOOTH_PRIVILEGED)));
                }

                for (BluetoothGattDescriptor descriptor : characteristic.getDescriptors()) {
+7 −6
Original line number Diff line number Diff line
@@ -1922,8 +1922,9 @@ public class BluetoothMapContentObserver {

                    if (mMapEventReportVersion != BluetoothMapUtils.MAP_EVENT_REPORT_V10
                            && mMapEventReportVersion != BluetoothMapUtils.MAP_EVENT_REPORT_V11) {
                        c = mProviderClient.query(mContactUri, BluetoothMapContract.
                                BT_CONTACT_CHATSTATE_PRESENCE_PROJECTION, null, null, null);
                        c = mProviderClient.query(mContactUri,
                                BluetoothMapContract.BT_CONTACT_CHATSTATE_PRESENCE_PROJECTION,
                                null, null, null);
                        cInfo.setConvoColunms(c);
                    } else {
                        if (V) {
@@ -2116,8 +2117,8 @@ public class BluetoothMapContentObserver {

        int updateCount = 0;
        ContentValues contentValues = new ContentValues();
        BluetoothMapFolderElement deleteFolder = mFolders.
                getFolderByName(BluetoothMapContract.FOLDER_NAME_DELETED);
        BluetoothMapFolderElement deleteFolder =
                mFolders.getFolderByName(BluetoothMapContract.FOLDER_NAME_DELETED);
        contentValues.put(BluetoothMapContract.MessageColumns._ID, handle);
        synchronized (getMsgListMsg()) {
            Msg msg = getMsgListMsg().get(handle);
@@ -2153,8 +2154,8 @@ public class BluetoothMapContentObserver {
                        && msg.folderId == deleteFolder.getFolderId()) {
                    /* Only modify messages in the 'Deleted' folder */
                    long folderId = -1;
                    BluetoothMapFolderElement inboxFolder = mCurrentFolder.
                            getFolderByName(BluetoothMapContract.FOLDER_NAME_INBOX);
                    BluetoothMapFolderElement inboxFolder =
                            mCurrentFolder.getFolderByName(BluetoothMapContract.FOLDER_NAME_INBOX);
                    if (msg != null && msg.oldFolderId != -1) {
                        folderId = msg.oldFolderId;
                    } else {
Loading