Skip to main content
Inspiring
October 17, 2013
Question

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

  • October 17, 2013
  • 3 replies
  • 3375 views

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 has been closed for replies.

3 replies

Oldes
Inspiring
November 3, 2016

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

itlancer
Inspiring
October 11, 2014
jadams602
Inspiring
October 17, 2013

Have you also set:

NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.KEEP_AWAKE;

Bram_0Author
Inspiring
October 17, 2013

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.