Results 1 to 5 of 5
  1. spdqbr's Avatar
    Posts
    78 Posts
    Global Posts
    80 Global Posts
       #1  
    Hey all,

    I'm putting the finishing touches on a new app I'm working on, but I've run into a problem. I'm trying to turn off the screen blank feature during a certain action, but it doesn't seem to want to stick. Here is the relevant code:
    Code:
        this.controller.serviceRequest("palm://com.palm.power/com/palm/power", {
            method: "activityStart",
            parameters: {
            id: "my.app-action1",
            duration_ms: 5*60000
            },
            onSuccess: this.reportSuccess.bind(this),
            onFailure: this.reportFailure.bind(this)
            });
    I have verified that the reportSuccess function is being called by this, but the screen still blanks after the interval set in screen & lock.

    Before anyone panics too much about battery drain, I have the necessary code in place to turn the screen blank back on at the appropriate time, but I don't know if that's working since I can't get this portion to work...

    Any suggestions are greatly appreciated.
  2. #2  
    bump ,just helping out lol
    ĦṔ-Ḷṫ-Ŧḯη
    Here is a direct link to webOS Doc for all carriers
    http://www.webos-internals.org/wiki/...octor_Versions
    P.S. if i have helped you and you are thankful please hit the thanks button to the right---->
  3. spdqbr's Avatar
    Posts
    78 Posts
    Global Posts
    80 Global Posts
       #3  
    Thanks Shadavis08, I'll give one more bump.

    Still haven't had any luck resolving this!
  4. spdqbr's Avatar
    Posts
    78 Posts
    Global Posts
    80 Global Posts
       #4  
    Success! I dug into the palm developer forums and finally found a solution.

    It seems the palm://com.palm.power/com/palm/power service prevents the device from going to sleep, but not the screen.

    With WebOS 1.3.1 they introduced a new api to keep the screen on with setWindowProperties. Here is the code that finally worked for me:
    Code:
    //disable screen blank
        this.controller.stageController.setWindowProperties(
                   {
                      blockScreenTimeout: true
                   }
                );
    
    //  Re-enable screen blank
    this.controller.stageController.setWindowProperties(
                   {
                      blockScreenTimeout: true
                   }
                );
    Since I don't have enough posts to actually post a link yet, the place I found this was on the developer.palm forums, thread titled "activityStart in Power Mgt services - does it actually work?"

    Hopefully someone else will find this information useful!
  5. #5  
    Typo error :
    "blockScreenTimeout: true" has to be "blockScreenTimeout: false" when re-enable the screen blank !!

Posting Permissions