New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 736968 link

Starred by 5 users

Issue metadata

Status: Verified
Owner:
Closed: Jul 24
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

Screen never turns off with "Allow app to manage power" admin console setting

Project Member Reported by derat@chromium.org, Jun 27 2017

Issue description

I believe there's an "Allow app to manage power" setting in the admin console that configures kiosk devices to have a very short screen-off delay while never suspending. The intent is that kiosk app authors enable this setting and then use the chrome.power API within their apps to force the screen on when the want it to be on. When they release the request, the screen should turn off shortly afterward. This sort of gives them control of display power. See  issue 627672  for a bit more.

Per email discussion, this isn't working, though -- the screen never turns off. Here are some powerd logs showing the settings that are being sent by Chrome:

[0530/170601:INFO:daemon.cc(1412)] Received updated external policy: ac_dim=0s ac_screen_off=10s ac_lock=0s ac_idle_warn=0s ac_idle=0s battery_dim=0s battery_screen_off=10s battery_lock=0s battery_idle_warn=0s battery_idle=0s ac_idle=no-op battery_idle=no-op lid_closed=suspend use_audio=0 use_video=0 presentation_factor=1.0 user_activity_factor=1.0 wait_for_initial_user_activity=0 force_nonzero_brightness_for_user_activity=1 (Prefs)
[0530/170601:INFO:state_controller.cc(777)] Updated settings: dim=0s screen_off=0s lock=0s idle_warn=0s idle=0s (no-op) lid_closed=suspend use_audio=0 use_video=0
[0530/170601:INFO:daemon.cc(1412)] Received updated external policy: ac_dim=0s ac_screen_off=10s ac_lock=0s ac_idle_warn=0s ac_idle=0s battery_dim=0s battery_screen_off=10s battery_lock=0s battery_idle_warn=0s battery_idle=0s ac_idle=no-op battery_idle=no-op lid_closed=suspend use_audio=0 use_video=0 presentation_factor=1.0 user_activity_factor=1.0 wait_for_initial_user_activity=0 force_nonzero_brightness_for_user_activity=1 (Prefs, extension)
[0530/170601:INFO:state_controller.cc(777)] Updated settings: dim=0s screen_off=0s lock=0s idle_warn=0s idle=0s (no-op) lid_closed=suspend use_audio=0 use_video=0

I think that the problem lies in the 0-second ac_idle and battery_idle delays. The idle delay is supposed to be longer than the screen-off delay, so when powerd sees 0 for the former, it also drops the latter to 0, which means that we keep the screen on forever.

The right way to prevent the system from suspending while idle is by setting the ac_idle and battery_idle actions to "do nothing" (a.k.a. "no-op"), which is also being done here.

To fix this, I think that the policy set by the admin console just needs to be updated to leave ac_idle and battery_idle alone instead of setting them to 0. The screen delays should then be honored, and the "do nothing" actions will still prevent the system from suspending.

There are some unanswered questions about how this ever worked in initial testing of the feature, too.
 
Cc: binzhao@chromium.org
Components: UI>Shell>Kiosk
Owner: krishna...@chromium.org
Assigning it to Krishna to update this bug with his findings.
Labels: -M-51 M-61
Krishna, any update on this?

Comment 4 Deleted

Comment 5 by dimi...@meldcx.com, May 29 2018

Hi Chromium Team,

I'm hoping to see if there has been any update on this ticket. I have currently written a small native kiosk app, its sole job is to sleep the display. I have done so using the following code

const sleepBtn = document.getElementById('sleepBtn');
const stateDiv = document.getElementById('state');


chrome.power.requestKeepAwake('display');
stateDiv.innerHTML = "KEEP AWAKE STATE:<br><br>requestKeepAwake('display')";
sleepBtn.addEventListener('click', () => {

    chrome.power.releaseKeepAwake();
    stateDiv.innerHTML = "KEEP AWAKE STATE:<br><br>releaseKeepAwake()"
    chrome.power.requestKeepAwake('system');
    stateDiv.innerHTML = "KEEP AWAKE STATE:<br><br>requestKeepAwake('system')"
});


Unfortunately this has not worked on Chrome OS 59, 61, 62, 64 and 65. I'm wondering if this an issue with how I have done things. Or whether the issue is still being looked into by Krishna?

Thanks,

Dimitri
Cc: -bartfab@chromium.org -krishna...@chromium.org -vidster@chromium.org -binzhao@chromium.org derat@chromium.org
Labels: -Pri-1 -M-61 Pri-2
Owner: bartfab@chromium.org
Krishna has since moved teams, so this bug is orphaned :(. However, his analysis from the original report seems spot-on. Our documentation of the power management timeouts says:

"For each of above actions, the delay should be specified in milliseconds, and needs to be set to a value greater than zero to trigger the corresponding action. In case the delay is set to zero, Google Chrome OS will not take the corresponding action."

I filed internal bug b/80402143 to figure out what policy exactly we are setting. If it really is all zeros, that will not work.
Cc: bartfab@chromium.org
Owner: poromov@chromium.org
Over to Sergey as this is a kiosk bug.

Comment 8 by dimi...@meldcx.com, Jun 13 2018

Hi Team,

Just wondering the status of this ticket and if there are any updates?

Thanks,

Dimitri

Comment 9 by derat@chromium.org, Jun 13 2018

Sergey, can you comment here?
It's under investigation on server side and is tracked in internal bug b/80402143
I asked for updates there.

The policy on server side will be updated to have "Idle" >= "ScreenOff" in this case.

However, the behavior of Chrome OS power management is a little bit strange here.
AFAIU, 0 values for any of these settings means that it will never happen, i.e.more like "infinity" timeout.

But when "ScreenOff" > 0 is clamped to "Idle" = 0 = never, it means that "ScreenOff" is "increased" to infinity instead of reducing to "Idle" value.
In other words, "ScreenOff" > 0 is actually already "less" then "Idle" = 0.
BTW, the same for "ScreenDim" - "ScreenOff" and "IdleWarning" - "Idle" pairs.

Daniel, do you think the delays sanitation should be changed for this case?

Comment 12 by derat@chromium.org, Jun 15 2018

Thanks!

Re changing display sanitization, no, I don't think so. Idle is a special case -- the right way to disable it is to set its action to "do nothing" rather than to set its delay to 0. IIRC, this was a conscious decision so there would only be a single way to disable the idle action. powerd doesn't expect to receive 0 idle delays.

Comment 13 by dimi...@meldcx.com, Jun 26 2018

Hi Team,

Just checking up on the progress regarding this issue. Is there any ETA for this bugs resolution ?

Thanks,

Dimitri
Hi Guys,

Is there any update on this issue ?

Thanks 
Cc: atwilson@chromium.org kprimke@chromium.org
#14: Someone else will hopefully correct me if I'm wrong, but from looking at the internal bug, it appears that a fix was submitted on June 15 and verified to work soon after. I'm not sure about the rollout schedule for the change. Kamila, can you comment about this?
Cc: -harpreet@chromium.org kathrelk...@chromium.org
Status: Fixed (was: Assigned)
It should've been fixed on server side a couple of weeks ago.
Hey guys,

Great you guys got it working. Do you know what version release this fix is scheduled for ? 

Thanks,

Dimitri
It's fixed for all releases, as it was a server side fix.
verified fixed using M69 dev
Status: Verified (was: Fixed)

Sign in to add a comment