[Audiosharing] Increase audio sharing test coverage

Bug: 345686602
Test: atest
Change-Id: Iec196fc884c3b7ddd580eb8dd13b445d59e3b1b7
This commit is contained in:
Yiyi Shen
2024-06-13 18:29:23 +08:00
parent 44de7e98d3
commit 2c6b9bb364
14 changed files with 577 additions and 101 deletions

View File

@@ -87,7 +87,8 @@ public class AudioSharingDevicePreferenceController extends BasePreferenceContro
@Nullable private AudioSharingDialogHandler mDialogHandler;
private AtomicBoolean mIntentHandled = new AtomicBoolean(false);
private BluetoothLeBroadcastAssistant.Callback mBroadcastAssistantCallback =
@VisibleForTesting
BluetoothLeBroadcastAssistant.Callback mBroadcastAssistantCallback =
new BluetoothLeBroadcastAssistant.Callback() {
@Override
public void onSearchStarted(int reason) {}
@@ -368,23 +369,23 @@ public class AudioSharingDevicePreferenceController extends BasePreferenceContro
}
@VisibleForTesting
public void setBluetoothDeviceUpdater(@Nullable BluetoothDeviceUpdater bluetoothDeviceUpdater) {
void setBluetoothDeviceUpdater(@Nullable BluetoothDeviceUpdater bluetoothDeviceUpdater) {
mBluetoothDeviceUpdater = bluetoothDeviceUpdater;
}
@VisibleForTesting
public void setDialogHandler(@Nullable AudioSharingDialogHandler dialogHandler) {
void setDialogHandler(@Nullable AudioSharingDialogHandler dialogHandler) {
mDialogHandler = dialogHandler;
}
@VisibleForTesting
public void setHostFragment(@Nullable DashboardFragment fragment) {
void setHostFragment(@Nullable DashboardFragment fragment) {
mFragment = fragment;
}
/** Test only: set intent handle state for test. */
@VisibleForTesting
public void setIntentHandled(boolean handled) {
void setIntentHandled(boolean handled) {
mIntentHandled.set(handled);
}