Fix output switcher will display previous media session
Before this CL, the same request code will cause intent to
be cached. It will cause the output switcher to display the
previous media session.
This CL uses the package name as an unique request code to
fix this issue.
Bug: 169077753
Test: make -j42 RunSettingsRoboTests
Change-Id: Iebfc7904609e243d5bf0222307bae98a952a3331
Merged-In: Iebfc7904609e243d5bf0222307bae98a952a3331
(cherry picked from commit c3fe8d87d6
)
This commit is contained in:
@@ -151,8 +151,9 @@ public class RemoteMediaSlice implements CustomSliceable {
|
||||
.putExtra(MediaOutputSliceConstants.EXTRA_PACKAGE_NAME, packageName);
|
||||
final IconCompat icon = IconCompat.createWithResource(mContext,
|
||||
R.drawable.ic_volume_remote);
|
||||
final int requestCode = TextUtils.isEmpty(packageName) ? 0 : packageName.hashCode();
|
||||
final PendingIntent primaryActionIntent = PendingIntent.getActivity(mContext,
|
||||
0 /* requestCode */, intent, 0 /* flags */);
|
||||
requestCode, intent, 0 /* flags */);
|
||||
final SliceAction primarySliceAction = SliceAction.createDeeplink(
|
||||
primaryActionIntent, icon, ListBuilder.ICON_IMAGE,
|
||||
mContext.getString(R.string.media_output_label_title,
|
||||
|
Reference in New Issue
Block a user