Merge "Revert intent action to show media output switcher dialog."

This commit is contained in:
Bishoy Gendy
2023-01-13 15:52:16 +00:00
committed by Android (Google) Code Review
5 changed files with 0 additions and 47 deletions

View File

@@ -10619,7 +10619,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";

View File

@@ -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

View File

@@ -1004,7 +1004,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>

View File

@@ -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? =

View File

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