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

What is the reason for getting this error when compiling the code of sending MMS? Why can't I read APNs in Android 4.0 and up?

pat
  • 12,587
  • 1
  • 23
  • 52
michelle13
  • 89
  • 1
  • 11

1 Answers1

1

I am directly copied the answer from here which is given by CommonsWare.

This appears to be an intentional change. The git commit where they added this defense includes the following comment:

 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.

It is conceivable that your issue will cause them to consider adding a separate read permission, but at least for the time being, this is a regression in 4.2.

Community
  • 1
  • 1
Zusee Weekin
  • 1,348
  • 2
  • 18
  • 41
  • what do you mean by the regression? so with my current code, i can't read or write APN settings because it is not permitted? thanks for your answer – michelle13 Mar 03 '14 at 00:21
  • @michelle13 If you want to Read APN for Android 4.0+, there are changes to do. Follow the link I have given in the answer. – Zusee Weekin Mar 03 '14 at 06:33