{ "id": "83632", "key": "TIMOB-6589", "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": "12090", "description": "", "name": "Sprint 2011-50", "archived": true, "released": true, "releaseDate": "2011-12-19" } ], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2011-12-13T13:07:16.000+0000", "created": "2011-12-12T16:54:58.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "branch-v8" ], "versions": [ { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" } ], "issuelinks": [], "assignee": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "updated": "2017-03-22T17:48:39.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": "Specifying \"@Kroll.setProperty(runOnUiThread = true)\" has no effect on the thread that the method is executed. This is exhibited in the StyledLabel and Gigya modules. The StyledLabel module sets a property during an event notification from a button click. When the property is updated it makes a call to refresh the display of the label. Since the execution thread is different than the thread that created the view a CalledFromWrongThreadExeption is thrown. The label, in this case, was created on the main thread but the property update and subsequent attempt to update the view is running on the Kroll runtime thread.\r\n\r\n{code}\r\n12-12 16:38:39.466: ERROR/RhinoObject(544): (KrollRuntimeThread) [119,93332] Only the original thread that created a view hierarchy can touch its views.\r\n12-12 16:38:39.466: ERROR/RhinoObject(544): android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.\r\n{code}\r\n\r\nTo duplicate this issue, \r\n1. Build the StyedLabel module from the apilevel2 branch of my module fork. \r\n2. Run the example application from the module. The styled label will display correctly.\r\n3. Click on the \"Only allow links\" button -- this will force an update of the property that attempts to update the styled label view\r\n", "attachment": [], "flagged": false, "summary": "Android: Modules: runOnUiThread needs to be supported", "creator": { "name": "jenglish", "key": "jenglish", "displayName": "Jeff English", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "jenglish", "key": "jenglish", "displayName": "Jeff English", "active": true, "timeZone": "America/Chicago" }, "environment": "SDK: 1.8.0.1.v20111212124623\r\nRuntimes: Android V8\r\nOS: OS X Snow Leopard\r\n\r\nUsing the \"apilevel2\" branch of the module source located in my fork of the modules repository", "comment": { "comments": [ { "id": "175861", "author": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "body": "We need to support runOnUiThread for the following annotations:\r\n\r\n* {{@Kroll.method}}\r\n* {{@Kroll.getProperty}}\r\n* {{@Kroll.setProperty}}\r\n\r\nFWIW, The original behavior was also blocking.", "updateAuthor": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-12T17:21:01.000+0000", "updated": "2011-12-12T17:21:01.000+0000" }, { "id": "175972", "author": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "body": "Discussed with Marshall Culpepper and Jeff English. Decided that runOnUIThread will not be added back in and instead we will require async and sync thread behavior to use the handler.callback mechanism shown in platform already. \r\n\r\nJeff English will provide documentation and guide regarding the shift.", "updateAuthor": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "created": "2011-12-13T13:07:16.000+0000", "updated": "2011-12-13T13:07:16.000+0000" }, { "id": "414806", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as the issue will not fix and with reference to the above comments. ", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-22T17:48:39.000+0000", "updated": "2017-03-22T17:48:39.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }