[Media TTT] Use clientPackageName instead of packageName to fetch
transfer application info. The client who's notifying SysUI of the transfer needs to create a new MediaRoute2Info object to inform us about the media route, and they're only able to access `setClientPackageName`, not `setPackageName`. Fixes: 241930323 Test: manual Test: media.taptotransfer tests Change-Id: Ie17f561d3390ef0daf85a9343f74b3d46355a008
This commit is contained in:
@@ -68,7 +68,7 @@ class MediaTttCommandLineHelper @Inject constructor(
|
||||
.addFeature("feature")
|
||||
val useAppIcon = !(args.size >= 3 && args[2] == "useAppIcon=false")
|
||||
if (useAppIcon) {
|
||||
routeInfo.setPackageName(TEST_PACKAGE_NAME)
|
||||
routeInfo.setClientPackageName(TEST_PACKAGE_NAME)
|
||||
}
|
||||
|
||||
statusBarManager.updateMediaTapToTransferSenderDisplay(
|
||||
@@ -134,7 +134,7 @@ class MediaTttCommandLineHelper @Inject constructor(
|
||||
.addFeature("feature")
|
||||
val useAppIcon = !(args.size >= 2 && args[1] == "useAppIcon=false")
|
||||
if (useAppIcon) {
|
||||
routeInfo.setPackageName(TEST_PACKAGE_NAME)
|
||||
routeInfo.setClientPackageName(TEST_PACKAGE_NAME)
|
||||
}
|
||||
|
||||
statusBarManager.updateMediaTapToTransferReceiverDisplay(
|
||||
|
||||
@@ -143,7 +143,7 @@ class MediaTttChipControllerReceiver @Inject constructor(
|
||||
super.updateChipView(newChipInfo, currentChipView)
|
||||
setIcon(
|
||||
currentChipView,
|
||||
newChipInfo.routeInfo.packageName,
|
||||
newChipInfo.routeInfo.clientPackageName,
|
||||
newChipInfo.appIconDrawableOverride,
|
||||
newChipInfo.appNameOverride
|
||||
)
|
||||
|
||||
@@ -122,7 +122,7 @@ class MediaTttChipControllerSender @Inject constructor(
|
||||
val chipState = newChipInfo.state
|
||||
|
||||
// App icon
|
||||
val iconName = setIcon(currentChipView, newChipInfo.routeInfo.packageName)
|
||||
val iconName = setIcon(currentChipView, newChipInfo.routeInfo.clientPackageName)
|
||||
|
||||
// Text
|
||||
val otherDeviceName = newChipInfo.routeInfo.name.toString()
|
||||
|
||||
@@ -241,5 +241,5 @@ private const val PACKAGE_NAME = "com.android.systemui"
|
||||
|
||||
private val routeInfo = MediaRoute2Info.Builder("id", "Test route name")
|
||||
.addFeature("feature")
|
||||
.setPackageName(PACKAGE_NAME)
|
||||
.setClientPackageName(PACKAGE_NAME)
|
||||
.build()
|
||||
|
||||
@@ -686,5 +686,5 @@ private const val TIMEOUT = 10000
|
||||
|
||||
private val routeInfo = MediaRoute2Info.Builder("id", OTHER_DEVICE_NAME)
|
||||
.addFeature("feature")
|
||||
.setPackageName(PACKAGE_NAME)
|
||||
.setClientPackageName(PACKAGE_NAME)
|
||||
.build()
|
||||
|
||||
Reference in New Issue
Block a user