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

Commit 15d406f1 authored by William Escande's avatar William Escande
Browse files

Errorprone: JdkObsolete

Test: m Bluetooth
Bug: 344658662
Flag: Exempt, enforce error in the futur
Change-Id: I7a1504b785f465945779191ff10b699169301147
parent 0eabe3dc
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -343,6 +343,7 @@ android_app {
            "-Xep:InvalidBlockTag:ERROR",
            "-Xep:InvalidParam:ERROR",
            "-Xep:JavaUtilDate:ERROR",
            "-Xep:JdkObsolete:ERROR",
            "-Xep:LockOnNonEnclosingClassLiteral:ERROR",
            "-Xep:LoopOverCharArray:ERROR",
            "-Xep:MissingCasesInEnumSwitch:ERROR",
+9 −9
Original line number Diff line number Diff line
@@ -66,15 +66,15 @@ import com.android.internal.util.StateMachine;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

public class HeadsetClientStateMachine extends StateMachine {
    private static final String TAG = HeadsetClientStateMachine.class.getSimpleName();
@@ -139,10 +139,10 @@ public class HeadsetClientStateMachine extends StateMachine {

    // Set of calls that represent the accurate state of calls that exists on AG and the calls that
    // are currently in process of being notified to the AG from HF.
    @VisibleForTesting final Hashtable<Integer, HfpClientCall> mCalls = new Hashtable<>();
    @VisibleForTesting final Map<Integer, HfpClientCall> mCalls = new ConcurrentHashMap<>();
    // Set of calls received from AG via the AT+CLCC command. We use this map to update the mCalls
    // which is eventually used to inform the telephony stack of any changes to call on HF.
    private final Hashtable<Integer, HfpClientCall> mCallsUpdate = new Hashtable<>();
    private final Map<Integer, HfpClientCall> mCallsUpdate = new ConcurrentHashMap<>();

    private int mIndicatorNetworkState;
    private int mIndicatorNetworkType;
@@ -157,7 +157,7 @@ public class HeadsetClientStateMachine extends StateMachine {
    private static int sMinAmVcVol;

    // queue of send actions (pair action, action_data)
    @VisibleForTesting Queue<Pair<Integer, Object>> mQueuedActions;
    @VisibleForTesting ArrayDeque<Pair<Integer, Object>> mQueuedActions;

    @VisibleForTesting int mAudioState;
    // Indicates whether audio can be routed to the device
@@ -432,7 +432,7 @@ public class HeadsetClientStateMachine extends StateMachine {
        // 1. If from the above procedure we get N extra calls (i.e. {3}):
        // choose the first call as the one to associate with the HF call.

        // Create set of IDs for added calls, removed calls and consitent calls.
        // Create set of IDs for added calls, removed calls and consistent calls.
        // WARN!!! Java Map -> Set has association hence changes to Set are reflected in the Map
        // itself (i.e. removing an element from Set removes it from the Map hence use copy).
        Set<Integer> currCallIdSet = new HashSet<Integer>();
@@ -930,7 +930,7 @@ public class HeadsetClientStateMachine extends StateMachine {
        mOperatorName = null;
        mSubscriberInfo = null;

        mQueuedActions = new LinkedList<Pair<Integer, Object>>();
        mQueuedActions = new ArrayDeque<>();

        mCalls.clear();
        mCallsUpdate.clear();
@@ -1066,7 +1066,7 @@ public class HeadsetClientStateMachine extends StateMachine {
            mOperatorName = null;
            mSubscriberInfo = null;

            mQueuedActions = new LinkedList<Pair<Integer, Object>>();
            mQueuedActions = new ArrayDeque<>();

            mCalls.clear();
            mCallsUpdate.clear();
+3 −3
Original line number Diff line number Diff line
@@ -97,11 +97,11 @@ import com.android.bluetooth.vc.VolumeControlService;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;

import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@@ -193,8 +193,8 @@ public class LeAudioService extends ProfileService {
    Optional<Boolean> mQueuedInCallValue = Optional.empty();
    boolean mTmapStarted = false;
    private boolean mAwaitingBroadcastCreateResponse = false;
    private final LinkedList<BluetoothLeBroadcastSettings> mCreateBroadcastQueue =
            new LinkedList<>();
    private final ArrayDeque<BluetoothLeBroadcastSettings> mCreateBroadcastQueue =
            new ArrayDeque<>();
    boolean mIsSourceStreamMonitorModeEnabled = false;
    boolean mIsSinkStreamMonitorModeEnabled = false;
    boolean mIsBroadcastPausedFromOutside = false;
+2 −2
Original line number Diff line number Diff line
@@ -24,8 +24,8 @@ import org.android.btsap.SapApi.RIL_SIM_SAP_TRANSFER_CARD_READER_STATUS_RSP;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Hashtable;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;

/**
@@ -165,7 +165,7 @@ public class SapMessage {
    static AtomicInteger sNextSerial = new AtomicInteger(1);

    // Map<rilSerial, RequestType> - HashTable is synchronized
    static Map<Integer, Integer> sOngoingRequests = new Hashtable<Integer, Integer>();
    static Map<Integer, Integer> sOngoingRequests = new ConcurrentHashMap<Integer, Integer>();
    private boolean mSendToRil = false; // set to true for messages that needs to go to the RIL
    private boolean mClearRilQueue = false; /* set to true for messages that needs to cause the
                                              sOngoingRequests to be cleared. */