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

Commit 023cccba authored by William Escande's avatar William Escande
Browse files

errorprone: activate EnumOrdinal

Bug: 344658662
Test: m com.android.btservices
Flag: Exempt lint enforcement
Change-Id: I2951e2a779749f181ff713f923c098d838ba0965
parent b2437054
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -112,6 +112,7 @@ java_defaults {
            "-Xep:DirectInvocationOnMock:ERROR",
            "-Xep:EmptyBlockTag:ERROR",
            "-Xep:EmptyCatch:ERROR",
            "-Xep:EnumOrdinal:ERROR",
            "-Xep:EqualsGetClass:ERROR",
            "-Xep:EqualsHashCode:ERROR",
            "-Xep:EqualsIncompatibleType:ERROR",
+3 −0
Original line number Diff line number Diff line
@@ -3352,6 +3352,7 @@ public class BluetoothMapContentObserver {
        return handle;
    }

    @SuppressWarnings("EnumOrdinal") // remove entire usage of internal intent
    public long sendMmsMessage(
            String folder,
            String[] toAddress,
@@ -4090,6 +4091,7 @@ public class BluetoothMapContentObserver {
        }
    }

    @SuppressWarnings("EnumOrdinal") // remove entire usage of internal intent
    public static void actionMessageSentDisconnected(Context context, Intent intent, int result) {
        TYPE type =
                TYPE.fromOrdinal(
@@ -4277,6 +4279,7 @@ public class BluetoothMapContentObserver {
        }
    }

    @SuppressWarnings("EnumOrdinal") // remove entire usage of internal intent
    public boolean handleSmsSendIntent(Context context, Intent intent) {
        TYPE type =
                TYPE.fromOrdinal(
+2 −1
Original line number Diff line number Diff line
@@ -1036,6 +1036,7 @@ public class TbsGatt {
        return mTbsService.getDeviceAuthorization(device);
    }

    @SuppressWarnings("EnumOrdinal")
    private void onRejectedAuthorizationGattOperation(BluetoothDevice device, GattOpContext op) {
        UUID charUuid =
                (op.mCharacteristic != null
@@ -1102,7 +1103,7 @@ public class TbsGatt {
        boolean allowToReadRealValue = false;
        byte[] buffer = null;

        /* Allow only some informations to be disclosed at this stage. */
        /* Allow only some information to be disclosed at this stage. */
        if (charUuid.equals(UUID_BEARER_PROVIDER_NAME)) {
            ByteBuffer bb = ByteBuffer.allocate(0).order(ByteOrder.LITTLE_ENDIAN);
            bb.put("".getBytes());
+2 −6
Original line number Diff line number Diff line
@@ -2156,9 +2156,7 @@ public class BluetoothMapContentObserverTest {
        // This mock sets type to MMS
        doReturn(4)
                .when(mIntent)
                .getIntExtra(
                        BluetoothMapContentObserver.EXTRA_MESSAGE_SENT_MSG_TYPE,
                        TYPE.NONE.ordinal());
                .getIntExtra(eq(BluetoothMapContentObserver.EXTRA_MESSAGE_SENT_MSG_TYPE), anyInt());

        mObserver.actionMessageSentDisconnected(mContext, mIntent, 1);

@@ -2177,9 +2175,7 @@ public class BluetoothMapContentObserverTest {
        // This mock sets type to Email
        doReturn(1)
                .when(mIntent)
                .getIntExtra(
                        BluetoothMapContentObserver.EXTRA_MESSAGE_SENT_MSG_TYPE,
                        TYPE.NONE.ordinal());
                .getIntExtra(eq(BluetoothMapContentObserver.EXTRA_MESSAGE_SENT_MSG_TYPE), anyInt());
        clearInvocations(mContext);

        mObserver.actionMessageSentDisconnected(mContext, mIntent, Activity.RESULT_FIRST_USER);