Update OutputSwitcher from MediaOutputSlice to MediaOutputDialog in Settings
-Update entry point at media indicator in volume panel -Update entry point at remote media slice in volume panel -Update entry point at remote volume group in Sound Settings -Update entry point at media output preference in Sound Settings -Hide Media output dialog when the caller is not active Bug: 155822415 Test: make -j50 RunSettingsRoboTests Merged-In: Ib6c86067522925c439f336644e4d027dbae3379c Change-Id: Ib6c86067522925c439f336644e4d027dbae3379c
This commit is contained in:
@@ -208,12 +208,14 @@ public class MediaOutputIndicatorSliceTest {
|
||||
when(mMediaController.getPackageName()).thenReturn(TEST_PACKAGE_NAME);
|
||||
doReturn(mMediaController).when(sMediaOutputIndicatorWorker)
|
||||
.getActiveLocalMediaController();
|
||||
final Intent intent = mMediaOutputIndicatorSlice.getMediaOutputSliceIntent();
|
||||
final Intent intent = mMediaOutputIndicatorSlice.getMediaOutputDialogIntent();
|
||||
|
||||
assertThat(TextUtils.equals(TEST_PACKAGE_NAME, intent.getStringExtra(
|
||||
MediaOutputSliceConstants.EXTRA_PACKAGE_NAME))).isTrue();
|
||||
assertThat(MediaOutputSliceConstants.ACTION_MEDIA_OUTPUT).isEqualTo(intent.getAction());
|
||||
assertThat(TextUtils.equals(Utils.SETTINGS_PACKAGE_NAME, intent.getPackage())).isTrue();
|
||||
assertThat(MediaOutputSliceConstants.ACTION_LAUNCH_MEDIA_OUTPUT_DIALOG).isEqualTo(
|
||||
intent.getAction());
|
||||
assertThat(TextUtils.equals(MediaOutputSliceConstants.SYSTEMUI_PACKAGE_NAME,
|
||||
intent.getPackage())).isTrue();
|
||||
assertThat(mToken == intent.getExtras().getParcelable(
|
||||
MediaOutputSliceConstants.KEY_MEDIA_SESSION_TOKEN)).isTrue();
|
||||
}
|
||||
@@ -222,12 +224,14 @@ public class MediaOutputIndicatorSliceTest {
|
||||
public void getMediaOutputSliceIntent_withoutActiveLocalMedia_verifyIntentExtra() {
|
||||
doReturn(mMediaController).when(sMediaOutputIndicatorWorker)
|
||||
.getActiveLocalMediaController();
|
||||
final Intent intent = mMediaOutputIndicatorSlice.getMediaOutputSliceIntent();
|
||||
final Intent intent = mMediaOutputIndicatorSlice.getMediaOutputDialogIntent();
|
||||
|
||||
assertThat(TextUtils.isEmpty(intent.getStringExtra(
|
||||
MediaOutputSliceConstants.EXTRA_PACKAGE_NAME))).isTrue();
|
||||
assertThat(MediaOutputSliceConstants.ACTION_MEDIA_OUTPUT).isEqualTo(intent.getAction());
|
||||
assertThat(TextUtils.equals(Utils.SETTINGS_PACKAGE_NAME, intent.getPackage())).isTrue();
|
||||
assertThat(MediaOutputSliceConstants.ACTION_LAUNCH_MEDIA_OUTPUT_DIALOG).isEqualTo(
|
||||
intent.getAction());
|
||||
assertThat(TextUtils.equals(MediaOutputSliceConstants.SYSTEMUI_PACKAGE_NAME,
|
||||
intent.getPackage())).isTrue();
|
||||
assertThat(intent.getExtras().getParcelable(
|
||||
MediaOutputSliceConstants.KEY_MEDIA_SESSION_TOKEN) == null).isTrue();
|
||||
}
|
||||
|
@@ -299,9 +299,9 @@ public class MediaOutputPreferenceControllerTest {
|
||||
|
||||
mPreference.setKey(TEST_KEY);
|
||||
mController.handlePreferenceTreeClick(mPreference);
|
||||
verify(mContext).startActivity(intentCaptor.capture());
|
||||
verify(mContext).sendBroadcast(intentCaptor.capture());
|
||||
assertThat(intentCaptor.getValue().getAction())
|
||||
.isEqualTo(MediaOutputSliceConstants.ACTION_MEDIA_OUTPUT);
|
||||
.isEqualTo(MediaOutputSliceConstants.ACTION_LAUNCH_MEDIA_OUTPUT_DIALOG);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user