【问题标题】:Android 4.0+ Error in Reading APN for sending an MMS [duplicate]Android 4.0+ 读取 APN 以发送彩信时出错 [重复]
【发布时间】:2014-03-03 08:16:17
【问题描述】:
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?

【问题讨论】:

    标签: java android


    【解决方案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的回归。

    【讨论】:

    • 回归是什么意思?所以使用我当前的代码,我无法读取或写入 APN 设置,因为它是不允许的?谢谢你的回答
    • @michelle13 如果您想阅读适用于 Android 4.0+ 的 APN,需要进行一些更改。按照我在答案中给出的链接。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多