Closed viniciuscb closed 1 year ago
Could you please explain why you've removed if statement?
I copied code from here:
...
} else if (WifiP2pManager.WIFI_P2P_CONNECTION_CHANGED_ACTION.equals(action)) {
if (manager == null) {
return;
}
NetworkInfo networkInfo = (NetworkInfo) intent
.getParcelableExtra(WifiP2pManager.EXTRA_NETWORK_INFO);
if (networkInfo.isConnected()) {
// We are connected with the other device, request connection
// info to find group owner IP
manager.requestConnectionInfo(channel, connectionListener);
}
...
Source: https://developer.android.com/training/connect-devices-wirelessly/wifi-direct#connect
Yes, this is preventing the user's code to receive an update on connectionInfo when the connection is closed by the other peer.
After this patch, I started receiving updates when connection is closed. See this log:
{"groupFormed": false, "groupOwnerAddress": null, "isGroupOwner": false}
with this patch the user can realiably look into connectionInfo.groupFormed to see if the connection with other peers is open or closed.
Okay, looks good 👍 Could you please fix java-lint/formatting issues?
Just run node scripts/java-lint.js
and it should automatically resolve all issues
linted
FIXES #74