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

Commit af307b2f authored by Marie Janssen's avatar Marie Janssen Committed by Andre Eisenbach
Browse files

AVRCP: increase log info density

AVRCP has a lot of log messages that have little to no info.
Particularly with carkits that poll for data all the time, this makes it hard
to debug anything.

Remove logs where there's no info, add info where it's available with the goal
of making every log message useful.

Remove variables that we don't use anymore.

Print Now Playing Queue data on the dumpsys and when we report it
back to the controller.

Test: connect to a carkit and grab a bugreport
Bug: 37707672
Bug: 36802046
Bug: 38264897
Change-Id: I4fcb5a1c625c2d212685b4df04a0ac42df3d7841
(cherry picked from commit b486001f)
parent 4a3d30f4
Loading
Loading
Loading
Loading
+1 −11
Original line number Original line Diff line number Diff line
@@ -59,7 +59,6 @@ static void cleanup_items(btrc_folder_items_t* p_items, int numItems);


static void btavrcp_remote_features_callback(bt_bdaddr_t* bd_addr,
static void btavrcp_remote_features_callback(bt_bdaddr_t* bd_addr,
                                             btrc_remote_features_t features) {
                                             btrc_remote_features_t features) {
  ALOGI("%s", __func__);
  CallbackEnv sCallbackEnv(__func__);
  CallbackEnv sCallbackEnv(__func__);
  if (!sCallbackEnv.valid()) return;
  if (!sCallbackEnv.valid()) return;


@@ -83,7 +82,6 @@ static void btavrcp_remote_features_callback(bt_bdaddr_t* bd_addr,


/** Callback for play status request */
/** Callback for play status request */
static void btavrcp_get_play_status_callback(bt_bdaddr_t* bd_addr) {
static void btavrcp_get_play_status_callback(bt_bdaddr_t* bd_addr) {
  ALOGI("%s", __func__);
  CallbackEnv sCallbackEnv(__func__);
  CallbackEnv sCallbackEnv(__func__);
  if (!sCallbackEnv.valid()) return;
  if (!sCallbackEnv.valid()) return;


@@ -107,7 +105,6 @@ static void btavrcp_get_play_status_callback(bt_bdaddr_t* bd_addr) {
static void btavrcp_get_element_attr_callback(uint8_t num_attr,
static void btavrcp_get_element_attr_callback(uint8_t num_attr,
                                              btrc_media_attr_t* p_attrs,
                                              btrc_media_attr_t* p_attrs,
                                              bt_bdaddr_t* bd_addr) {
                                              bt_bdaddr_t* bd_addr) {
  ALOGI("%s", __func__);
  CallbackEnv sCallbackEnv(__func__);
  CallbackEnv sCallbackEnv(__func__);
  if (!sCallbackEnv.valid()) return;
  if (!sCallbackEnv.valid()) return;


@@ -164,7 +161,6 @@ static void btavrcp_register_notification_callback(btrc_event_id_t event_id,


static void btavrcp_volume_change_callback(uint8_t volume, uint8_t ctype,
static void btavrcp_volume_change_callback(uint8_t volume, uint8_t ctype,
                                           bt_bdaddr_t* bd_addr) {
                                           bt_bdaddr_t* bd_addr) {
  ALOGI("%s", __func__);
  CallbackEnv sCallbackEnv(__func__);
  CallbackEnv sCallbackEnv(__func__);
  if (!sCallbackEnv.valid()) return;
  if (!sCallbackEnv.valid()) return;


@@ -189,7 +185,6 @@ static void btavrcp_volume_change_callback(uint8_t volume, uint8_t ctype,


static void btavrcp_passthrough_command_callback(int id, int pressed,
static void btavrcp_passthrough_command_callback(int id, int pressed,
                                                 bt_bdaddr_t* bd_addr) {
                                                 bt_bdaddr_t* bd_addr) {
  ALOGI("%s", __func__);
  CallbackEnv sCallbackEnv(__func__);
  CallbackEnv sCallbackEnv(__func__);
  if (!sCallbackEnv.valid()) return;
  if (!sCallbackEnv.valid()) return;


@@ -213,7 +208,6 @@ static void btavrcp_passthrough_command_callback(int id, int pressed,


static void btavrcp_set_addressed_player_callback(uint16_t player_id,
static void btavrcp_set_addressed_player_callback(uint16_t player_id,
                                                  bt_bdaddr_t* bd_addr) {
                                                  bt_bdaddr_t* bd_addr) {
  ALOGI("%s", __func__);
  CallbackEnv sCallbackEnv(__func__);
  CallbackEnv sCallbackEnv(__func__);
  if (!sCallbackEnv.valid()) return;
  if (!sCallbackEnv.valid()) return;


@@ -237,7 +231,6 @@ static void btavrcp_set_addressed_player_callback(uint16_t player_id,


static void btavrcp_set_browsed_player_callback(uint16_t player_id,
static void btavrcp_set_browsed_player_callback(uint16_t player_id,
                                                bt_bdaddr_t* bd_addr) {
                                                bt_bdaddr_t* bd_addr) {
  ALOGI("%s", __func__);
  CallbackEnv sCallbackEnv(__func__);
  CallbackEnv sCallbackEnv(__func__);
  if (!sCallbackEnv.valid()) return;
  if (!sCallbackEnv.valid()) return;
  if (!mCallbacksObj) {
  if (!mCallbacksObj) {
@@ -261,7 +254,6 @@ static void btavrcp_set_browsed_player_callback(uint16_t player_id,
static void btavrcp_get_folder_items_callback(
static void btavrcp_get_folder_items_callback(
    uint8_t scope, uint32_t start_item, uint32_t end_item, uint8_t num_attr,
    uint8_t scope, uint32_t start_item, uint32_t end_item, uint8_t num_attr,
    uint32_t* p_attr_ids, bt_bdaddr_t* bd_addr) {
    uint32_t* p_attr_ids, bt_bdaddr_t* bd_addr) {
  ALOGI("%s", __func__);
  CallbackEnv sCallbackEnv(__func__);
  CallbackEnv sCallbackEnv(__func__);
  if (!sCallbackEnv.valid()) return;
  if (!sCallbackEnv.valid()) return;


@@ -302,7 +294,6 @@ static void btavrcp_get_folder_items_callback(


static void btavrcp_change_path_callback(uint8_t direction, uint8_t* folder_uid,
static void btavrcp_change_path_callback(uint8_t direction, uint8_t* folder_uid,
                                         bt_bdaddr_t* bd_addr) {
                                         bt_bdaddr_t* bd_addr) {
  ALOGI("%s", __func__);
  CallbackEnv sCallbackEnv(__func__);
  CallbackEnv sCallbackEnv(__func__);
  if (!sCallbackEnv.valid()) return;
  if (!sCallbackEnv.valid()) return;


@@ -338,7 +329,6 @@ static void btavrcp_get_item_attr_callback(uint8_t scope, uint8_t* uid,
                                           uint8_t num_attr,
                                           uint8_t num_attr,
                                           btrc_media_attr_t* p_attrs,
                                           btrc_media_attr_t* p_attrs,
                                           bt_bdaddr_t* bd_addr) {
                                           bt_bdaddr_t* bd_addr) {
  ALOGI("%s", __func__);
  CallbackEnv sCallbackEnv(__func__);
  CallbackEnv sCallbackEnv(__func__);
  if (!sCallbackEnv.valid()) return;
  if (!sCallbackEnv.valid()) return;


+26 −14
Original line number Original line Diff line number Diff line
@@ -27,6 +27,7 @@ import android.media.MediaMetadata;
import android.os.Bundle;
import android.os.Bundle;
import android.util.Log;
import android.util.Log;


import com.android.bluetooth.btservice.ProfileService;
import com.android.bluetooth.Utils;
import com.android.bluetooth.Utils;


import java.nio.ByteBuffer;
import java.nio.ByteBuffer;
@@ -260,14 +261,8 @@ public class AddressedMediaPlayer {
    boolean sendTrackChangeWithId(boolean requesting, @Nullable MediaController mediaController) {
    boolean sendTrackChangeWithId(boolean requesting, @Nullable MediaController mediaController) {
        if (DEBUG)
        if (DEBUG)
            Log.d(TAG, "sendTrackChangeWithId (" + requesting + "): controller " + mediaController);
            Log.d(TAG, "sendTrackChangeWithId (" + requesting + "): controller " + mediaController);
        byte[] track;
        long qid = getActiveQueueItemId(mediaController);
        long qid = MediaSession.QueueItem.UNKNOWN_ID;
        byte[] track = ByteBuffer.allocate(AvrcpConstants.UID_SIZE).putLong(qid).array();
        if (mediaController != null) {
            PlaybackState state = mediaController.getPlaybackState();
            /* for any item associated with NowPlaying, uid is queueId */
            if (state != null) qid = state.getActiveQueueItemId();
        }
        track = ByteBuffer.allocate(AvrcpConstants.UID_SIZE).putLong(qid).array();
        if (DEBUG) Log.d(TAG, "trackChangedRsp: 0x" + Utils.byteArrayToString(track));
        if (DEBUG) Log.d(TAG, "trackChangedRsp: 0x" + Utils.byteArrayToString(track));
        int trackChangedNT = AvrcpConstants.NOTIFICATION_TYPE_CHANGED;
        int trackChangedNT = AvrcpConstants.NOTIFICATION_TYPE_CHANGED;
        if (requesting) trackChangedNT = AvrcpConstants.NOTIFICATION_TYPE_INTERIM;
        if (requesting) trackChangedNT = AvrcpConstants.NOTIFICATION_TYPE_INTERIM;
@@ -413,13 +408,10 @@ public class AddressedMediaPlayer {
        try {
        try {
            MediaDescription desc = item.getDescription();
            MediaDescription desc = item.getDescription();
            Bundle extras = desc.getExtras();
            Bundle extras = desc.getExtras();
            if (mediaController != null) {
            if (item.getQueueId() == getActiveQueueItemId(mediaController)) {
                PlaybackState state = mediaController.getPlaybackState();
                if (state != null && (item.getQueueId() == state.getActiveQueueItemId())) {
                if (DEBUG) Log.d(TAG, "getAttrValue: item is active, filling extra data");
                if (DEBUG) Log.d(TAG, "getAttrValue: item is active, filling extra data");
                extras = fillBundle(mediaController.getMetadata(), extras);
                extras = fillBundle(mediaController.getMetadata(), extras);
            }
            }
            }
            if (DEBUG) Log.d(TAG, "getAttrValue: item " + item + " : " + desc);
            if (DEBUG) Log.d(TAG, "getAttrValue: item " + item + " : " + desc);
            switch (attr) {
            switch (attr) {
                case AvrcpConstants.ATTRID_TITLE:
                case AvrcpConstants.ATTRID_TITLE:
@@ -530,4 +522,24 @@ public class AddressedMediaPlayer {
            return;
            return;
        }
        }
    }
    }

    private long getActiveQueueItemId(@Nullable MediaController controller) {
        if (controller == null) return MediaSession.QueueItem.UNKNOWN_ID;
        PlaybackState state = controller.getPlaybackState();
        if (state == null) return MediaSession.QueueItem.UNKNOWN_ID;
        return state.getActiveQueueItemId();
    }

    public void dump(StringBuilder sb, @Nullable MediaController mediaController) {
        ProfileService.println(sb, "AddressedPlayer info:");
        ProfileService.println(sb, "mLastTrackIdSent: " + mLastTrackIdSent);
        ProfileService.println(sb, "mNowPlayingList: " + mNowPlayingList);
        List<MediaSession.QueueItem> queue = getNowPlayingList(mediaController);
        ProfileService.println(sb, "Current Queue: " + queue.size() + " elements");
        long currentQueueId = getActiveQueueItemId(mediaController);
        for (MediaSession.QueueItem item : queue) {
            long itemId = item.getQueueId();
            ProfileService.println(sb, (itemId == currentQueueId ? "*" : " ") + item.toString());
        }
    }
}
}
+24 −31
Original line number Original line Diff line number Diff line
@@ -91,7 +91,6 @@ public final class Avrcp {
    private long mLastReportedPosition;
    private long mLastReportedPosition;
    private long mNextPosMs;
    private long mNextPosMs;
    private long mPrevPosMs;
    private long mPrevPosMs;
    private long mSkipStartTime;
    private int mFeatures;
    private int mFeatures;
    private int mRemoteVolume;
    private int mRemoteVolume;
    private int mLastRemoteVolume;
    private int mLastRemoteVolume;
@@ -112,7 +111,6 @@ public final class Avrcp {
    private boolean mVolCmdAdjustInProgress;
    private boolean mVolCmdAdjustInProgress;
    private boolean mVolCmdSetInProgress;
    private boolean mVolCmdSetInProgress;
    private int mAbsVolRetryTimes;
    private int mAbsVolRetryTimes;
    private int mSkipAmount;


    private static final int NO_PLAYER_ID = 0;
    private static final int NO_PLAYER_ID = 0;


@@ -427,9 +425,13 @@ public final class Avrcp {
            case MSG_NATIVE_REQ_GET_PLAY_STATUS:
            case MSG_NATIVE_REQ_GET_PLAY_STATUS:
            {
            {
                byte[] address = (byte[]) msg.obj;
                byte[] address = (byte[]) msg.obj;
                if (DEBUG) Log.v(TAG, "MSG_NATIVE_REQ_GET_PLAY_STATUS");
                int btstate = convertPlayStateToPlayStatus(mCurrentPlayState);
                getPlayStatusRspNative(address, convertPlayStateToPlayStatus(mCurrentPlayState),
                int length = (int) mMediaAttributes.getLength();
                        (int) mMediaAttributes.getLength(), (int) getPlayPosition());
                int position = (int) getPlayPosition();
                if (DEBUG)
                    Log.v(TAG, "MSG_NATIVE_REQ_GET_PLAY_STATUS, responding with state " + btstate
                                    + " len " + length + " pos " + position);
                getPlayStatusRspNative(address, btstate, length, position);
                break;
                break;
            }
            }


@@ -441,11 +443,13 @@ public final class Avrcp {
                int[] attrIds = elem.mAttrIDs;
                int[] attrIds = elem.mAttrIDs;
                if (DEBUG) Log.v(TAG, "MSG_NATIVE_REQ_GET_ELEM_ATTRS:numAttr=" + numAttr);
                if (DEBUG) Log.v(TAG, "MSG_NATIVE_REQ_GET_ELEM_ATTRS:numAttr=" + numAttr);
                textArray = new String[numAttr];
                textArray = new String[numAttr];
                StringBuilder responseDebug = new StringBuilder();
                responseDebug.append("getElementAttr response: ");
                for (int i = 0; i < numAttr; ++i) {
                for (int i = 0; i < numAttr; ++i) {
                    textArray[i] = mMediaAttributes.getString(attrIds[i]);
                    textArray[i] = mMediaAttributes.getString(attrIds[i]);
                    Log.v(TAG, "getAttributeString:attrId=" + attrIds[i] +
                    responseDebug.append("[" + attrIds[i] + "=" + textArray[i] + "] ");
                            " str=" + textArray[i]);
                }
                }
                Log.v(TAG, responseDebug.toString());
                byte[] bdaddr = elem.mAddress;
                byte[] bdaddr = elem.mAddress;
                getElementAttrRspNative(bdaddr, numAttr, attrIds, textArray);
                getElementAttrRspNative(bdaddr, numAttr, attrIds, textArray);
                break;
                break;
@@ -472,13 +476,13 @@ public final class Avrcp {
                break;
                break;


            case MSG_ADDRESSED_PLAYER_CHANGED_RSP:
            case MSG_ADDRESSED_PLAYER_CHANGED_RSP:
                if (DEBUG)
                    Log.v(TAG, "MSG_ADDRESSED_PLAYER_CHANGED_RSP: newAddrPlayer = " + msg.arg1);
                // Later addressed players override earlier ones.
                // Later addressed players override earlier ones.
                if (hasMessages(MSG_ADDRESSED_PLAYER_CHANGED_RSP)) {
                if (hasMessages(MSG_ADDRESSED_PLAYER_CHANGED_RSP)) {
                    Log.i(TAG, "MSG_ADDRESSED_PLAYER_CHANGED_RSP: skip, more changes in queue");
                    Log.i(TAG, "MSG_ADDRESSED_PLAYER_CHANGED_RSP: skip, more changes in queue");
                    break;
                    break;
                }
                }
                if (DEBUG)
                    Log.v(TAG, "MSG_ADDRESSED_PLAYER_CHANGED_RSP: newAddrPlayer = " + msg.arg1);
                registerNotificationRspAddrPlayerChangedNative(
                registerNotificationRspAddrPlayerChangedNative(
                        AvrcpConstants.NOTIFICATION_TYPE_CHANGED, msg.arg1, sUIDCounter);
                        AvrcpConstants.NOTIFICATION_TYPE_CHANGED, msg.arg1, sUIDCounter);
                break;
                break;
@@ -490,12 +494,13 @@ public final class Avrcp {


            case MSG_NATIVE_REQ_VOLUME_CHANGE:
            case MSG_NATIVE_REQ_VOLUME_CHANGE:
                if (!isAbsoluteVolumeSupported()) {
                if (!isAbsoluteVolumeSupported()) {
                    if (DEBUG) Log.v(TAG, "ignore MSG_NATIVE_REQ_VOLUME_CHANGE");
                    if (DEBUG) Log.v(TAG, "MSG_NATIVE_REQ_VOLUME_CHANGE ignored, not supported");
                    break;
                    break;
                }
                }

                byte absVol = (byte) ((byte) msg.arg1 & 0x7f); // discard MSB as it is RFD
                if (DEBUG) Log.v(TAG, "MSG_NATIVE_REQ_VOLUME_CHANGE: volume=" + ((byte) msg.arg1 & 0x7f)
                if (DEBUG)
                        + " ctype=" + msg.arg2);
                    Log.v(TAG, "MSG_NATIVE_REQ_VOLUME_CHANGE: volume=" + absVol + " ctype="
                                    + msg.arg2);


                boolean volAdj = false;
                boolean volAdj = false;
                if (msg.arg2 == AVRC_RSP_ACCEPT || msg.arg2 == AVRC_RSP_REJ) {
                if (msg.arg2 == AVRC_RSP_ACCEPT || msg.arg2 == AVRC_RSP_REJ) {
@@ -511,7 +516,6 @@ public final class Avrcp {
                    mAbsVolRetryTimes = 0;
                    mAbsVolRetryTimes = 0;
                }
                }


                byte absVol = (byte) ((byte) msg.arg1 & 0x7f); // discard MSB as it is RFD
                // convert remote volume to local volume
                // convert remote volume to local volume
                int volIndex = convertToAudioStreamVolume(absVol);
                int volIndex = convertToAudioStreamVolume(absVol);
                if (mInitialRemoteVolume == -1) {
                if (mInitialRemoteVolume == -1) {
@@ -980,21 +984,18 @@ public final class Avrcp {
    }
    }


    private void getRcFeaturesRequestFromNative(byte[] address, int features) {
    private void getRcFeaturesRequestFromNative(byte[] address, int features) {
        if (DEBUG) Log.v(TAG, "getRcFeaturesRequestFromNative: address=" + address.toString());
        Message msg = mHandler.obtainMessage(MSG_NATIVE_REQ_GET_RC_FEATURES, features, 0,
        Message msg = mHandler.obtainMessage(MSG_NATIVE_REQ_GET_RC_FEATURES, features, 0,
                Utils.getAddressStringFromByte(address));
                Utils.getAddressStringFromByte(address));
        mHandler.sendMessage(msg);
        mHandler.sendMessage(msg);
    }
    }


    private void getPlayStatusRequestFromNative(byte[] address) {
    private void getPlayStatusRequestFromNative(byte[] address) {
        if (DEBUG) Log.v(TAG, "getPlayStatusRequestFromNative: address" + address.toString());
        Message msg = mHandler.obtainMessage(MSG_NATIVE_REQ_GET_PLAY_STATUS);
        Message msg = mHandler.obtainMessage(MSG_NATIVE_REQ_GET_PLAY_STATUS);
        msg.obj = address;
        msg.obj = address;
        mHandler.sendMessage(msg);
        mHandler.sendMessage(msg);
    }
    }


    private void getElementAttrRequestFromNative(byte[] address, byte numAttr, int[] attrs) {
    private void getElementAttrRequestFromNative(byte[] address, byte numAttr, int[] attrs) {
        if (DEBUG) Log.v(TAG, "getElementAttrRequestFromNative: numAttr=" + numAttr);
        AvrcpCmd avrcpCmdobj = new AvrcpCmd();
        AvrcpCmd avrcpCmdobj = new AvrcpCmd();
        AvrcpCmd.ElementAttrCmd elemAttr = avrcpCmdobj.new ElementAttrCmd(address, numAttr, attrs);
        AvrcpCmd.ElementAttrCmd elemAttr = avrcpCmdobj.new ElementAttrCmd(address, numAttr, attrs);
        Message msg = mHandler.obtainMessage(MSG_NATIVE_REQ_GET_ELEM_ATTRS);
        Message msg = mHandler.obtainMessage(MSG_NATIVE_REQ_GET_ELEM_ATTRS);
@@ -1003,7 +1004,6 @@ public final class Avrcp {
    }
    }


    private void registerNotificationRequestFromNative(byte[] address,int eventId, int param) {
    private void registerNotificationRequestFromNative(byte[] address,int eventId, int param) {
        if (DEBUG) Log.v(TAG, "registerNotificationRequestFromNative: eventId=" + eventId);
        Message msg = mHandler.obtainMessage(MSG_NATIVE_REQ_REGISTER_NOTIFICATION, eventId, param);
        Message msg = mHandler.obtainMessage(MSG_NATIVE_REQ_REGISTER_NOTIFICATION, eventId, param);
        msg.obj = address;
        msg.obj = address;
        mHandler.sendMessage(msg);
        mHandler.sendMessage(msg);
@@ -1242,7 +1242,6 @@ public final class Avrcp {


    private void getFolderItemsRequestFromNative(
    private void getFolderItemsRequestFromNative(
            byte[] address, byte scope, long startItem, long endItem, byte numAttr, int[] attrIds) {
            byte[] address, byte scope, long startItem, long endItem, byte numAttr, int[] attrIds) {
        if (DEBUG) Log.v(TAG, "getFolderItemsRequestFromNative: scope=" + scope + ", numAttr=" + numAttr);
        AvrcpCmd avrcpCmdobj = new AvrcpCmd();
        AvrcpCmd avrcpCmdobj = new AvrcpCmd();
        AvrcpCmd.FolderItemsCmd folderObj = avrcpCmdobj.new FolderItemsCmd(address, scope,
        AvrcpCmd.FolderItemsCmd folderObj = avrcpCmdobj.new FolderItemsCmd(address, scope,
                startItem, endItem, numAttr, attrIds);
                startItem, endItem, numAttr, attrIds);
@@ -1252,21 +1251,18 @@ public final class Avrcp {
    }
    }


    private void setAddressedPlayerRequestFromNative(byte[] address, int playerId) {
    private void setAddressedPlayerRequestFromNative(byte[] address, int playerId) {
        if (DEBUG) Log.v(TAG, "setAddrPlayerRequestFromNative: playerId=" + playerId);
        Message msg = mHandler.obtainMessage(MSG_NATIVE_REQ_SET_ADDR_PLAYER, playerId, 0);
        Message msg = mHandler.obtainMessage(MSG_NATIVE_REQ_SET_ADDR_PLAYER, playerId, 0);
        msg.obj = address;
        msg.obj = address;
        mHandler.sendMessage(msg);
        mHandler.sendMessage(msg);
    }
    }


    private void setBrowsedPlayerRequestFromNative(byte[] address, int playerId) {
    private void setBrowsedPlayerRequestFromNative(byte[] address, int playerId) {
        if (DEBUG) Log.v(TAG, "setBrPlayerRequestFromNative: playerId=" + playerId);
        Message msg = mHandler.obtainMessage(MSG_NATIVE_REQ_SET_BR_PLAYER, playerId, 0);
        Message msg = mHandler.obtainMessage(MSG_NATIVE_REQ_SET_BR_PLAYER, playerId, 0);
        msg.obj = address;
        msg.obj = address;
        mHandler.sendMessage(msg);
        mHandler.sendMessage(msg);
    }
    }


    private void changePathRequestFromNative(byte[] address, byte direction, byte[] folderUid) {
    private void changePathRequestFromNative(byte[] address, byte direction, byte[] folderUid) {
        if (DEBUG) Log.v(TAG, "changePathRequestFromNative: direction=" + direction);
        Bundle data = new Bundle();
        Bundle data = new Bundle();
        Message msg = mHandler.obtainMessage(MSG_NATIVE_REQ_CHANGE_PATH);
        Message msg = mHandler.obtainMessage(MSG_NATIVE_REQ_CHANGE_PATH);
        data.putByteArray("BdAddress" , address);
        data.putByteArray("BdAddress" , address);
@@ -1278,7 +1274,6 @@ public final class Avrcp {


    private void getItemAttrRequestFromNative(byte[] address, byte scope, byte[] itemUid, int uidCounter,
    private void getItemAttrRequestFromNative(byte[] address, byte scope, byte[] itemUid, int uidCounter,
            byte numAttr, int[] attrs) {
            byte numAttr, int[] attrs) {
        if (DEBUG) Log.v(TAG, "getItemAttrRequestFromNative: scope=" + scope + ", numAttr=" + numAttr);
        AvrcpCmd avrcpCmdobj = new AvrcpCmd();
        AvrcpCmd avrcpCmdobj = new AvrcpCmd();
        AvrcpCmd.ItemAttrCmd itemAttr = avrcpCmdobj.new ItemAttrCmd(address, scope,
        AvrcpCmd.ItemAttrCmd itemAttr = avrcpCmdobj.new ItemAttrCmd(address, scope,
                itemUid, uidCounter, numAttr, attrs);
                itemUid, uidCounter, numAttr, attrs);
@@ -1288,14 +1283,12 @@ public final class Avrcp {
    }
    }


    private void searchRequestFromNative(byte[] address, int charsetId, byte[] searchStr) {
    private void searchRequestFromNative(byte[] address, int charsetId, byte[] searchStr) {
        if (DEBUG) Log.v(TAG, "searchRequestFromNative");
        /* Search is not supported */
        /* Search is not supported */
        if (DEBUG) Log.d(TAG, "search is not supported");
        Log.w(TAG, "searchRequestFromNative: search is not supported");
        searchRspNative(address, AvrcpConstants.RSP_SRCH_NOT_SPRTD, 0, 0);
        searchRspNative(address, AvrcpConstants.RSP_SRCH_NOT_SPRTD, 0, 0);
    }
    }


    private void playItemRequestFromNative(byte[] address, byte scope, int uidCounter, byte[] uid) {
    private void playItemRequestFromNative(byte[] address, byte scope, int uidCounter, byte[] uid) {
        if (DEBUG) Log.v(TAG, "playItemRequestFromNative: scope=" + scope);
        Bundle data = new Bundle();
        Bundle data = new Bundle();
        Message msg = mHandler.obtainMessage(MSG_NATIVE_REQ_PLAY_ITEM);
        Message msg = mHandler.obtainMessage(MSG_NATIVE_REQ_PLAY_ITEM);
        data.putByteArray("BdAddress" , address);
        data.putByteArray("BdAddress" , address);
@@ -1307,14 +1300,12 @@ public final class Avrcp {
    }
    }


    private void addToPlayListRequestFromNative(byte[] address, byte scope, byte[] uid, int uidCounter) {
    private void addToPlayListRequestFromNative(byte[] address, byte scope, byte[] uid, int uidCounter) {
        if (DEBUG) Log.v(TAG, "addToPlayListRequestFromNative: scope=" + scope);
        /* add to NowPlaying not supported */
        /* add to NowPlaying not supported */
        Log.w(TAG, "Add to NowPlayingList is not supported");
        Log.w(TAG, "addToPlayListRequestFromNative: not supported! scope=" + scope);
        addToNowPlayingRspNative(address, AvrcpConstants.RSP_INTERNAL_ERR);
        addToNowPlayingRspNative(address, AvrcpConstants.RSP_INTERNAL_ERR);
    }
    }


    private void getTotalNumOfItemsRequestFromNative(byte[] address, byte scope) {
    private void getTotalNumOfItemsRequestFromNative(byte[] address, byte scope) {
        if (DEBUG) Log.v(TAG, "getTotalNumOfItemsRequestFromNative: scope=" + scope);
        Bundle data = new Bundle();
        Bundle data = new Bundle();
        Message msg = mHandler.obtainMessage(MSG_NATIVE_REQ_GET_TOTAL_NUM_OF_ITEMS);
        Message msg = mHandler.obtainMessage(MSG_NATIVE_REQ_GET_TOTAL_NUM_OF_ITEMS);
        msg.arg1 = scope;
        msg.arg1 = scope;
@@ -2298,7 +2289,6 @@ public final class Avrcp {
        ProfileService.println(sb, "mPlayPosChangedNT: " + mPlayPosChangedNT);
        ProfileService.println(sb, "mPlayPosChangedNT: " + mPlayPosChangedNT);
        ProfileService.println(sb, "mNextPosMs: " + mNextPosMs);
        ProfileService.println(sb, "mNextPosMs: " + mNextPosMs);
        ProfileService.println(sb, "mPrevPosMs: " + mPrevPosMs);
        ProfileService.println(sb, "mPrevPosMs: " + mPrevPosMs);
        ProfileService.println(sb, "mSkipStartTime: " + mSkipStartTime);
        ProfileService.println(sb, "mFeatures: " + mFeatures);
        ProfileService.println(sb, "mFeatures: " + mFeatures);
        ProfileService.println(sb, "mRemoteVolume: " + mRemoteVolume);
        ProfileService.println(sb, "mRemoteVolume: " + mRemoteVolume);
        ProfileService.println(sb, "mLastRemoteVolume: " + mLastRemoteVolume);
        ProfileService.println(sb, "mLastRemoteVolume: " + mLastRemoteVolume);
@@ -2308,7 +2298,6 @@ public final class Avrcp {
        ProfileService.println(sb, "mVolCmdAdjustInProgress: " + mVolCmdAdjustInProgress);
        ProfileService.println(sb, "mVolCmdAdjustInProgress: " + mVolCmdAdjustInProgress);
        ProfileService.println(sb, "mVolCmdSetInProgress: " + mVolCmdSetInProgress);
        ProfileService.println(sb, "mVolCmdSetInProgress: " + mVolCmdSetInProgress);
        ProfileService.println(sb, "mAbsVolRetryTimes: " + mAbsVolRetryTimes);
        ProfileService.println(sb, "mAbsVolRetryTimes: " + mAbsVolRetryTimes);
        ProfileService.println(sb, "mSkipAmount: " + mSkipAmount);
        ProfileService.println(sb, "mVolumeMapping: " + mVolumeMapping.toString());
        ProfileService.println(sb, "mVolumeMapping: " + mVolumeMapping.toString());
        if (mMediaController != null)
        if (mMediaController != null)
            ProfileService.println(sb, "mMediaController: " + mMediaController.getWrappedInstance()
            ProfileService.println(sb, "mMediaController: " + mMediaController.getWrappedInstance()
@@ -2324,6 +2313,10 @@ public final class Avrcp {
            }
            }
        }
        }


        ProfileService.println(sb, "");
        mAddressedMediaPlayer.dump(sb, mMediaController);

        ProfileService.println(sb, "");
        ProfileService.println(sb, mPassthroughDispatched + " passthrough operations: ");
        ProfileService.println(sb, mPassthroughDispatched + " passthrough operations: ");
        if (mPassthroughDispatched > mPassthroughLogs.size())
        if (mPassthroughDispatched > mPassthroughLogs.size())
            ProfileService.println(sb, "  (last " + mPassthroughLogs.size() + ")");
            ProfileService.println(sb, "  (last " + mPassthroughLogs.size() + ")");