Android 6.0 made some changes to the WiFi behavior and it breaks my app behavior and cannot find a solution for it.
Basically, for Android 6.0 you are not permitted to modify or delete WifiConfiguration objects that are not created by your app. This means I need to always create my own WifiConfiguration objects. However, if there is already a WifiConfiguration for a particular AP made by the user or other app, I cannot create another one for that AP.
wifiManager.addNetwork(wifiConfiguration) returns -1. This works on all previous Android versions but not on Android 6.0
So I am stuck. Is this an Android bug? I imagine a lot of developers should suffer from this if they develop apps for custom hardware that has its own WiFi access point.