Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2688639b authored by Tim Peng's avatar Tim Peng
Browse files

Add package name when launching output switcher from remote slice

Bug: 150742783
Test: make -j42 RunSettingsRoboTests
Change-Id: I670870cd314dc9a51d7a9a58837b95b4b8cf8808
parent 9a1701b4
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -112,7 +112,8 @@ public class RemoteMediaSlice implements CustomSliceable {
                    .setTitle(outputTitle)
                    .setSubtitle(mediaDevice.getName())
                    .setTitleItem(emptyIcon, ListBuilder.ICON_IMAGE)
                    .setPrimaryAction(getMediaOutputSliceAction()));
                    .setPrimaryAction(getMediaOutputSliceAction(
                            mediaDevice.getClientPackageName())));
        }
        return listBuilder.build();
    }
@@ -144,10 +145,11 @@ public class RemoteMediaSlice implements CustomSliceable {
        return primarySliceAction;
    }

    private SliceAction getMediaOutputSliceAction() {
    private SliceAction getMediaOutputSliceAction(String packageName) {
        final Intent intent = new Intent()
                .setAction(MediaOutputSliceConstants.ACTION_MEDIA_OUTPUT)
                .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
                .putExtra(MediaOutputSliceConstants.EXTRA_PACKAGE_NAME, packageName);
        final IconCompat icon = IconCompat.createWithResource(mContext,
                R.drawable.ic_volume_remote);
        final PendingIntent primaryActionIntent = PendingIntent.getActivity(mContext,