Update OutputSwitcher from MediaOutputSlice to MediaOutputDialog in Settings am: 7127fff467

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/13115228

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Id0fc610e5b5f17f9788fc12b96d2871c20be9725
This commit is contained in:
timhypeng
2020-12-08 06:28:49 +00:00
committed by Automerger Merge Worker
7 changed files with 83 additions and 39 deletions

View File

@@ -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();
}

View File

@@ -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);
}
/**