[TIMOB-3293] Ti Android architecture does not support background service invocation
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2012-09-05T15:49:24.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android |
Labels | android, defect, reported-1.6.0 |
Reporter | Daniel Cameron |
Assignee | Neeraj Gupta |
Created | 2011-04-15T03:41:37.000+0000 |
Updated | 2017-03-27T18:26:47.000+0000 |
Description
Version: Titanium 1.6.0
The titanium mobile codebase assumes that a root activity always exists. This assumption is not true in all scenarios (such as when a service is started from native code) and causes titanium to crash.
For example:
TitaniumModule.require() crashes on TiContext ctx =
invocation.getTiContext().getRootActivity().getTiContext().
Background javascript services are thus unable use native android
modules (a significant issue since this is the only supported way
to extend Titanium functionality)
Assigning to hopefully the correct person.
Reproduction steps (see https://appcelerator.lighthouseapp.com/projects/32238/tickets/3292-js-service-does-not-start-when-called-from-android-background-service"> https://appcelerator.lighthouseapp.com/projects/32238/tickets/3292-... attachment for full source):
Start "Ticket3292 invoker" app
Kill "Ticket3292" app
Select the "Notification from another app"
-> service crashes executing requires(). (the app does not crash when executing the same requires() from app.js)
Note: the ticket title is misleading as it's just the assumption that getRootActivity() will actually return something that is false but the issue tracking system won't let me update the title to a more apt one.
My initial ticket had another error (app.js crashing after a background service was started) but as I have been unable to reproduce in test apps I submitted I've edited the ticket to drop that component as I can't be sure it's a problem with Titanium and not my module.
No test case provided, unable to reproduce, ticket marked as invalid.
Closing ticket as Cannot Reproduce with reference to the above comments.