Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3293] Ti Android architecture does not support background service invocation

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionCannot Reproduce
Resolution Date2012-09-05T15:49:24.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, defect, reported-1.6.0
ReporterDaniel Cameron
AssigneeNeeraj Gupta
Created2011-04-15T03:41:37.000+0000
Updated2017-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)

Comments

  1. Daniel Cameron 2011-04-15

    Assigning to hopefully the correct person.

  2. Daniel Cameron 2011-04-15

    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.

  3. Junaid Younus 2012-09-05

    No test case provided, unable to reproduce, ticket marked as invalid.
  4. Lee Morris 2017-03-27

    Closing ticket as Cannot Reproduce with reference to the above comments.

JSON Source