Screen turns off immediately when setting systemIdleMode to NORMAL after having been in KEEP_AWAKE

I've found a little issue in Android...
In my application I download some files the first time it's run. Since it takes a couple of minutes without user input, the screen turns off automatically. I've found some tablets not only turn off the screen but also interrupt the download altogether when going to sleep, so to avoid this I'm using this to prevent the screen from turning off (is there any other workaround to prevent downloads being interrupted by sleep?):
NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.KEEP_AWAKE;
Of course, I've also added the WAKE_LOCK and DISABLE_KEYWARD permissions to my app descriptor, so the above code works. The problem is that I don't want the app to stay awake all the time, so after the download finishes, I'm setting the screen back to normal with:
NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.NORMAL;
But after executing that, the screen goes off immediately, instead of waiting for a minute or so before dimming the screen. It's as if the dimming was triggered already during the download process, but didn't actually happen because of the KEEP_AWAKE setting, and then when switching to NORMAL, the screen dimming takes place immediately so it turns off.
Is this an intended behaviour or should I file a bug?
How can I manage to set the systemIdleMode to NORMAL but still have the screen on waiting a bit before going to sleep? Turning off the screen as soon as the download is finished is confusing for the user, who might think the app has frozen when it's really just in sleep mode (and the user has to unlock the screen before going back to the app).
This happens in just about any version of AIR 3.x (and probably below).
Also, it happens in iOS as well, but it's less dramatic because the screen just dims a little (app is still visible) when setting systemIdleMode to NORMAL, instead of turning off completely and locking the screen, which is the behaviour in Android.

undereyes wrote:
this work with iOS 6.0, me app lock
What do you mean? That it doesn't happen in iOS 6.0 anymore? What do you mean with "me app lock"? Please, elaborate

Similar Messages

  • My MacBook turns off immediately when it is not plugged

    Hi all, I've had this macbook for about 2 years now.
    It had no problems at all. (I didn't use my macbook for like months)
    Then I needed it for my school, so I installed windows 7 using bootcamp a few days ago.
    and I've noticed that my macbook turns off immediately when it's unplugged.
    i thought it is because of windows at first time,
    but I booted on with Mac OS and it has same problem.
    It just turns off immediately. and it won't back on until I plug it to charger.
    Is it battery problem? or could it be anything else?

    Sounds like the battery to me. Usually they don't like being left for months especially if fully charged.
    Check the battery health
    Click on the Apple icon at the top left corner of the screen
    Click on "About this Mac"
    Click on "More Info"
    Under Hardware, click on "Power". This will show you information about your battery, including how many cycles the battery has been through, it's charging ability and so on.
    Thanks
    Glenn

  • IPhone screen turns off immediately after a message is sent.

    I am using an iPhone 5S (Running iOS 7.1.1) and whenever I send a message, as soon as my finger taps send, the "lock shutter" blacks out the screen and then unlocks itself after a few seconds. Anyone have any ideas?

    Hey there 4cpukid,
    It sounds like you are experiencing an issue where you tap Send in the Messages app and your phone unexpectedly goes to sleep. I would quit all the running apps on the device first:
    iOS: Force an app to close
    http://support.apple.com/kb/ht5137
    Double-click the Home button.
    Swipe left or right until you have located the app you wish to close.
    Swipe the app up to close it.
    When you have done that reset the phone and test the issue again:
    To reset, press and hold both the Sleep/Wake and Home buttons for at least 10 seconds, until you see the Apple logo.
    iOS: Turning off and on (restarting) and resetting
    http://support.apple.com/kb/ht1430
    Thank you for using Apple Support Communities.
    All the very best,
    Sterling

  • Display Turns Off Even When Set to Stay on

    I'm running Lion on my Macbook. I've set the energy settings to never turn off in power adapter mode, but it still turns off after approx. 5 minutes. Is there another place where this setting needs to be configured? This is causing me problems when leaving the computer to do a lengthy process such as compiling a slide show movie. Thanks in advance.

    Reset the SMC

  • Powerbook Pro 17" when unplugged turns off immediately when on battery

    This just started happening yesterday. My powerbook shuts off without warning if the magnetic plug is removed. The battery is showing "charged" right now its at 99%.
    If I try to boot up without the power plugged in I get 1/2 of the startup sound and the powerbook winks off, as if the battery is dead. Plugged in is no problem. Def. something up w/the battery.
    I have version 1.2 of the battery updater installed. Didn't do anything out of the ordinary yesterday I was working in Word. Part of the day I was working off my battery and everything seemed fine. Only noticed the problem when I bumped the magna cord out by mistake and I went to black immediately.
    thougths?
    thanks
    ---K

    I would call back and push the issue with someone new.
    I spent an extra 30 minutes on hold waiting to speak with a supervisor to try and get the battery expedited (5-7 BUSINESS days!?!?!?) and he told me that they do not upgrade shipping and never have. However he did tell me that I could take my powerbook to the Apple store and if they have one in stock, they could replace my battery in lieu of waiting the ridiculous timeframe.
    inconsistencies abound!
    1) the rep initially told me I cannot go to an apple store to get my replacement battery.
    ----the supervisor told me I could
    2) the rep told me 5-7 business days
    ----the supervisor told me Friday at the latest (which makes for 3-5 business days probably)
    Really silly that they can't give a consistent answer...my guess if I talked to the "right" supervisor I could have gotten overnight shipping. who knows.
    I may still go to the Apple store if I have time.
    I will not be installing battery update 1.3 anytime soon.
    ---K

  • Hp pavilion 15 screen turn off for few second when i turn on or off charger

    Hello,
    I bought new hp pavilion 15. i notice many time when i turn on or off my charger, screen turn off for few second then after few second screen turn on. please help me out its furstating me . 
    This question was solved.
    View Solution.

    >> It is customary and in this case Necessary for you to provide the exact model of Notebook you have a problem-with. [ There are MANY variations of HP Pavilion 15-T Models, for example. ]
    >> You should always be sure you have installed/applied ALL updates for all of your Notebook's hardware devices, and ALL Windows Updates labeled "Important" and ALL "Optional"-section Windows Updates for any hardware device in your Notebook which the Windows Updates service detects (and offers an Update for).
    >> For example, this link:  http://h10025.www1.hp.com/ewfrf/wc/softwareCategory?os=4158&lc=en&cc=us&dlc=en&sw_lang=&product=6787... has the latest HP Drivers and Patches for a specific variant of the Pavilion 15-T.
    >> AFTER you are certain you have all the latest drivers and patches in-place, you can try the 'old Trick' as follows: Shutdown Windows; when your Notebook has turned-Off completely (after Shutdown completes), THEN remove the AC Adapter connector and remove the BatteryPack.
    >> Hold DOWN the power-button continuously for a full 62 seconds. Then put your BatteryPack back in your Notebook. Do NOT connect your AC Adapter yet. Power-On the Notebook and Logon into Windows. Check the Control Panel\Power Options settings and find out the Charge Level of your BatteryPack. If it is below 25%, then (and only then) plug in your AC Adapter and connect it to your Notebook... and let the BatteryPack charge up "completely" to 98-100% Level. *Note: if your Adapter has a removable AC cord-connector, be certain that connection is 'tight'. <Do NOT stick your fingers or ANY object into any AC Adapter!> If you even think your AC Adapter is faulty, GET A NEW ONE! Damaging a $400-$800 Notebook PC is NOT worth it, versus the cost of a New Adapter.
    >> Use the built-in Help functions of your Notebook to find out how to DISABLE(!) "Hibernation", and eliminate that TROUBLE-CAUSING 'feature' of Windows PCs. When you have done so, always REStart Windows, to be certain the changes are applied. *Many changes and Updates take place 'Fully' only "during" Shutdown and/or "during" Startup of Windows PCs. [While Windows O.S. is "running", most of it's System Files are LOCKED.]
    >> FYI: always let your BatteryPack run down to it's Lower setting BEFORE you plug-in your AC Adapter/Charger. Charging  any rechargeable BatteryPack at  "mid-charge-levels" causes shorter BatteryPack life...

  • Yoga 2 13 Tablet Screen turns off when in Tablet Mode

    I just bought my Yoga 2 13, when I flip it to Tablet mode, the screen turns off. Apparently it goes to sleep. When I open it it turns on again. Do I need to do any adjustments? or is this a defect?

    Try updating your drivers first: http://mobilesupport.lenovo.com/us/en/products/lap​tops-and-netbooks/yoga-series/yoga-2-13-notebook-l​...
    If that does not help, try a factory reset:
    1. Turn off your Yoga 2 13
    2. Press the tiny button next to the power button on the right
    3. Follow instructions to perform a factory reset
    If none of the above attempts have helped you, it is probably a hardware issue.
    Jonas
    Microsoft MVP: Windows Consumer Expert
    Yoga Tablet 2 10 || ThinkPad X1 Carbon (20A7007MPH) || ThinkPad Helix (3698-6EU) || IdeaCentre B540
    Twitter: @jonashendrickx

  • I am changing to iCloud on my iMac, MacBook Air and my iPhone. My iMac and MacBook both moved over to iCloud but my iPhone when I go to Settings and click on iCloud it shows my Mail setting turned Off. When I turn it on it wants me to create a new

    I am changing to iCloud on my iMac, MacBook Air and my iPhone. My iMac and MacBook both moved over to iCloud but my iPhone when I go to Settings and click on iCloud it shows my Mail setting turned Off. When I turn it on it wants me to create a new email address to turn on iCloud Mail. I already have to "me" accounts plus another email address and don't want to create another one. I don't understand why it's asking me to do this on my iPhone but didn't ask on my iMac or MacBook and is there a way around creating another @me.com email address?

    Hello Timmy790
    Try the suggestions in the article below to resolve the issue of seeing your old Apple ID on your iPhone.
    iOS 7: If you're asked for the password to your previous Apple ID when signing out of iCloud
    http://support.apple.com/kb/ts5223
    Regards,
    -Norm G.

  • When screen turn off, my song also turn off.

    I bough ipod nano (for my watch) but during I listen music when screen turn off the song will turn off also.
    What's wrong.? In the beginning is no problem I can listen non stop music.
    After I try to update version (currently my ipod version 1.1) but seem not success yet.

    Where you restore? On ipod?
    Pls sync with iTune then go to summery tap
    and click Restore.

  • My iphone 4s was updating to like 7.1 or 7.2 and i tried to updating by the iphone but it froze and turned off. and when i tried turning it back on the phone kept going to a screen that said plug it in to your computer i did but it froze at the scree

    my iphone 4s was updating to like 7.1 or 7.2 and i tried to updating by the iphone but it froze and turned off. and when i tried turning it back on the phone kept going to a screen that said plug it in to your computer i did but it froze at the screen where it says plug it into iTunes. ive tried plugging it in to the computer but the phone turns itself off in the process. my old phone broke so I need to use the 4s

    Hi sgray2832,
    If you are having an issue with your iPhone becoming unresponsive or turning off unexpectedly, I would suggest that you troubleshoot using the steps in this article - 
    iOS: Not responding or does not turn on - Apple Support
    Thanks for using Apple Support Communities.
    Best,
    Brett L 

  • I don't think my computer is completely shutting down.  I think it is only going into sleep mode.  When I hit the power button, it turns off immediately instead of shutting down.

    I don't think my Mac Pro is completely shutting down.  When I hit the power button, it just turns off immediately instead of going through the normal shut down procedures.  I heard that I should try resetting the SMC, which involves removing the power cord.  However, when I remove and replace the power cord, it turns on automatically, so I can't even properly reset that to see if it is the issue.  Is this probably a power supply issue?
    Actually, in case this information helps... The computer went into sleep mode the other day, and would not come back.  This is a work computer that I use for our photography business, and at this point I am just trying to run it as a drive to get the photos onto our new computer, but this issue is keeping us from doing so.  Any help would be greatly appreciated!

    Try a SMC reset.
    DALE

  • Can't type in text when turn phone landscape and screen turns off

    When I turn my iphone 6 (regular not plus) sideways to type in text most of the time it won't let me type anything and sometimes the screen turns off.  If I reset back to portrait a few times sometimes it will start working and sometimes I have to reboot for it to correct.  Anyone alse having this issue?

    I am having the same issue.  It won;t let me text in landscape - but if I turn back to portrait start typing and turn back to landscape it will allow me to continue.  And I am also getting the black screen occasionally as u mentioned

  • How do i turn off talkback when the screen is locked?

    How Do I Turn Off Talkback When The Screen Is In Locked Mode? It Will Not Allow Me To Get To The Accessibility Icon.....

    Hi
    I’d be happy to help you disable talkback on your Moto E! If you have inadvertently enabled Talkback, you can quickly pause it, and then go back to disable this feature.
    Anywhere on the screen, swipe down then right in a single motion, as if you were drawing an “L”.
    Note: This should work whether the phone is on the lock screen or unlocked.
    You will then see 2 options in the top corners of the screen, select “Pause Feedback”.
    When the Suspend Talkback message appears, double tap “OK”.
    You can now normally go into Settings > Accessibility and disable talkback.
    I hope this helps!
    Charise

  • Wifi turns off when screen turns off

    Hi all.  I noticed that my wifi turns off when my screen turns off (to save energy) on my brand new rMBP.  The mac isn't asleep, just the screen as I have specified in the settings to turn off but the actual laptop is still on.  Well when I move the mouse or press a key, the screen naturally comes on right away but I noticed that wifi turns on and reconnected.  So if I was streaming music or something, it would stop and disconnect when the screen goes off.  Does this make sense?
    How do I disable this?  I don't want my wifi to turn off at all when my screen turns off.  If I'm downloading/streaming or whatever, I want my connection to remain on.  Thoughts?

    edit:
    i know there's the option "prevent computer sleeping when screen is off" under power adpter, but i would like it done while running battery.
    thank you.

  • IPod turns off when screen turns off

    When my iPod screen turns off so does the sound through the headphones.  I tried updates, different headphones, reboots.
    Any suggestions??
    I was offered  6th generation for my 1st generation recalled nano, I regret switching now as my 1st generation was still going strong.

    Hi Bricky66,
    Thanks for visiting Apple Support Communities.
    It sounds like you're experiencing some unusual behavior with your iPod nano. I'd suggest some of the troubleshooting steps in this article:
    iPod troubleshooting basics and service FAQ
    http://support.apple.com/kb/TS1382
    The headphones don't work
    ...If the issue appears to be with the iPod, try resetting it. If that doesn't work, then restore iPod with the latest iPod software using iTunes...
    Best,
    Jeremy

Maybe you are looking for