Revert intent action to show media output switcher dialog.
Bug: 246997969 Bug: 258532462 Test: manual. Change-Id: I936b4c3e599a0ad4528ba28b8e3e974feecf103f
This commit is contained in:
@@ -10545,7 +10545,6 @@ package android.content {
|
||||
field public static final String ACTION_SEND_MULTIPLE = "android.intent.action.SEND_MULTIPLE";
|
||||
field public static final String ACTION_SET_WALLPAPER = "android.intent.action.SET_WALLPAPER";
|
||||
field public static final String ACTION_SHOW_APP_INFO = "android.intent.action.SHOW_APP_INFO";
|
||||
field public static final String ACTION_SHOW_OUTPUT_SWITCHER = "android.intent.action.SHOW_OUTPUT_SWITCHER";
|
||||
field public static final String ACTION_SHOW_WORK_APPS = "android.intent.action.SHOW_WORK_APPS";
|
||||
field public static final String ACTION_SHUTDOWN = "android.intent.action.ACTION_SHUTDOWN";
|
||||
field public static final String ACTION_SYNC = "android.intent.action.SYNC";
|
||||
|
||||
@@ -3586,17 +3586,6 @@ public class Intent implements Parcelable, Cloneable {
|
||||
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
|
||||
public static final String ACTION_MEDIA_BUTTON = "android.intent.action.MEDIA_BUTTON";
|
||||
|
||||
/**
|
||||
* Broadcast action: Launch System output switcher. Includes a single extra field,
|
||||
* {@link #EXTRA_PACKAGE_NAME}, which specifies the package name of the calling app
|
||||
* so that the system can get the corresponding MediaSession for the output switcher.
|
||||
*
|
||||
* @see #EXTRA_PACKAGE_NAME
|
||||
*/
|
||||
@SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
|
||||
public static final String ACTION_SHOW_OUTPUT_SWITCHER =
|
||||
"android.intent.action.SHOW_OUTPUT_SWITCHER";
|
||||
|
||||
/**
|
||||
* Broadcast Action: The "Camera Button" was pressed. Includes a single
|
||||
* extra field, {@link #EXTRA_KEY_EVENT}, containing the key event that
|
||||
|
||||
@@ -1000,7 +1000,6 @@
|
||||
<action android:name="com.android.systemui.action.LAUNCH_MEDIA_OUTPUT_DIALOG" />
|
||||
<action android:name="com.android.systemui.action.LAUNCH_MEDIA_OUTPUT_BROADCAST_DIALOG" />
|
||||
<action android:name="com.android.systemui.action.DISMISS_MEDIA_OUTPUT_DIALOG" />
|
||||
<action android:name="android.intent.action.SHOW_OUTPUT_SWITCHER" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
|
||||
@@ -36,10 +36,6 @@ class MediaOutputDialogReceiver @Inject constructor(
|
||||
) : BroadcastReceiver() {
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
when {
|
||||
TextUtils.equals(Intent.ACTION_SHOW_OUTPUT_SWITCHER, intent.action) -> {
|
||||
val packageName: String? = intent.getStringExtra(Intent.EXTRA_PACKAGE_NAME)
|
||||
launchMediaOutputDialogIfPossible(packageName)
|
||||
}
|
||||
TextUtils.equals(
|
||||
MediaOutputConstants.ACTION_LAUNCH_MEDIA_OUTPUT_DIALOG, intent.action) -> {
|
||||
val packageName: String? =
|
||||
|
||||
@@ -53,36 +53,6 @@ public class MediaOutputDialogReceiverTest extends SysuiTestCase {
|
||||
mMockMediaOutputBroadcastDialogFactory);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void showOutputSwitcher_ExtraPackageName_DialogFactoryCalled() {
|
||||
Intent intent = new Intent(Intent.ACTION_SHOW_OUTPUT_SWITCHER);
|
||||
intent.putExtra(Intent.EXTRA_PACKAGE_NAME, getContext().getPackageName());
|
||||
mMediaOutputDialogReceiver.onReceive(getContext(), intent);
|
||||
|
||||
verify(mMockMediaOutputDialogFactory, times(1))
|
||||
.create(getContext().getPackageName(), false, null);
|
||||
verify(mMockMediaOutputBroadcastDialogFactory, never()).create(any(), anyBoolean(), any());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void showOutputSwitcher_WrongExtraKey_DialogFactoryNotCalled() {
|
||||
Intent intent = new Intent(Intent.ACTION_SHOW_OUTPUT_SWITCHER);
|
||||
intent.putExtra("Wrong Package Name Key", getContext().getPackageName());
|
||||
mMediaOutputDialogReceiver.onReceive(getContext(), intent);
|
||||
|
||||
verify(mMockMediaOutputDialogFactory, never()).create(any(), anyBoolean(), any());
|
||||
verify(mMockMediaOutputBroadcastDialogFactory, never()).create(any(), anyBoolean(), any());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void showOutputSwitcher_NoExtra_DialogFactoryNotCalled() {
|
||||
Intent intent = new Intent(Intent.ACTION_SHOW_OUTPUT_SWITCHER);
|
||||
mMediaOutputDialogReceiver.onReceive(getContext(), intent);
|
||||
|
||||
verify(mMockMediaOutputDialogFactory, never()).create(any(), anyBoolean(), any());
|
||||
verify(mMockMediaOutputBroadcastDialogFactory, never()).create(any(), anyBoolean(), any());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void launchMediaOutputDialog_ExtraPackageName_DialogFactoryCalled() {
|
||||
Intent intent = new Intent(MediaOutputConstants.ACTION_LAUNCH_MEDIA_OUTPUT_DIALOG);
|
||||
|
||||
Reference in New Issue
Block a user