We have moved to a new Sailfish OS Forum. Please start new discussions there.
1

Screen on time

asked 2018-10-28 16:50:52 +0300

utkarsh gravatar image

updated 2018-10-31 11:32:36 +0300

jiit gravatar image

Is there any way to know the screen on time of the phone? I tried screen usage monitor from storeman but it isn't working. Im using Intex Aqua Fish.

edit retag flag offensive close delete

Comments

3

Oh man. I had to read your question ten times to understand that you are talking about "screen on" time, and not about having your screen "on time" :-)

dirksche ( 2018-10-28 20:17:52 +0300 )edit

@dirksche Hahaha, I'm not really sure how else to say it, though. :D

utkarsh ( 2018-10-28 21:18:24 +0300 )edit

1 Answer

Sort by » oldest newest most voted
7

answered 2018-10-28 21:26:40 +0300

spiiroin gravatar image

updated 2018-10-28 22:59:14 +0300

You can query display state statistics from mce service.

Either with mcetool

mcetool --get-display-stats=human

or directly from D-Bus with equivalent of:

dbus-send --system --type=method_call --print-reply --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.get_display_stats

EDIT:

The output has three values: display state name, total time spent in that state, and number of times the state has been entered.

The sum of time values should be equal to uptime. Time before currently running mce process was started ends up calculated in "UNDEF". Normally mce starts early in bootup and keeps running until the device shuts down, so the undefined time should be fairly small and static. POWER_UP and POWER_DOWN are transient states which occur when the display is physcally being powered up / down. Normally POWER_UP is followed by ON state, and POWER_DOWN is followed by OFF state. But if "lpm" mode is enabled, the display can be physucally powered up for displaying lpm screen while it logically (from application program point of view) is not actually ON.

The entry-to-state-count numbers go something like:

  • Pressing power key when display is off: OFF -> POWER_UP -> ON. The counts for POWER_UP and ON should increase by one.
  • Pressing power key when display is on: ON -> POWER_DOWN -> OFF. The counts for POWER_DOWN and OFF shoud increase by one.
  • Display is on, gets dimmed by auto blanker, and woken up due to user activity: ON -> DIM -> ON. DIM and ON increase by one.
  • Display is off, LPM enabled, device is taken out of pocket (to check time) and then put back into pocket: OFF -> POWER_UP -> LPM_ON -> POWER_DOWN -> LPM_OFF -> OFF. Like above, each state transition increases the target state count by one.
edit flag offensive delete publish link more

Comments

Using mcetools, is the time in ON column from the last full charge or last charge? Also what do other things in that output mean?

utkarsh ( 2018-10-28 21:44:58 +0300 )edit
Login/Signup to Answer

Question tools

Follow
3 followers

Stats

Asked: 2018-10-28 16:50:52 +0300

Seen: 402 times

Last updated: Oct 28 '18