android wifi开发无法删除某个ssid的问题
xs813 2016-10-25 11:21:56 求大神帮忙看下,写了段程序是查询某个ssid并把其删除。代码如下:
public void RemoveSsid(String SSID)
{
WifiConfiguration tempConfig = this.IsExsits(SSID);
if (tempConfig != null) {
Log.d(TAG, "xs20161024 tempConfig is not null 2,id: " + tempConfig.networkId);
mWifiManager.removeNetwork(tempConfig.networkId);
mWifiManager.saveConfiguration();
} else {
Log.i(TAG, "IsExsits is null.");
}
}
但实际运行下来发现并不能删除找到的ssid,l查看log如下:
01-02 12:28:34.561 7151 7151 E WifiManager: removeNetwork(), enter. netId=1 getNameForPid(7151)=com.zte.testproxy
01-02 12:28:34.561 2939 3944 D WifiStateMachine: handleMessage: E msg.what=131125
01-02 12:28:34.561 2939 3944 D WifiStateMachine: processMsg: DisconnectedState
01-02 12:28:34.561 2939 3944 D WifiStateMachine: processMsg: ConnectModeState
01-02 12:28:34.561 2939 3944 W WifiStateMachine: Not authorized to remove network cnid=1 uid=10097
01-02 12:28:34.561 2939 3944 D WifiStateMachine: handleMessage: X
01-02 12:28:34.561 7267 7267 W Finsky : [1] com.google.android.finsky.FinskyApp.i(1536): No account configured on this device.
01-02 12:28:34.561 7151 7151 E WifiManager: saveConfiguration(), enter. getNameForPid(7151)=com.zte.testproxy
01-02 12:28:34.561 2939 3944 D WifiStateMachine: handleMessage: E msg.what=131130
01-02 12:28:34.561 2939 3944 D WifiStateMachine: processMsg: DisconnectedState
01-02 12:28:34.561 2939 3944 D WifiStateMachine: processMsg: ConnectModeState
其中有一条:
WifiStateMachine: Not authorized to remove network cnid=1 uid=10097
这个是权限不够导致的吗。哪位大神知道怎么解决该问题?多谢!