{ "id": "63924", "key": "TIMOB-3292", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2017-06-06T18:29:11.000+0000", "created": "2011-04-15T03:41:31.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "android", "defect", "reported-1.6.0" ], "versions": [], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-06-06T18:29:11.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "{html}

Titanium Mobile Version: 1.6.0

\n

Reproduction steps:
\n* Create module that includes a service that runs when the\napplication has been closed (eg titanium-c2dm) * Add the following\nthe the service module:

\n
\nTiJSIntervalService service = new TiJSIntervalService(\"c2dmHandler.js\");\nIntent serviceIntent = new Intent(Intent.ACTION_SEND, Uri.parse(\"app://c2dmHandler.js\"));\nserviceIntent.putExtra(\"interval\", 2000); // work-around for \nservice.onStart(serviceIntent, 1);\n
\n

The following stack track is dumped:

\n
\n[TRACE] E/TiUncaughtHandler( 384): (IntentService[C2DMBaseReceiver]) [10,1896] Sending event: exception on thread: IntentService[C2DMBaseReceiver] msg:java.lang.NullPointerException; Titanium 1.6.0,2011/02/23 18:08,882e81\n[TRACE] E/TiUncaughtHandler( 384): java.lang.NullPointerException\n[TRACE] E/TiUncaughtHandler( 384): at org.appcelerator.titanium.TiBaseService.createTiContext(TiBaseService.java:126)\n[TRACE] E/TiUncaughtHandler( 384): at ti.modules.titanium.android.TiJSService.createProxy(TiJSService.java:92)\n[TRACE] E/TiUncaughtHandler( 384): at ti.modules.titanium.android.TiJSService.onStart(TiJSService.java:48)\n[TRACE] E/TiUncaughtHandler( 384): at com.example.mobile.C2DMReceiver.jsHandleMessage(C2DMReceiver.java:92)\n[TRACE] E/TiUncaughtHandler( 384): at com.example.mobile.C2DMReceiver.onMessage(C2DMReceiver.java:67)\n[TRACE] E/TiUncaughtHandler( 384): at com.google.android.c2dm.C2DMBaseReceiver.onHandleIntent(C2DMBaseReceiver.java:101)\n[TRACE] E/TiUncaughtHandler( 384): at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:59)\n[TRACE] E/TiUncaughtHandler( 384): at android.os.Handler.dispatchMessage(Handler.java:99)\n[TRACE] E/TiUncaughtHandler( 384): at android.os.Looper.loop(Looper.java:123)\n[TRACE] E/TiUncaughtHandler( 384): at android.os.HandlerThread.run(HandlerThread.java:60)\n[TRACE] E/AndroidRuntime( 384): FATAL EXCEPTION: IntentService[C2DMBaseReceiver]\n[TRACE] E/AndroidRuntime( 384): java.lang.NullPointerException\n[TRACE] E/AndroidRuntime( 384): at org.appcelerator.titanium.TiBaseService.createTiContext(TiBaseService.java:126)\n[TRACE] E/AndroidRuntime( 384): at ti.modules.titanium.android.TiJSService.createProxy(TiJSService.java:92)\n[TRACE] E/AndroidRuntime( 384): at ti.modules.titanium.android.TiJSService.onStart(TiJSService.java:48)\n[TRACE] E/AndroidRuntime( 384): at com.example.mobile.C2DMReceiver.jsHandleMessage(C2DMReceiver.java:92)\n[TRACE] E/AndroidRuntime( 384): at com.example.mobile.C2DMReceiver.onMessage(C2DMReceiver.java:67)\n[TRACE] E/AndroidRuntime( 384): at com.google.android.c2dm.C2DMBaseReceiver.onHandleIntent(C2DMBaseReceiver.java:101)\n[TRACE] E/AndroidRuntime( 384): at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:59)\n[TRACE] E/AndroidRuntime( 384): at android.os.Handler.dispatchMessage(Handler.java:99)\n[TRACE] E/AndroidRuntime( 384): at android.os.Looper.loop(Looper.java:123)\n[TRACE] E/AndroidRuntime( 384): at android.os.HandlerThread.run(HandlerThread.java:60)\n
{html}", "attachment": [ { "id": "18297", "filename": "servicenotification.zip", "author": { "name": "danielcameron", "key": "danielcameron", "displayName": "Daniel Cameron", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:41:34.000+0000", "size": 10394531, "mimeType": "application/zip" } ], "flagged": false, "summary": "JS service does not start when called from Android background service", "creator": { "name": "danielcameron", "key": "danielcameron", "displayName": "Daniel Cameron", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "danielcameron", "key": "danielcameron", "displayName": "Daniel Cameron", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "130491", "author": { "name": "danielcameron", "key": "danielcameron", "displayName": "Daniel Cameron", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Workaround: fire the intent directly instead of creating a\nTiService

\n
\nString serviceClass = \"com.hyro.mobile.C2dmBackgroundService\";\nIntent serviceIntent = new Intent(Intent.ACTION_SEND, Uri.parse(\"app://c2dmBackground.js\"));\nserviceIntent.putExtra(\"interval\", 2000); // .currentService undefined for non-interval services\nserviceIntent.setClassName(context, serviceClass);\ncontext.startService(serviceIntent);\n
{html}", "updateAuthor": { "name": "danielcameron", "key": "danielcameron", "displayName": "Daniel Cameron", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:41:35.000+0000", "updated": "2011-04-15T03:41:35.000+0000" }, { "id": "130492", "author": { "name": "danielcameron", "key": "danielcameron", "displayName": "Daniel Cameron", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Assigning to hopefully the correct person.

{html}", "updateAuthor": { "name": "danielcameron", "key": "danielcameron", "displayName": "Daniel Cameron", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:41:36.000+0000", "updated": "2011-04-15T03:41:36.000+0000" }, { "id": "130493", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Daniel it would be helpful if you could attach a complete\nexample to speed up the reproduction and possible fix.

{html}", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:41:36.000+0000", "updated": "2011-04-15T03:41:36.000+0000" }, { "id": "130494", "author": { "name": "danielcameron", "key": "danielcameron", "displayName": "Daniel Cameron", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Full source for reproduction against 1.6.1 attached.

\n

Reproduction steps:

\n

Start \"Ticket3292\" app
\nStart \"Ticket3292 invoker\" app
\nSelect the \"Notification to native service invoking js\"\nnotification

{html}", "updateAuthor": { "name": "danielcameron", "key": "danielcameron", "displayName": "Daniel Cameron", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:41:36.000+0000", "updated": "2011-04-15T03:41:36.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }