[AC-2727] GPS app freezes when restarting on Android
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2012-04-08T07:47:26.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | android |
Reporter | Sam Huang |
Assignee | Shak Hossain |
Created | 2012-04-07T00:28:53.000+0000 |
Updated | 2016-03-08T07:47:37.000+0000 |
Description
When the button is pressed on Android phone, the app will freeze upon running again with the following conditions:
- the app make use of the GPS method calls in Ti.Geolocation.* (e.g.: Ti.Geolocation.addEventListener('location', function(e))
- the app removes the location event handler upon Android Activity's "destroy" event, e.g.:
Ti.Android.currentActivity.addEventListener('destroy', function(e) {
Titanium.Geolocation.removeEventListener('location', locationCallback)...
With the above conditions, after the app is successfully launched in Android phone, pressing the button will terminate the app, causing the "destroy" event to fire. In Android's DDMS log it shows: gps_engine_status_update: called release_wakelock_cb
- now re-launch the app in Android phone, the app will freeze.
To reproduce this behaviour with Kitchen Sink, run KS on actual Android device > "Phone" tab > "Geolocation", after the GPS is active, press button twice to quit app, watch for "gps_engine_status_update" in DDMS log, run KS again.
When the app failed to run again (or hangs), the following are shown in DDMS log: ... ActivityManager Launch timeout has expired, giving up wake lock! ActivityManager Activity idle timeout for HistoryRecord{
@Sam Huang What is the Android OS this was tested on?
OS detail: Device name: Samsung Galaxy S Model number: GT-I9000 Android version: 2.3.7 Kernel Version: 2.6.35.12-gdf10700 CPU: ARMv7 rev 2(v7)
Tested on
LG Ally Android 2.2 - Not reproduceable in Android PROYO SDK (2.2) This is tied to known issues on Android GINGERBREAD SDK (2.3) http://code.google.com/p/android/issues/detail?id=20707 http://code.google.com/p/android/issues/detail?id=21376I see the same issue on my HTC Nexus One. Android 2.3.7
Also, this occurs if you use the Ti.Geolocation.PROVIDER_NETWORK as well as the Ti.Geolocation.PROVIDER_GPS providers.
@Thomas, have you tried the LocaCheck project? See if you can load this app onto your HTC Nexus One and check if it subjects to the same issue with GPS?
@Sam where can I find the LocaChek project? Also, the same issue happens when I access the Titanium Kitchen Sink: Phone -> Geolocation To reproduce: 1. Open Phone -> Geolocation 2. Tap back button until app closes 3. Open Phone -> Geolocation 4. Tap back button until app closes 5. Open Phone -> Geolocation At this point the the app won't respond at startup anymore. This also happens not only in 1.8.2 but in 2.0.1.GA2 as well.