SHAKTHI62 / openintents

Automatically exported from code.google.com/p/openintents
0 stars 0 forks source link

OI Shopping List: Disable screen lock only when using the app #431

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Reported by Hannu K.:

"I noticed one thing and I'm hoping it can be fixed.
I disabled screen lock in Settings -> Advanced settings.
But when exiting the app by pressing the "Home" key, the screen
lock is still disabled while in a home screen.

Is it possible to have the screen lock disabled only when using the app ?

I'm using Samsung Galaxy S II with Android 2.3.5."

Original issue reported on code.google.com by peli0...@googlemail.com on 11 Dec 2011 at 5:57

GoogleCodeExporter commented 9 years ago
Hmm, I'm wondering can this be accomplished by enabling screen lock when the 
timer for autolock of OI Safe starts? And when the timer is stopped, when the 
user opens OI Safe, the screen lock can be disabled again. I mean, the 
enable/disable screen lock stuff to be inside the timer methods?

Original comment by dkremov on 22 Dec 2011 at 12:35

GoogleCodeExporter commented 9 years ago
Should be much easier than that... it should be handled in the onPause / 
onResume methods of the main shopping activity.

Original comment by AaronPer...@gmail.com on 22 Dec 2011 at 1:33

GoogleCodeExporter commented 9 years ago
Oh, yeah, sorry, didn't notice it was for Shopping List, not Safe. But I think 
it should be mentioned somewhere that the screen lock is disabled (if chosen in 
the menu) only while the app is open, if this gets implemented.

Original comment by dkremov on 22 Dec 2011 at 8:19

GoogleCodeExporter commented 9 years ago
I noticed that SCREEN_BRIGHT_WAKE_LOCK is used for the disabling of screen 
lock, but the developer.android.com says:
"This constant is deprecated. Most applications should use FLAG_KEEP_SCREEN_ON 
instead of this type of wake lock, as it will be correctly managed by the 
platform as the user moves between applications and doesn't require a special 
permission. Wake lock that ensures that the screen is on at full brightness; 
the keyboard backlight will be allowed to go off. "

FLAG_KEEP_SCREEN_ON could probably be used to ensure that the screen lock is 
disabled only while the app is open. 
http://developer.android.com/reference/android/view/WindowManager.LayoutParams.h
tml#FLAG_KEEP_SCREEN_ON

Original comment by dkremov on 23 Dec 2011 at 5:22

GoogleCodeExporter commented 9 years ago
http://www.google-melange.com/gci/task/view/google/gci2011/7136285

Original comment by AaronPer...@gmail.com on 25 Dec 2011 at 1:33

GoogleCodeExporter commented 9 years ago

Original comment by peli0...@googlemail.com on 25 Dec 2011 at 12:43

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r3944.

Original comment by rmce...@gmail.com on 28 Dec 2011 at 11:55