cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kaupo Kuresson (JIRA)" <>
Subject [jira] [Created] (CB-6480) Resume event is sometimes not fired when system time is changed
Date Mon, 21 Apr 2014 15:06:14 GMT
Kaupo Kuresson created CB-6480:

             Summary: Resume event is sometimes not fired when system time is changed
                 Key: CB-6480
             Project: Apache Cordova
          Issue Type: Bug
          Components: Android
    Affects Versions: 3.4.0, 2.4.0
         Environment: Android 4.1.2. Both real device (LG-P710) and emulator.
            Reporter: Kaupo Kuresson

I managed to reproduce the bug in a simple 'HelloWorld' app:
1. cordova create hello com.example.hello HelloWorld
2. cordova platform add android
3. add listeners to "pause" and "resume" events:
var app = {
    // Application Constructor
    initialize: function() {
    // Bind Event Listeners
    // Bind any events that are required on startup. Common events are:
    // 'load', 'deviceready', 'offline', and 'online'.
    bindEvents: function() {
        document.addEventListener('pause', this.onPause, false);
        document.addEventListener('resume', this.onResume, false);
    onPause: function() {
    onResume: function() {

Steps to reproduce the bug:
1. Launch the app
2. Go to "Date & time" settings. (Pause event works fine, prints "PAUSED")
3. Set system time to be some minutes in the past manually.
4. Resume app. (Resume event works fine, prints "RESUMED")
5. Go to "Date & time" settings again. (Pause event works fine, prints "PAUSED")
6. Check "Automatic date & time", so time is corrected.
7. Resume app. (Resume event is NOT fired at first. It is fired later, once the amount of
minutes that you changed the time to the past has passed.)

Expected result would be that the resume event is fired immediately in the second case as

This message was sent by Atlassian JIRA

View raw message