Android M:无法以编程方式删除WIFI AP
在Android M中:我正在使用以下代码删除当前连接的WIFI AP.
In Android M: I am using below code to remove current connected WIFI AP.
void RemoveConnectedNetwork(){
int ID=_wifiManager.getConnectionInfo().getNetworkId();
Log.d("test", "network id = ["+ID+"]");
boolen ret =_wifiManager.removeNetwork(ID);
Log.d("test", "removeNetwork return ="+ret);
_wifiManager.saveConfiguration();
}
但RemoveConnectedNetwork()
始终返回 false .
尽管此API在以前的版本中运行良好.
Although this API was working well in previous releases.
使用Android M中的任何其他API可以解决此问题的解决方案吗?
Any solution that can be achieved on this using any other API in Android M?
谢谢.
Android 6.0中的Wifi管理器中有一些更改.
There are some changes in the Wifi Manager in Android 6.0.
如果 WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN 为非零,则由活动设备所有者创建的任何Wi-Fi配置都将不再由用户修改或删除.
Any Wi-Fi configuration created by an active Device Owner can no longer be modified or deleted by the user if WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN is non-zero.
用户仍然可以创建和修改自己的Wi-Fi配置.
The user can still create and modify their own Wi-Fi configurations.
活动设备所有者有权编辑或删除任何Wi-Fi配置,包括不是由他们创建的配置.
Active Device Owners have the privilege of editing or removing any Wi-Fi configurations, including those not created by them.
有关更多详细信息,请参阅此链接: https://developer.android.com/about/versions/marshmallow/android-6.0-changes.html
Please refer to this link for further details: https://developer.android.com/about/versions/marshmallow/android-6.0-changes.html