[Audiosharing] When bt is off or unsupported, we show "Please connect a device" dialog after camera scans a QR code

Bug: 308368124
Flag: com.android.settingslib.flags.enable_le_audio_qr_code_private_broadcast_sharing
Test: atest
Change-Id: I89697e25b57d67fa765f5ad593b72f6cdecda418
This commit is contained in:
chelseahao
2024-08-02 11:47:27 +08:00
committed by Chelsea Hao
parent 509c1d7834
commit d187437c57
2 changed files with 18 additions and 0 deletions

View File

@@ -139,6 +139,15 @@ public class AudioStreamConfirmDialogActivityTest {
verify(mLocalBluetoothProfileManager, never()).addServiceListener(any());
}
@Test
public void setupActivity_serviceNotReady_bluetoothOff_doNothing() {
when(mAssistant.isProfileReady()).thenReturn(false);
mShadowBluetoothAdapter.setEnabled(false);
mActivity = Robolectric.setupActivity(AudioStreamConfirmDialogActivity.class);
verify(mLocalBluetoothProfileManager, never()).addServiceListener(any());
}
@Test
public void onStop_unregisterCallback() {
mActivity = Robolectric.setupActivity(AudioStreamConfirmDialogActivity.class);