Skip to main content
Participant
August 6, 2012
Question

reverting back to SystemIdleMode.NORMAL not working on Kindle Fire

  • August 6, 2012
  • 2 replies
  • 2178 views

I'm writing an app that disables the screen dim and keygaurd lock while the app is in use, but when a user navigates away from the app (i.e. goes to the home screen) then the screen dim and keygaurd is re-enabled.  I'm testing this on physical devices and it works on all other android devices that I have tested except for Kindle Fire.  So, when I go to the home screen and navigate away from my app the keygaurd and screen dim is still disabled so the kindle just stays on unless I manually locked it.  I know Kindle Fire is a modified version of the Android operating system, so it kind of makes sense that some things might work differently on a kindle.  I was wondering if anyone else has solved this issue or has any ideas about how to make it work?  Here is the code I'm using and I have DISABLE_KEYGUARD and WAKE_LOCK permissions selected:

stage.addEventListener(Event.DEACTIVATE, onLeave);

stage.addEventListener(Event.ACTIVATE, onComeBack);

private function onLeave(e:Event):void

                    {

     NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.NORMAL;

     movieHandler.movieScreen.pauseCurrentMovie();

                    }

                    private function onComeBack(e:Event):void

                    {

    NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.KEEP_AWAKE;

                    }

I know that the onLeave function gets executed because the movie that is playing gets paused when I go to the home screen.  If I comment out that line then then the sound would just keep playing.  Thank in advance for any help.

This topic has been closed for replies.

2 replies

Participant
November 9, 2012

It is recommended that you try the following: In order to solve this problem.

Setting Permissions:

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

And

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

It is also mandatory.

Participant
June 10, 2015

thank u it worked for me

Colin Holgate
Inspiring
August 7, 2012

What you say seems to be the case. I use keep awake and normal switching within my app, to keep things going while showing a long non-interactive part, and to let things sleep during interactive parts. It fixed the issue for other Android devices, but doesn't seem to for my Kindle Fire.

So, I think it's not specifically because of the Home button, but something more general with the way the NativeApplication.nativeApplication.systemIdleMode works on Kindle Fire.

BobF1955Author
Participant
August 7, 2012

Thanks Colin.  Glad to hear someone else had this issue and not just me.  It's definitely not a deal breaker for what I'm doing, but I'm just trying to make the user experience as best as possible, especially since I think the kindle fire is most widely used android tablet. 

There may not be a solution to the issue, but if anyone else has any ideas I definitely appreciate them.

Thanks,

Bob

September 17, 2012

I'm noticing the same exact behavior in my AIR Android app! I can set it to stay awake and it works! But when I revert it back...It still keeps it awayke even though i've convifrmed i've set it back to NORMAL. Did you ever figure out what's going on?