Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-56648

Android service does not work in background when phone is not connected to usb cable

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P2: Important
    • None
    • 5.7.0
    • QPA
    • None
    • Dev machine: Linux x64, Qt 5.7.0, compiler Android GCC arm-4.9. Tested on Android 4.2 , 4.4 , 6.0
    • Android

    Description

      Hi

      Android Service does not work when phone is locked and no debug usb cable is attached to the Phone.
      I have prepared small example here:
      https://github.com/frankipl/service-test
      It has two counters. First one is from Android Service where QTimer runs with 1 second interval and increments "counter" variable and sends value back to application. Second counter simply displays seconds difference between time when "reset" was pressed and current time.
      If Android Service works it counts seconds, so the two counters should be the same.

      To replicate error:
      Install example, disconnect debug cable from phone, restart counter, lock phone, wait a minute or so, unlock phone - counters are not the same, which means Android Service wasn't counting seconds

      Something strange:
      If I add gps to the main activity, and set it for updates every 3 seconds, service works in background.
      I can't add gps to the service, because it crashes on QGeoPositionInfoSource::createDefaultSource(this);

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            taipan BogDan Vatra
            frankipl Marek FloriaƄczyk
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes