Android 4.0+读取APN发送彩信时出错

时间:2014-03-02 23:58:12

标签: java android

java.lang.SecurityException: No permission to write APN settings: Neither user 10099 nor   current process has android.permission.WRITE_APN_SETTINGS.

编译发送彩信代码时出现此错误的原因是什么?为什么我不能在Android 4.0及更高版本中读取APN?

1 个答案:

答案 0 :(得分:1)

我直接复制了来自CommonsWare的here的答案。

这似乎是故意的改变。 git commit where they added this defense包含以下评论:

 Since the DB may contain corp passwords, we should secure it. Using the same permission as writing to the DB as the read is potentially as damaging as a write.

可以想象,您的问题会导致他们考虑添加单独的读取权限,但至少目前这是4.2中的回归。