Loading android/app/src/com/android/bluetooth/a2dpsink/mbs/A2dpMediaBrowserService.java +3 −3 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading Loading @@ -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; } Loading android/app/src/com/android/bluetooth/avrcpcontroller/AvrcpControllerStateMachine.java +10 −10 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); Loading @@ -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; Loading Loading @@ -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; Loading Loading @@ -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. Loading @@ -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; Loading Loading @@ -888,7 +888,7 @@ class AvrcpControllerStateMachine extends StateMachine { Log.d(TAG, "getCurrentMetaData mmd " + mmd); } } return mEmptyMMD; return EMPTY_MEDIA_METADATA; } } Loading Loading @@ -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; } Loading Loading @@ -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; } Loading android/app/src/com/android/bluetooth/hfpclient/HeadsetClientHalConstants.java +2 −2 Original line number Diff line number Diff line Loading @@ -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; Loading android/app/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java +1 −3 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); Loading android/app/src/com/android/bluetooth/opp/BluetoothOppNotification.java +8 −9 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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 + ")"; Loading @@ -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 Loading
android/app/src/com/android/bluetooth/a2dpsink/mbs/A2dpMediaBrowserService.java +3 −3 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading Loading @@ -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; } Loading
android/app/src/com/android/bluetooth/avrcpcontroller/AvrcpControllerStateMachine.java +10 −10 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); Loading @@ -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; Loading Loading @@ -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; Loading Loading @@ -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. Loading @@ -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; Loading Loading @@ -888,7 +888,7 @@ class AvrcpControllerStateMachine extends StateMachine { Log.d(TAG, "getCurrentMetaData mmd " + mmd); } } return mEmptyMMD; return EMPTY_MEDIA_METADATA; } } Loading Loading @@ -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; } Loading Loading @@ -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; } Loading
android/app/src/com/android/bluetooth/hfpclient/HeadsetClientHalConstants.java +2 −2 Original line number Diff line number Diff line Loading @@ -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; Loading
android/app/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java +1 −3 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); Loading
android/app/src/com/android/bluetooth/opp/BluetoothOppNotification.java +8 −9 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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 + ")"; Loading @@ -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