{ "id": "63820", "key": "TIMOB-3188", "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": [ { "id": "11258", "description": "Holding Pen for Triaged Issues", "name": "Backlog", "archived": false, "released": false } ], "resolution": { "id": "8", "description": "", "name": "Needs more info" }, "resolutiondate": "2011-04-15T03:39:03.000+0000", "created": "2011-04-15T03:39:01.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [ "android", "defect", "reported-1.6.0" ], "versions": [], "issuelinks": [], "assignee": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-03T17:16:58.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}

Symptoms:
\nTitanium.Android.currentService not set for non-interval\nservices.

\n

Repo steps:
\n1. Create new app and and myservice.js and paste code to app.js as\nper \nhttp://developer.appcelerator.com/apidoc/mobile/latest/Titanium.And...
\n2. Remove type=\"interval\" from tiapp.xml
\n3. Remove intent.putExtra('interval', 2000); from app.js
\n4. Compile and run application

\n

Output is as follows:

\n
\n[INFO] Deployed ServiceTest ... Application should be running.\n[TRACE] I/Log ( 634): (main) [0,0] checkpoint, app created.\n[TRACE] I/TiApplication( 634): (main) [1052,1052] Titanium 1.5.1 (2010/12/16 16:25 6bbb92)\n[TRACE] D/TiApplication( 634): (main) [19,1071] Application onCreate\n[TRACE] I/Log ( 634): (main) [0,0] checkpoint, on root activity create, savedInstanceState: null\n[TRACE] E/TiRootActivity( 634): (main) [2,2] Instance Count: 0\n[TRACE] D/dalvikvm( 634): GC_FOR_MALLOC freed 3723 objects / 345688 bytes in 182ms\n[TRACE] D/TiApplication( 634): (main) [539,541] Analytics Event: type=ti.start\n[TRACE] D/TiApplication( 634): event=ti.start\n[TRACE] D/TiApplication( 634): timestamp=2011-02-21T02:21:41.259+0000\n[TRACE] D/TiApplication( 634): mid=9774d56d682e549c\n[TRACE] D/TiApplication( 634): sid=ebd470c4-9680-4e45-b47a-80408a755254\n[TRACE] D/TiApplication( 634): aguid=4961f916-b816-4398-b626-a2559e72498c\n[TRACE] D/TiApplication( 634): isJSON=true\n[TRACE] D/TiApplication( 634): payload={\"os\":\"google_sdk\",\"tz\":0,\"nettype\":\"MOBILE\",\"deploytype\":\"development\",\"app_version\":\"1.0\",\"osver\":\"2.2\",\"un\":\"android-build\",\"version\":\"1.5.1\"}\n[TRACE] E/TiApplication( 634): (main) [386,927] APP PROXY: [Ti.App]\n[TRACE] E/ROOT ( 634): (main) [591,1518] Leaving TiRootActivity.onCreate\n[TRACE] I/Log ( 634): (main) [0,0] checkpoint, on root activity resume. context = org.appcelerator.titanium.TiContext@44f43c68\n[TRACE] I/TiRootActivity( 634): (Thread-10) [8,8] eval app.js\n[TRACE] D/KrollContext( 634): (kroll$1) [20,28] Running evaluated script: app://app.js\n[TRACE] W/TiAnalyticsSvc( 634): (Thread-11) [528,556] Analytics Service Started\n[TRACE] I/ActivityManager( 60): Displayed activity com.example.com/.ServicetestActivity: 6119 ms (total 6119 ms)\n[TRACE] D/dalvikvm( 634): GC_FOR_MALLOC freed 5530 objects / 357160 bytes in 116ms\n[TRACE] I/TabGroupProxy( 634): (main) [876,1432] handleOpen\n[TRACE] I/ActivityManager( 60): Starting activity: Intent { cmp=com.example.com/ti.modules.titanium.ui.TiTabActivity (has extras) }\n[TRACE] D/TiRootActivity( 634): (main) [68,1500] root activity onPause, context = org.appcelerator.titanium.TiContext@44f43c68\n[TRACE] W/TiTabActivity( 634): (main) [186,1686] Notifying TiTabGroup, activity is created\n[TRACE] D/qemud ( 38): fdhandler_accept_event: accepting on fd 10\n[TRACE] D/qemud ( 38): created client 0x1aed8 listening on fd 15\n[TRACE] D/qemud ( 38): client_fd_receive: attempting registration for service 'sensors'\n[TRACE] D/qemud ( 38): client_fd_receive: -> received channel id 14\n[TRACE] D/qemud ( 38): client_registration: registration succeeded for client 14\n[TRACE] D/qemud ( 38): fdhandler_event: disconnect on fd 15\n[INFO] [965,2651] Service code resumes, iteration null\n[TRACE] D/KrollContext( 634): (kroll$2) [47,2698] Running evaluated script: app://myservice.js\n[TRACE] I/ActivityManager( 60): Displayed activity com.example.com/ti.modules.titanium.ui.TiTabActivity: 1254 ms (total 1254 ms)\n[TRACE] E/KrollContext( 634): (kroll$2) [870,3568] ECMA Error evaluating source: TypeError: Cannot read property \"intent\" from undefined (app://myservice.js#1)\n[TRACE] E/KrollContext( 634): org.mozilla.javascript.EcmaError: TypeError: Cannot read property \"intent\" from undefined (app://myservice.js#1)\n[TRACE] E/KrollContext( 634): at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3761)\n[TRACE] E/KrollContext( 634): at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3739)\n[TRACE] E/KrollContext( 634): at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3767)\n[TRACE] E/KrollContext( 634): at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3786)\n[TRACE] E/KrollContext( 634): at org.mozilla.javascript.ScriptRuntime.undefReadError(ScriptRuntime.java:3799)\n[TRACE] E/KrollContext( 634): at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1487)\n[TRACE] E/KrollContext( 634): at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1408)\n[TRACE] E/KrollContext( 634): at script(app://myservice.js:1)\n[TRACE] E/KrollContext( 634): at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854)\n[TRACE] E/KrollContext( 634): at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)\n[TRACE] E/KrollContext( 634): at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)\n[TRACE] E/KrollContext( 634): at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3161)\n[TRACE] E/KrollContext( 634): at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:175)\n[TRACE] E/KrollContext( 634): at org.mozilla.javascript.Context.evaluateReader(Context.java:1142)\n[TRACE] E/KrollContext( 634): at org.appcelerator.titanium.kroll.KrollContext.evaluateScript(KrollContext.java:195)\n[TRACE] E/KrollContext( 634): at org.appcelerator.titanium.kroll.KrollContext.handleEvalFile(KrollContext.java:220)\n[TRACE] E/KrollContext( 634): at org.appcelerator.titanium.kroll.KrollContext.handleMessage(KrollContext.java:115)\n[TRACE] E/KrollContext( 634): at android.os.Handler.dispatchMessage(Handler.java:95)\n[TRACE] E/KrollContext( 634): at android.os.Looper.loop(Looper.java:123)\n[TRACE] E/KrollContext( 634): at org.appcelerator.titanium.kroll.KrollHandlerThread.run(KrollHandlerThread.java:73)\n[TRACE] W/TiContext( 634): (kroll$2) [35,3603] Wanted to display an alert dialog in Javascript, but context is for a running service and therefore no attempt will be made to display a dialog in the user interface. Details: Runtime Error / TypeError: Cannot read property \"intent\" from undefined (app://myservice.js#1) / app://myservice.js / 1 / null\n[INFO] [11,3614] Service code pauses, iteration null\n
{html}", "attachment": [ { "id": "18274", "filename": "ticket3188.zip", "author": { "name": "danielcameron", "key": "danielcameron", "displayName": "Daniel Cameron", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:39:02.000+0000", "size": 4214502, "mimeType": "application/zip" } ], "flagged": false, "summary": "Titanium.Android.currentService undefined for standard services", "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": "130245", "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:39:03.000+0000", "updated": "2011-04-15T03:39:03.000+0000" }, { "id": "130246", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Please provide a complete test app.

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

Complete test app attached.

{html}", "updateAuthor": { "name": "danielcameron", "key": "danielcameron", "displayName": "Daniel Cameron", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:39:04.000+0000", "updated": "2011-04-15T03:39:04.000+0000" }, { "id": "408863", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket due to time passed and irrelevance of ticket.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-03T17:16:58.000+0000", "updated": "2017-03-03T17:16:58.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }