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

Commit 57e57909 authored by wescande's avatar wescande
Browse files

Remove hidden dependency ArrayUtils wtfStack

Due to mainline we are not supposed to call hidden APIs
This CL does the following changes:
* `ArraysUtils.contains` -> `Utils.arrayContains`
* `Log.wtfStack` -> `Log.wtf`

Bug: 190443169
Test: atest BluetoothInstrumentationTests
Tag: #refactor
Change-Id: I8d41fbcfe9d69ff0240e51d25d3402b3d6db9dff
parent 51018626
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ public class CsipSetCoordinatorNativeInterface {
    private CsipSetCoordinatorNativeInterface() {
        mAdapter = BluetoothAdapter.getDefaultAdapter();
        if (mAdapter == null) {
            Log.wtfStack(TAG, "No Bluetooth Adapter Available");
            Log.wtf(TAG, "No Bluetooth Adapter Available");
        }
    }

+2 −3
Original line number Diff line number Diff line
@@ -41,7 +41,6 @@ import com.android.bluetooth.Utils;
import com.android.bluetooth.btservice.AdapterService;
import com.android.bluetooth.btservice.ProfileService;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.ArrayUtils;

import java.util.ArrayList;
import java.util.HashMap;
@@ -242,7 +241,7 @@ public class CsipSetCoordinatorService extends ProfileService {
            return false;
        }
        ParcelUuid[] featureUuids = mAdapterService.getRemoteUuids(device);
        if (!ArrayUtils.contains(featureUuids, BluetoothUuid.COORDINATED_SET)) {
        if (!Utils.arrayContains(featureUuids, BluetoothUuid.COORDINATED_SET)) {
            Log.e(TAG, "Cannot connect to " + device + " : Remote does not have CSIS UUID");
            return false;
        }
@@ -338,7 +337,7 @@ public class CsipSetCoordinatorService extends ProfileService {
        synchronized (mStateMachines) {
            for (BluetoothDevice device : bondedDevices) {
                final ParcelUuid[] featureUuids = device.getUuids();
                if (!ArrayUtils.contains(featureUuids, BluetoothUuid.COORDINATED_SET)) {
                if (!Utils.arrayContains(featureUuids, BluetoothUuid.COORDINATED_SET)) {
                    continue;
                }
                int connectionState = BluetoothProfile.STATE_DISCONNECTED;
+4 −4
Original line number Diff line number Diff line
@@ -159,7 +159,7 @@ public class CsipSetCoordinatorStateMachine extends StateMachine {
                        Log.d(TAG, "Disconnected: stack event: " + event);
                    }
                    if (!mDevice.equals(event.device)) {
                        Log.wtfStack(TAG, "Device(" + mDevice + "): event mismatch: " + event);
                        Log.wtf(TAG, "Device(" + mDevice + "): event mismatch: " + event);
                    }
                    switch (event.type) {
                        case CsipSetCoordinatorStackEvent.EVENT_TYPE_CONNECTION_STATE_CHANGED:
@@ -268,7 +268,7 @@ public class CsipSetCoordinatorStateMachine extends StateMachine {
                    CsipSetCoordinatorStackEvent event = (CsipSetCoordinatorStackEvent) message.obj;
                    log("Connecting: stack event: " + event);
                    if (!mDevice.equals(event.device)) {
                        Log.wtfStack(TAG, "Device(" + mDevice + "): event mismatch: " + event);
                        Log.wtf(TAG, "Device(" + mDevice + "): event mismatch: " + event);
                    }
                    switch (event.type) {
                        case CsipSetCoordinatorStackEvent.EVENT_TYPE_CONNECTION_STATE_CHANGED:
@@ -354,7 +354,7 @@ public class CsipSetCoordinatorStateMachine extends StateMachine {
                    CsipSetCoordinatorStackEvent event = (CsipSetCoordinatorStackEvent) message.obj;
                    log("Disconnecting: stack event: " + event);
                    if (!mDevice.equals(event.device)) {
                        Log.wtfStack(TAG, "Device(" + mDevice + "): event mismatch: " + event);
                        Log.wtf(TAG, "Device(" + mDevice + "): event mismatch: " + event);
                    }
                    switch (event.type) {
                        case CsipSetCoordinatorStackEvent.EVENT_TYPE_CONNECTION_STATE_CHANGED:
@@ -451,7 +451,7 @@ public class CsipSetCoordinatorStateMachine extends StateMachine {
                    CsipSetCoordinatorStackEvent event = (CsipSetCoordinatorStackEvent) message.obj;
                    log("Connected: stack event: " + event);
                    if (!mDevice.equals(event.device)) {
                        Log.wtfStack(TAG, "Device(" + mDevice + "): event mismatch: " + event);
                        Log.wtf(TAG, "Device(" + mDevice + "): event mismatch: " + event);
                    }
                    switch (event.type) {
                        case CsipSetCoordinatorStackEvent.EVENT_TYPE_CONNECTION_STATE_CHANGED: