Loading android/app/src/com/android/bluetooth/mcp/McpService.java +4 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ package com.android.bluetooth.mcp; import android.bluetooth.BluetoothDevice; import android.bluetooth.IBluetoothMcpServiceManager; import android.os.Handler; import android.os.Looper; import android.util.Log; import com.android.bluetooth.Utils; Loading @@ -40,6 +42,7 @@ public class McpService extends ProfileService { private static MediaControlProfile mGmcs; private Map<BluetoothDevice, Integer> mDeviceAuthorizations = new HashMap<>(); private Handler mHandler = new Handler(Looper.getMainLooper()); private static synchronized void setMcpService(McpService instance) { if (VDBG) { Loading Loading @@ -94,7 +97,7 @@ public class McpService extends ProfileService { // Initialize the Media Control Service Server mGmcs = new MediaControlProfile(this); // Requires this service to be already started thus we have to make it an async call this.getMainThreadHandler().post(() -> mGmcs.init()); mHandler.post(() -> mGmcs.init()); } return true; Loading android/app/src/com/android/bluetooth/mcp/MediaControlGattService.java +4 −1 Original line number Diff line number Diff line Loading @@ -38,6 +38,8 @@ import android.bluetooth.BluetoothGattService; import android.bluetooth.BluetoothManager; import android.bluetooth.BluetoothProfile; import android.content.Context; import android.os.Handler; import android.os.Looper; import android.util.Log; import com.android.internal.annotations.VisibleForTesting; Loading Loading @@ -126,6 +128,7 @@ public class MediaControlGattService implements MediaControlGattServiceInterface private MediaControlServiceCallbacks mCallbacks; private BluetoothGattServerProxy mBluetoothGattServer; private BluetoothGattService mGattService = null; private Handler mHandler = new Handler(Looper.getMainLooper()); private Map<Integer, BluetoothGattCharacteristic> mCharacteristics = new HashMap<>(); private MediaState mCurrentMediaState = MediaState.INACTIVE; private Map<BluetoothDevice, List<GattOpContext>> mPendingGattOperations = new HashMap<>(); Loading Loading @@ -843,7 +846,7 @@ public class MediaControlGattService implements MediaControlGattServiceInterface // Test for RFU bits and currently supported opcodes if (!isOpcodeSupported(opcode)) { Log.e(TAG, "handleMediaControlPointRequest: opcode or feature not supported"); mContext.getMainThreadHandler().post(() -> { mHandler.post(() -> { setMediaControlRequestResult(new Request(opcode, 0), Request.Results.OPCODE_NOT_SUPPORTED); }); Loading android/app/src/com/android/bluetooth/mcp/MediaControlProfile.java +3 −5 Original line number Diff line number Diff line Loading @@ -90,11 +90,9 @@ public class MediaControlProfile implements MediaControlServiceCallbacks { mCurrentData = data; mContext.getMainThreadHandler().post(() -> { onCurrentPlayerStateUpdated(state, metadata); if (queue) onCurrentPlayerQueueUpdated(); processPendingPlayerStateRequest(); }); } @Override Loading Loading
android/app/src/com/android/bluetooth/mcp/McpService.java +4 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ package com.android.bluetooth.mcp; import android.bluetooth.BluetoothDevice; import android.bluetooth.IBluetoothMcpServiceManager; import android.os.Handler; import android.os.Looper; import android.util.Log; import com.android.bluetooth.Utils; Loading @@ -40,6 +42,7 @@ public class McpService extends ProfileService { private static MediaControlProfile mGmcs; private Map<BluetoothDevice, Integer> mDeviceAuthorizations = new HashMap<>(); private Handler mHandler = new Handler(Looper.getMainLooper()); private static synchronized void setMcpService(McpService instance) { if (VDBG) { Loading Loading @@ -94,7 +97,7 @@ public class McpService extends ProfileService { // Initialize the Media Control Service Server mGmcs = new MediaControlProfile(this); // Requires this service to be already started thus we have to make it an async call this.getMainThreadHandler().post(() -> mGmcs.init()); mHandler.post(() -> mGmcs.init()); } return true; Loading
android/app/src/com/android/bluetooth/mcp/MediaControlGattService.java +4 −1 Original line number Diff line number Diff line Loading @@ -38,6 +38,8 @@ import android.bluetooth.BluetoothGattService; import android.bluetooth.BluetoothManager; import android.bluetooth.BluetoothProfile; import android.content.Context; import android.os.Handler; import android.os.Looper; import android.util.Log; import com.android.internal.annotations.VisibleForTesting; Loading Loading @@ -126,6 +128,7 @@ public class MediaControlGattService implements MediaControlGattServiceInterface private MediaControlServiceCallbacks mCallbacks; private BluetoothGattServerProxy mBluetoothGattServer; private BluetoothGattService mGattService = null; private Handler mHandler = new Handler(Looper.getMainLooper()); private Map<Integer, BluetoothGattCharacteristic> mCharacteristics = new HashMap<>(); private MediaState mCurrentMediaState = MediaState.INACTIVE; private Map<BluetoothDevice, List<GattOpContext>> mPendingGattOperations = new HashMap<>(); Loading Loading @@ -843,7 +846,7 @@ public class MediaControlGattService implements MediaControlGattServiceInterface // Test for RFU bits and currently supported opcodes if (!isOpcodeSupported(opcode)) { Log.e(TAG, "handleMediaControlPointRequest: opcode or feature not supported"); mContext.getMainThreadHandler().post(() -> { mHandler.post(() -> { setMediaControlRequestResult(new Request(opcode, 0), Request.Results.OPCODE_NOT_SUPPORTED); }); Loading
android/app/src/com/android/bluetooth/mcp/MediaControlProfile.java +3 −5 Original line number Diff line number Diff line Loading @@ -90,11 +90,9 @@ public class MediaControlProfile implements MediaControlServiceCallbacks { mCurrentData = data; mContext.getMainThreadHandler().post(() -> { onCurrentPlayerStateUpdated(state, metadata); if (queue) onCurrentPlayerQueueUpdated(); processPendingPlayerStateRequest(); }); } @Override Loading