Sorry, applications can not modify secure settings.

On Thu, Nov 19, 2009 at 9:13 PM, krekar <swbon...@gmail.com> wrote:

> Hi.
>
> I wanna set the ADB_ENABLED and USB_MASS_STORAGE_ENABLED option
> automatically  in my App.
>
> so i add below statement in my App(Activity).
>
> ----------------------
> Settings.Secure.putInt(getContentResolver(),
> Settings.Secure.ADB_ENABLED, 0);
>
> or
>
> Settings.Secure.putInt(getContentResolver(),
> Settings.Secure.ADB_ENABLED, 1);
> ----------------------
>
> and add below statement in my App(manifest).
>
> ----------------------
> ....
> </application>
>        <uses-permission android:name="android.permission.WRITE_SETTINGS" />
>        <uses-permission
> android:name="android.permission.WRITE_SECURE_SETTINGS" />
> ....
> ----------------------
>
> but some exception are occured in runtime like below.
>
> ----------------------
> Uncaught hander: thread main exiting due to uncaught exception.
> java.lang.SecurityException: Permission denial: writing to secure
> settings requires android.permission.WRITE_SECURE_SETTINGS
> ...
> ----------------------
>
> How i can use ADB_ENABLED and USB_MASS_STORAGE_ENABLED in my App?
>
> --
> 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+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to