Skip to main content
Inspiring
Oct 17, 2013 4:57 PM UTC
Question

Android: Keeping screen awake + enabling the keyguard, possible?

The people at the Samsung App Store have a problem with disabling the lockscreen on their apps.

So when I have these 2 permissions enabled:


<uses-permission android:name="android.permission.WAKE_LOCK" />

<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />

it makes sure the application does not dim the screen, however it also disables the lockscreen of course.

Is there no way to make sure the screen does not dim while still having the lockscreen enabled?

SInce Samsung rejects apps for this...

This topic is closed to new replies. Start a new post to keep the conversation going.

4 replies

Oldes
Inspiring
Nov 3, 2016 1:09 PM UTC

I had the same problem so I implemented own keepAwake function as a part of this open source ANE https://github.com/Oldes/ANEAndroidCommon

Translate
itlancer
Inspiring
Oct 11, 2014 3:44 PM UTC
jadams602
Inspiring
Oct 17, 2013 5:01 PM UTC

Have you also set:

NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.KEEP_AWAKE;

Translate
Bram_0Author
Inspiring
Oct 17, 2013 5:13 PM UTC

I did actually, and I toggle between the NORMAL and KEEP_AWAKE when going into the background.

But somehow I managed to get the screen to stay awake without that DISABLE_KEYGUARD line in the permissions at this point.

So I think it's fully working... it's still strange that it went to dim the screen at a certain point in a previous build of my app.

Translate