My app can establish WiFi P2P connection. The link describes Bypassing user approval.
https://developer.android.com/develop/connectivity/wifi/wifi-bootstrap#bypass-approval
Bypassing user approval
Once the user approves a network to connect to in response to a request from a specific app, the device stores the approval for the particular access point. If the app makes a specific request to connect to that access point again, the device skips the user approval phase and automatically connects to the network. If the user chooses to forget the network while connected to a network requested by the API, then this stored approval for that combination of app and network is removed, and any future request from the app must be approved by the user again. If the app makes a non-specific request, such as with an SSID or BSSID pattern, then the user must approve the request.
Now I want to show dialog for approval again. So I want to remove the stored approval. But I cannot find the way except removing the app. If anyone know, please give me the details?
I tried the call, it does not solve the issue.
connectivityManager.unregisterNetworkCallback(networkCallback)
For security reasons there's no API for this and it's up to user to either approve new connection or revoke existing approvals. If for any reason you want to play with this you should simply communicate the user that. I am unable to guess your real requirements for this feature but it could probably worth re-thinking it first. I am having bit hard times trying what would be the use case justifying manipulation of user approvals behind his back.
Of course rooted devices are other story but that's out of the scope.