For other people who are looking for, That's Settings.System with permission WRITTE_SETTINGS
On 28 oct, 06:25, Arun <[email protected]> wrote: > Can someone from Android expert team kindly look into this? > > Regards, > -Arun > > On Oct 23, 6:51 pm, Arun Tripathy <[email protected]> wrote: > > > > > Hi All, > > > I have a requirement to turn the screen display on and off from a Android > > Service. I should have a function SwitchScreenDisplay (ON/OFF), to ON or OFF > > the display. > > > I searched through the SDK and found a few APIs and settings. One method I > > found is > > boolean err = > > android.provider.Settings.Secure.putInt(myThis.getContentResolver(), > > Settings.System.SCREEN_OFF_TIMEOUT, 1); > > > But it gave the following security permission exception [03-14 21:24:41.575: > > ERROR/DatabaseUtils(1066): java.lang.SecurityException: Permission denial: > > writing to secure settings requires > > android.permission.WRITE_SECURE_SETTINGS] > > even though I had added the following statement in > > AndroidMenifestFile.xml <uses-permission > > android:name="android.permission.WRITE_SECURE_SETTINGS"></uses-permission> > > > So my question is: > > - Was the above method is the right way to SWITCH OFF the screen > > - How does the LONG END KEY press, switches/powers off the display? Which > > API it calls? > > - How to SWITCH on? Is it using the PowerManager wakelock? > > > I appreciate and thankful for your time. > > > Regards, > > -Arun -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

