Skip to content

Commit 5e0cc0d

Browse files
committed
Fix port logic in WifiDisplayController.
It's not the port advertised in the sink's wfd IE, it's the one our source broadcasts in its wfd IE. In addition some dongles ignore the broadcast port and have to be special cased. Change-Id: Id5d279652e336391ba34dfc30bba700043d49b1d
1 parent 753e128 commit 5e0cc0d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

services/java/com/android/server/display/WifiDisplayController.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,8 +493,13 @@ public void onFailure(int reason) {
493493
return; // done
494494
}
495495

496-
WifiP2pWfdInfo wfdInfo = mConnectedDevice.wfdInfo;
497-
int port = (wfdInfo != null ? wfdInfo.getControlPort() : DEFAULT_CONTROL_PORT);
496+
int port = DEFAULT_CONTROL_PORT;
497+
if (mConnectedDevice.deviceName.startsWith("DIRECT-")
498+
&& mConnectedDevice.deviceName.endsWith("Broadcom")) {
499+
// These dongles ignore the port we broadcast in our WFD IE.
500+
port = 8554;
501+
}
502+
498503
final WifiDisplay display = createWifiDisplay(mConnectedDevice);
499504
final String iface = addr.getHostAddress() + ":" + port;
500505

0 commit comments

Comments
 (0)