2 qq 22056849 qq_22056849 于 2016.03.15 14:27 提问

基于安卓和三星的knox开发对apn的读写功能遇到一些问题 50C

加入权限:


创建apn方法:
//新建一个apn
public long createApn(){
EnterpriseDeviceManager edm = (EnterpriseDeviceManager)
getSystemService(EnterpriseDeviceManager.ENTERPRISE_POLICY_SERVICE);

ApnSettingsPolicy apnSettingsPolicy = edm.getApnSettingsPolicy();
ApnSettings apnSettings = new ApnSettings();
apnSettings.user = "ApnUser";
apnSettings.password = "1234";
apnSettings.server = "ApnServer";
apnSettings.mmsc = "http://mms.msg.eg.t-mobile.com/mms/wapenc";
apnSettings.mmsProxy = "127.0.0.0";
apnSettings.mmsPort = "80";
apnSettings.mcc = "310";
apnSettings.mnc = "260";
apnSettings.type = "default";
try {
long ret= apnSettingsPolicy.createApnSettings(apnSettings);
if (ret != -1) {
Log.w("APN", "APN created");
} else {
Log.w("APN", "APN creation failed");
}
return ret;
} catch (SecurityException e) {
Log.w("eeeeeeeeeeee", "SecurityException: " + e);

    }
    return -1;
}

程序运行后ret一直等于-1 新增失败,求问题所在

2个回答

qq_22056849
qq_22056849   2016.03.15 14:28

权限 代码在这里


qq_22056849
qq_22056849   2016.03.15 14:29

图片说明

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!