phonepowermanager - increase interval between screen off and suspend

GTA02 has problem that it does not automatically suspends. This is
in the log:

PhonePowerManager::setIntervals: 1 10 10  size:  3
PhonePowerManager::setIntervals: 1000 9000 100
QtopiaPowerManager: restoring screen saver
Using Block level  1
PhonePowerManager::save() level 0 action 0 homescreen settings: "Never" false
QtopiaPowerManager: setBacklight => 1
Dimming light
PhonePowerManager::save() level 1 action 1 homescreen settings: "Never" false
QtopiaPowerManager: setBacklight => 0
turning light off
QtopiaPowerManager: restoring screen saver
QtopiaPowerManager: setBacklight => -1

Successful suspend looks like this:

QtopiaPowerManager: setBacklight => -3
PhonePowerManager::setIntervals: 1 10 10  size:  3
PhonePowerManager::setIntervals: 1000 9000 100
QtopiaPowerManager: restoring screen saver
Using Block level  1
PhonePowerManager::save() level 0 action 0 homescreen settings: "Never" false
QtopiaPowerManager: setBacklight => 1
Dimming light
PhonePowerManager::save() level 1 action 1 homescreen settings: "Never" false
QtopiaPowerManager: setBacklight => 0
turning light off
PhonePowerManager::save() level 2 action 2 homescreen settings: "Never" false
case PhonePowerManager::Suspend: m_powerConstraint 1000 m_suspendEnabled true
Suspending device
ModemSuspend(0xc0db88) checking whether canSuspend...
SystemSuspendHandler(0x637958) checking whether canSuspend...
ModemSuspend(0xc0db88) suspending...
 ...waiting for completion...

This is from my mail:

It seems i understand the problem and have a workaround that works on v58. The
problem seems to be in QtMoko power management handling. You can set intervals
for dim, screen off and suspend. There are intervals between them and it
always goes like:

dim->screen off->suspend

If you dont specify interval between screen off->suspend QtMoko automatically
places 100ms there. But this is probably not enough and suspend never happens.

The workaround: go to Settings->Power management->select "On battery" and fill
in good intevals - e.g. Dim=off, Display off=30s, Suspend=40s and it will auto
suspend ok. The trick is that Display off must be filled and must be more then
10s less then suspend.

From qwindowsystem_qws.cpp we are most likely hitting this case:

        if (screensavertime.elapsed() > *screensaverinterval*2) {
            // bogus (eg. unsuspend, system time changed)
            _q_screenSaverWake(); // try again
            return;
        }

because previous screen off took more then 100ms. The solution is to increase 100ms
to 1s which should be safe. We assume that tunring screen off wont take more then 1s.