Android M:无法以编程方式删除WIFI AP [英] Android M: Unable to remove WIFI AP programmatically

查看:264
本文介绍了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

这篇关于Android M:无法以编程方式删除WIFI AP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆