Comment 9 for bug 1559428

Revision history for this message
costales (costales) wrote : Re: [Bug 1559428] Re: System kills uNav when it asks for geolocation

Hi!

I (think) found the problem. I would say it's an oxide issue (?)...

I can't do anything now in uNav for solving/parsing it because of this...

uNav is asking about GPS with this standard HTML5 geolocation code and the
system kills uNav (I think because uNav asks for a position and the system
trigger a timeout and kills it):

    id_gps = navigator.geolocation.watchPosition(
        function (pos) {
            console.log('Enter: ' + pos.coords.latitude);
        },
        function (error) {
            console.log('WatchPosition error: '+error.code);
        },
        {
            enableHighAccuracy:true
        }
    );

The previous code is correct. How to fix the crash? Adding a timeout:

    id_gps = navigator.geolocation.watchPosition(
        function (pos) {
            console.log('Enter: ' + pos.coords.latitude);
        },
        function (error) {
            console.log('WatchPosition error: '+error.code);
        },
        {
            enableHighAccuracy:true,
            maximumAge:Infinity,
            timeout:0
        }
    );

But this code will enter into the error procedure with a code 3 (timeout)
and the watchPosition will not be called again.
Then I'll not get a crash, but I'll not get a position ever.

What did I do then? Simplify the issue. I created a basic example (qml
embebing a html). It will show a map and center in the current position,
only that. It is crashing too (http://termbin.com/0q5d). I think the
network status or gps status could be related.

bzr branch lp:~costales/+junk/testing_unav_crash
cd testing_unav_crash

Testing:
qmlscene qml/Main.qml
Build:
click build .

How should it work?
- maximumAge and timeout has to be optional in the watchPosition.
- watchPosition should run until a watchPosition clear will be called. This
would return positions in next times.

Best regards.