{ "id": "121608", "key": "TIMOB-15579", "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": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2014-04-14T21:23:21.000+0000", "created": "2013-10-25T01:54:31.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "triage" ], "versions": [], "issuelinks": [], "assignee": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-17T18:21:18.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": "h1. Problem\r\nAssume we have a heavyweight window, and a service with START_REDELIVER_INTENT. If the app is closed (for low memory, or any other reason), and the service is restarted by the OS, launching the app shows only a black screen.\r\n\r\nh2. What's Worse\r\nBecause heavyweight/lightweight is being antiquated, and every window will now be heavyweight, the latest master builds exhibit this problem on every window. Using older versions of the SDK (3.1.3.GA), making the window lightweight would avoid this issue, somewhat, but properties like exitOnClose don't work properly.\r\n\r\nh2. Example\r\nFollow the 4 steps in the app to reproduce this.\r\n{panel:title=app.js}{code}// Make a window.\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor: 'white'\r\n});\r\nwin.add(Ti.UI.createLabel({\r\n\ttext: 'Great! Please:' +\r\n\t\t'\\n' +\r\n\t\t'1) press the home button,\\n' +\r\n\t\t'2) force-close the app,\\n' +\r\n\t\t'3) watch the logs for the service to restart itself,\\n' +\r\n\t\t'4) then try to launch the app again (it should be black).',\r\n\tleft: 20, right: 20\r\n}));\r\nwin.open();\r\n\r\n// Start an interval service.\r\nvar intent = Ti.Android.createServiceIntent({\r\n\turl: 'service.js',\r\n\tstartMode: Ti.Android.START_REDELIVER_INTENT\r\n});\r\nintent.putExtra('interval', 1000);\r\nTi.Android.startService(intent);{code}{panel}\r\n\r\n{panel:title=service.js}{code}console.log('Hello from service.js!');{code}{panel}\r\n\r\n{panel:title=tiapp.xml}{code} \r\n \r\n \r\n \r\n \r\n {code}{panel}\r\n\r\nh2. Console\r\n{code}10-24 21:47:32.388: I/TiAPI(3555): Hello from service.js!\r\n10-24 21:47:32.450: I/TiAPI(3555): Hello from service.js!\r\n10-24 21:47:32.794: I/AndroidRuntime(3555): VM exiting with result code 1, cleanup skipped.\r\n10-24 21:47:32.841: I/WindowState(409): WIN DEATH: Window{413aa378 u0 com.dawson.plays/org.appcelerator.titanium.TiActivity}\r\n10-24 21:47:32.841: I/ActivityManager(409): Process com.dawson.plays (pid 3555) has died.\r\n10-24 21:47:32.845: W/ActivityManager(409): Scheduling restart of crashed service com.dawson.plays/.ServiceService in 12318ms\r\n10-24 21:47:32.845: I/WindowState(409): WIN DEATH: Window{40ff1ac0 u0 com.dawson.plays/com.dawson.plays.PlayActivity}\r\n10-24 21:47:32.849: D/Zygote(148): Process 3555 exited cleanly (1)\r\n10-24 21:47:34.236: D/lights(409): set_light_keyboard: color=0xff000000, klc=2.\r\n10-24 21:47:34.240: D/lights(409): set_light_buttons: color=0xff000000, tlc=0.\r\n10-24 21:47:45.240: I/ActivityManager(409): Start proc com.dawson.plays for service com.dawson.plays/.ServiceService: pid=3580 uid=10052 gids={50052, 1015, 3003, 1028}\r\n10-24 21:47:45.255: I/dalvikvm(3580): Turning on JNI app bug workarounds for target SDK version 10...\r\n10-24 21:47:45.286: I/TiApplication(3580): (main) [0,0] checkpoint, app created.\r\n10-24 21:47:45.322: I/TiApplication(3580): (main) [34,34] Titanium 3.2.0 (2013/10/24 12:09 9b2cd09)\r\n10-24 21:47:45.376: I/TiApplication(3580): (main) [57,91] Titanium Javascript runtime: v8\r\n10-24 21:47:45.380: D/dalvikvm(3580): Trying to load lib /data/app-lib/com.dawson.plays-1/libstlport_shared.so 0x40e83198\r\n10-24 21:47:45.384: D/dalvikvm(3580): Added shared lib /data/app-lib/com.dawson.plays-1/libstlport_shared.so 0x40e83198\r\n10-24 21:47:45.384: D/dalvikvm(3580): No JNI_OnLoad found in /data/app-lib/com.dawson.plays-1/libstlport_shared.so 0x40e83198, skipping init\r\n10-24 21:47:45.384: D/dalvikvm(3580): Trying to load lib /data/app-lib/com.dawson.plays-1/libkroll-v8.so 0x40e83198\r\n10-24 21:47:45.392: D/dalvikvm(3580): Added shared lib /data/app-lib/com.dawson.plays-1/libkroll-v8.so 0x40e83198\r\n10-24 21:47:45.603: W/V8Object(3580): Runtime disposed, cannot set property 'userAgent'\r\n10-24 21:47:45.685: I/TiAPI(3580): Hello from service.js!\r\n10-24 21:47:45.693: I/TiAPI(3580): Hello from service.js!\r\n10-24 21:47:46.697: I/TiAPI(3580): Hello from service.js!\r\n10-24 21:47:46.728: I/TiAPI(3580): Hello from service.js!\r\n10-24 21:47:47.700: I/TiAPI(3580): Hello from service.js!\r\n10-24 21:47:47.732: I/TiAPI(3580): Hello from service.js!\r\n10-24 21:47:47.935: D/lights(409): set_light_keyboard: color=0xff0a0a0a, klc=1.\r\n10-24 21:47:47.943: D/lights(409): set_light_buttons: color=0xff0a0a0a, tlc=1.\r\n10-24 21:47:47.978: D/dalvikvm(590): GC_CONCURRENT freed 622K, 41% free 4495K/7592K, paused 2ms+4ms, total 39ms\r\n10-24 21:47:47.978: D/dalvikvm(590): WAIT_FOR_CONCURRENT_GC blocked 33ms\r\n10-24 21:47:48.146: I/ActivityManager(409): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.dawson.plays/.PlayActivity bnds=[120,405][240,555]} from pid 590\r\n10-24 21:47:48.376: V/PhoneStatusBar(494): setLightsOn(true)\r\n10-24 21:47:48.427: I/ActivityManager(409): Displayed com.dawson.plays/org.appcelerator.titanium.TiActivity: +247ms\r\n10-24 21:47:48.712: I/TiAPI(3580): Hello from service.js!\r\n10-24 21:47:48.716: I/TiAPI(3580): Hello from service.js!\r\n10-24 21:47:49.697: I/TiAPI(3580): Hello from service.js!\r\n10-24 21:47:49.728: I/TiAPI(3580): Hello from service.js!\r\n10-24 21:47:50.697: I/TiAPI(3580): Hello from service.js!{code}", "attachment": [ { "id": "43451", "filename": "black.png", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2013-10-25T01:56:12.000+0000", "size": 8502, "mimeType": "image/png" } ], "flagged": false, "summary": "Android: START_REDELIVER_INTENT can cause black screen", "creator": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "environment": "Ti SDK 3.1.3.GA or master 9b2cd09\r\nSamsung EPIC 4G 4.2.2\r\nSamsung Galaxy S3 4.0.4", "comment": { "comments": [ { "id": "278284", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I can't reproduce this issue, even on 3.1.3.GA. I killed the app, waited for the service to restart, and the launched the app again, and I don't see a black screen. I did notice that there are two instances of the service running.\n", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-11-05T22:35:27.000+0000", "updated": "2013-11-05T22:35:27.000+0000" }, { "id": "278665", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "Did you try with the latest master? Do you have true in your tiapp.xml (you shouldn't)? Did you do a clean build?", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2013-11-07T18:40:07.000+0000", "updated": "2013-11-07T18:40:07.000+0000" }, { "id": "279065", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Just tried this on master, without the setting the useLegacyWindow flag, and a clean build. I could not reproduce the issue. Maybe there is something special in your project? Could you attach a project that shows this behavior?", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-11-12T01:42:03.000+0000", "updated": "2013-11-12T01:42:03.000+0000" }, { "id": "413544", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as the issue cannot be reproduced.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-17T18:21:18.000+0000", "updated": "2017-03-17T18:21:18.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }