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

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

Merge "[Manual] Fix static variable names"

am: d6845dc1

Change-Id: Ifc99b8367a31405bc24f172e9b93cc8cfdd715ba
parents eb8eefcf d6845dc1
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ import com.android.bluetooth.avrcpcontroller.BrowseTree;

import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -101,7 +102,6 @@ public class A2dpMediaBrowserService extends MediaBrowserService {
    private BluetoothDevice mA2dpDevice = null;
    private Handler mAvrcpCommandQueue;
    private final Map<String, Result<List<MediaItem>>> mParentIdToRequestMap = new HashMap<>();
    private static final List<MediaItem> mEmptyList = new ArrayList<MediaItem>();

    // Browsing related structures.
    private List<MediaItem> mNowPlayingList = null;
@@ -203,13 +203,13 @@ public class A2dpMediaBrowserService extends MediaBrowserService {
            final String parentMediaId, final Result<List<MediaItem>> result) {
        if (mAvrcpCtrlSrvc == null) {
            Log.e(TAG, "AVRCP not yet connected.");
            result.sendResult(mEmptyList);
            result.sendResult(Collections.emptyList());
            return;
        }

        Log.d(TAG, "onLoadChildren parentMediaId=" + parentMediaId);
        if (!mAvrcpCtrlSrvc.getChildren(mA2dpDevice, parentMediaId, 0, 0xff)) {
            result.sendResult(mEmptyList);
            result.sendResult(Collections.emptyList());
            return;
        }

+10 −10
Original line number Diff line number Diff line
@@ -122,8 +122,8 @@ class AvrcpControllerStateMachine extends StateMachine {
    private final MoveToRoot mMoveToRoot;

    private final Object mLock = new Object();
    private static final ArrayList<MediaItem> mEmptyMediaItemList = new ArrayList<>();
    private static final MediaMetadata mEmptyMMD = new MediaMetadata.Builder().build();
    private static final ArrayList<MediaItem> EMPTY_MEDIA_ITEM_LIST = new ArrayList<>();
    private static final MediaMetadata EMPTY_MEDIA_METADATA = new MediaMetadata.Builder().build();

    // APIs exist to access these so they must be thread safe
    private Boolean mIsConnected = false;
@@ -503,7 +503,7 @@ class AvrcpControllerStateMachine extends StateMachine {
                        sendMessage(MESSAGE_GET_FOLDER_LIST, 0, msg.arg1 -1, mID);
                    } else {
                        // Return an empty response to the upper layer.
                        broadcastFolderList(mID, mEmptyMediaItemList);
                        broadcastFolderList(mID, EMPTY_MEDIA_ITEM_LIST);
                    }
                    mBrowseTree.setCurrentBrowsedFolder(mID);
                    transitionTo(mConnected);
@@ -514,7 +514,7 @@ class AvrcpControllerStateMachine extends StateMachine {
                    // We timed out changing folders. It is imperative we tell
                    // the upper layers that we failed by giving them an empty list.
                    Log.e(STATE_TAG, "change folder failed, sending empty list.");
                    broadcastFolderList(mID, mEmptyMediaItemList);
                    broadcastFolderList(mID, EMPTY_MEDIA_ITEM_LIST);
                    transitionTo(mConnected);
                    break;

@@ -688,7 +688,7 @@ class AvrcpControllerStateMachine extends StateMachine {
                case MESSAGE_INTERNAL_CMD_TIMEOUT:
                    // We have timed out to execute the request.
                    // Send an empty list here.
                    broadcastFolderList(BrowseTree.ROOT, mEmptyMediaItemList);
                    broadcastFolderList(BrowseTree.ROOT, EMPTY_MEDIA_ITEM_LIST);
                    transitionTo(mConnected);
                    break;

@@ -774,7 +774,7 @@ class AvrcpControllerStateMachine extends StateMachine {
                    // If we already on top of player and there is no content.
                    // This should very rarely happen.
                    if (mBrowseDepth == 0 && msg.arg1 == 0) {
                        broadcastFolderList(mID, mEmptyMediaItemList);
                        broadcastFolderList(mID, EMPTY_MEDIA_ITEM_LIST);
                        transitionTo(mConnected);
                    } else {
                        // Otherwise move to root and fetch the listing.
@@ -788,7 +788,7 @@ class AvrcpControllerStateMachine extends StateMachine {
                    break;

                case MESSAGE_INTERNAL_CMD_TIMEOUT:
                    broadcastFolderList(mID, mEmptyMediaItemList);
                    broadcastFolderList(mID, EMPTY_MEDIA_ITEM_LIST);
                    transitionTo(mConnected);
                    break;

@@ -888,7 +888,7 @@ class AvrcpControllerStateMachine extends StateMachine {
                    Log.d(TAG, "getCurrentMetaData mmd " + mmd);
                }
            }
            return mEmptyMMD;
            return EMPTY_MEDIA_METADATA;
        }
    }

@@ -924,7 +924,7 @@ class AvrcpControllerStateMachine extends StateMachine {
        BrowseTree.BrowseNode bn = mBrowseTree.findBrowseNodeByID(parentMediaId);
        if (bn == null) {
            Log.e(TAG, "Invalid folder to browse " + mBrowseTree);
            broadcastFolderList(parentMediaId, mEmptyMediaItemList);
            broadcastFolderList(parentMediaId, EMPTY_MEDIA_ITEM_LIST);
            return;
        }

@@ -984,7 +984,7 @@ class AvrcpControllerStateMachine extends StateMachine {
                if (btDirection == BrowseTree.DIRECTION_UNKNOWN) {
                    Log.w(TAG, "parent " + bn + " is not a direct " +
                        "successor or predeccessor of current folder " + currFol);
                    broadcastFolderList(parentMediaId, mEmptyMediaItemList);
                    broadcastFolderList(parentMediaId, EMPTY_MEDIA_ITEM_LIST);
                    return;
                }

+2 −2
Original line number Diff line number Diff line
@@ -106,8 +106,8 @@ public final class HeadsetClientHalConstants {
    static final int CALL_ACTION_CHLD_2 = 2;
    static final int CALL_ACTION_CHLD_3 = 3;
    static final int CALL_ACTION_CHLD_4 = 4;
    static final int CALL_ACTION_CHLD_1x = 5;
    static final int CALL_ACTION_CHLD_2x = 6;
    static final int CALL_ACTION_CHLD_1X = 5;
    static final int CALL_ACTION_CHLD_2X = 6;
    static final int CALL_ACTION_ATA = 7;
    static final int CALL_ACTION_CHUP = 8;
    static final int CALL_ACTION_BTRH_0 = 9;
+1 −3
Original line number Diff line number Diff line
@@ -68,8 +68,6 @@ import java.util.List;
import java.util.Queue;
import java.util.Set;

import com.android.bluetooth.R;

public class HeadsetClientStateMachine extends StateMachine {
    private static final String TAG = "HeadsetClientStateMachine";
    private static final boolean DBG = false;
@@ -598,7 +596,7 @@ public class HeadsetClientStateMachine extends StateMachine {
            !c.isMultiParty()) return;

        if (NativeInterface.handleCallActionNative(getByteAddress(mCurrentDevice),
                HeadsetClientHalConstants.CALL_ACTION_CHLD_2x, idx)) {
                HeadsetClientHalConstants.CALL_ACTION_CHLD_2X, idx)) {
            addQueuedAction(ENTER_PRIVATE_MODE, c);
        } else {
            Log.e(TAG, "ERROR: Couldn't enter private " + " id:" + idx);
+8 −9
Original line number Diff line number Diff line
@@ -37,7 +37,6 @@ import com.android.bluetooth.R;
import android.content.ContentResolver;
import android.content.Context;
import android.app.Notification;
import android.app.Notification.Action;
import android.app.NotificationManager;
import android.app.NotificationChannel;
import android.app.PendingIntent;
@@ -61,25 +60,25 @@ class BluetoothOppNotification {
    private static final String TAG = "BluetoothOppNotification";
    private static final boolean V = Constants.VERBOSE;

    static final String status = "(" + BluetoothShare.STATUS + " == '192'" + ")";
    static final String STATUS = "(" + BluetoothShare.STATUS + " == '192'" + ")";

    static final String visible = "(" + BluetoothShare.VISIBILITY + " IS NULL OR "
    static final String VISIBLE = "(" + BluetoothShare.VISIBILITY + " IS NULL OR "
            + BluetoothShare.VISIBILITY + " == '" + BluetoothShare.VISIBILITY_VISIBLE + "'" + ")";

    static final String confirm = "(" + BluetoothShare.USER_CONFIRMATION + " == '"
    static final String CONFIRM = "(" + BluetoothShare.USER_CONFIRMATION + " == '"
            + BluetoothShare.USER_CONFIRMATION_CONFIRMED + "' OR "
            + BluetoothShare.USER_CONFIRMATION + " == '"
            + BluetoothShare.USER_CONFIRMATION_AUTO_CONFIRMED  + "' OR "
            + BluetoothShare.USER_CONFIRMATION + " == '"
            + BluetoothShare.USER_CONFIRMATION_HANDOVER_CONFIRMED + "'" + ")";

    static final String not_through_handover = "(" + BluetoothShare.USER_CONFIRMATION + " != '"
    static final String NOT_THROUGH_HANDOVER = "(" + BluetoothShare.USER_CONFIRMATION + " != '"
            + BluetoothShare.USER_CONFIRMATION_HANDOVER_CONFIRMED + "'" + ")";

    static final String WHERE_RUNNING = status + " AND " + visible + " AND " + confirm;
    static final String WHERE_RUNNING = STATUS + " AND " + VISIBLE + " AND " + CONFIRM;

    static final String WHERE_COMPLETED = BluetoothShare.STATUS + " >= '200' AND " + visible +
            " AND " + not_through_handover; // Don't show handover-initiated transfers
    static final String WHERE_COMPLETED = BluetoothShare.STATUS + " >= '200' AND " + VISIBLE +
            " AND " + NOT_THROUGH_HANDOVER; // Don't show handover-initiated transfers

    private static final String WHERE_COMPLETED_OUTBOUND = WHERE_COMPLETED + " AND " + "("
            + BluetoothShare.DIRECTION + " == " + BluetoothShare.DIRECTION_OUTBOUND + ")";
@@ -88,7 +87,7 @@ class BluetoothOppNotification {
            + BluetoothShare.DIRECTION + " == " + BluetoothShare.DIRECTION_INBOUND + ")";

    static final String WHERE_CONFIRM_PENDING = BluetoothShare.USER_CONFIRMATION + " == '"
            + BluetoothShare.USER_CONFIRMATION_PENDING + "'" + " AND " + visible;
            + BluetoothShare.USER_CONFIRMATION_PENDING + "'" + " AND " + VISIBLE;

    public NotificationManager mNotificationMgr;

Loading