Tuesday, August 9, 2011

[android-developers] should DeviceAdmin.setMaximumTimeToLock require android.permission.WRITE_SETTINGS ?

I've got an application that works on lots of devices, but lately a
customer with a
CASIO C771 running 2.2.1 is failing when my device administrator
attempts to set the maximum lock timeout.

java.lang.reflect.InvocationTargetException
at
android.app.admin.DevicePolicyManager.setMaximumTimeToLock(DevicePolicyManager.java:
522)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at
*************************************************************DeviceAdmin.java:
368)
at
*************************************************************DeviceAdmin.java:
698)
at
*************************************************************(DeviceAdmin.java:
605)
at
*************************************************************DeviceAdmin.java:
92)
at android.app.ActivityThread.handleReceiver(ActivityThread.java:
2814)
at android.app.ActivityThread.access$3200(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:
2087)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4646)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:858)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.SecurityException: Permission Denial: writing
com.android.providers.settings.SettingsProvider uri content://settings/system
from pid=8957, uid=10104 requires android.permission.WRITE_SETTINGS
at android.os.Parcel.readException(Parcel.java:1247)
at android.os.Parcel.readException(Parcel.java:1235)
at android.app.admin.IDevicePolicyManager$Stub
$Proxy.setMaximumTimeToLock(IDevicePolicyManager.java:1038)
... 18 more


No where in the documentation do I find this requirement and it
doesn't seem to be needed for other devices..

Does this make sense?

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment