{ "id": "172887", "key": "TIMOB-26746", "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": "20432", "name": "Release 8.0.1", "archived": false, "released": true, "releaseDate": "2019-05-15" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2019-03-26T11:03:17.000+0000", "created": "2019-01-18T04:08:24.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "app", "engSchedule", "event", "parity", "pause", "resume" ], "versions": [ { "id": "20238", "description": "", "name": "Release 7.5.0", "archived": false, "released": true, "releaseDate": "2018-11-15" } ], "issuelinks": [ { "id": "57125", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "172380", "key": "TIMOB-26424", "fields": { "summary": "Android: Added Ti.App \"pause\" and \"resume\" lifecycle events", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2019-03-26T11:03:17.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": "*Summary:*\r\n{{Ti.App}} events \"pause\" and \"paused\" must only be fired when the app is put into the background. Events \"resume\" and \"resumed\" are to be fired when the app is returned to the foreground (include cold app startup).\r\n\r\nAndroid correctly does the above when put into the background and foreground.\r\n\r\nHowever, Android will also fire a \"pause\" and \"resume\" event when opening or closing a child window. This does not follow iOS' behavior and is a parity issue.\r\n\r\n*Note:*\r\nTo be fair, the current pause/resume event behavior is how it natively works with Android's individual activities. However, app developers need these events to disable sensors when backgrounded and re-enable them when put back into the foreground, which is currently difficult to do in Titanium for the moment.\r\n\r\n*Steps to reproduce:*\r\n# Build and run the below code on Android.\r\n# Tap the \"Open Child\" button.\r\n# Observe the log.\r\n# Notice that pause and resume events were logged. _(This is the bug.)_\r\n\r\n{code:javascript}\r\nfunction appEventHandler(e) {\r\n\tTi.API.info(\"@@@ '\" + e.type + \"' event received.\");\r\n\tif ((Ti.Platform.name === \"android\") || (Ti.Platform.name === \"windows\")) {\r\n\t\tTi.UI.createNotification({\r\n\t\t\tmessage: e.type,\r\n\t\t\tduration: Ti.UI.NOTIFICATION_DURATION_SHORT,\r\n\t\t}).show();\r\n\t}\r\n}\r\n\r\nTi.App.addEventListener(\"resume\", appEventHandler);\r\nTi.App.addEventListener(\"resumed\", appEventHandler);\r\nTi.App.addEventListener(\"pause\", appEventHandler);\r\nTi.App.addEventListener(\"paused\", appEventHandler);\r\nTi.App.addEventListener(\"close\", appEventHandler);\r\n\r\nvar rootWindow = Ti.UI.createWindow({ title: \"Parent Window\" });\r\nvar openButton = Ti.UI.createButton({ title: \"Open Child\" });\r\nopenButton.addEventListener(\"click\", function() {\r\n\tvar childWindow = Ti.UI.createWindow({ title: \"Child Window\" });\r\n\tvar closeButton = Ti.UI.createButton({ title: \"Close Child\" });\r\n\tcloseButton.addEventListener(\"click\", function() {\r\n\t\tchildWindow.close();\r\n\t});\r\n\tchildWindow.add(closeButton);\r\n\tchildWindow.open();\r\n});\r\nrootWindow.add(openButton);\r\nrootWindow.open();\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Android: Ti.App wrongly fires pause/resume event when opening/closing child windows", "creator": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "closedSprints": [ { "id": 1123, "state": "closed", "name": "2019 Sprint 7", "startDate": "2019-03-18T17:27:25.993Z", "endDate": "2019-03-30T17:27:00.000Z", "completeDate": "2019-03-29T18:02:37.441Z", "originBoardId": 114 }, { "id": 1108, "state": "closed", "name": "2019 Sprint 2", "startDate": "2019-01-14T17:20:19.067Z", "endDate": "2019-01-26T17:20:00.000Z", "completeDate": "2019-01-28T17:38:11.580Z", "originBoardId": 114 }, { "id": 1109, "state": "closed", "name": "2019 Sprint 3", "startDate": "2019-01-28T17:38:43.075Z", "endDate": "2019-02-09T17:38:00.000Z", "completeDate": "2019-02-08T21:37:29.498Z", "originBoardId": 114 }, { "id": 1112, "state": "closed", "name": "2019 Sprint 4", "startDate": "2019-02-11T16:16:38.316Z", "endDate": "2019-02-23T16:16:00.000Z", "completeDate": "2019-02-24T18:35:43.422Z", "originBoardId": 114 }, { "id": 1118, "state": "closed", "name": "2019 Sprint 5", "startDate": "2019-02-24T18:36:06.435Z", "endDate": "2019-03-08T18:36:00.000Z", "completeDate": "2019-03-07T22:19:47.057Z", "originBoardId": 114 }, { "id": 1119, "state": "closed", "name": "2019 Sprint 6", "startDate": "2019-03-03T22:20:00.193Z", "endDate": "2019-03-15T22:20:00.000Z", "completeDate": "2019-03-18T17:26:43.120Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "445461", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/10634", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-01-18T04:46:40.000+0000", "updated": "2019-01-18T04:46:40.000+0000" }, { "id": "445756", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (8.0.x): https://github.com/appcelerator/titanium_mobile/pull/10658", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-01-30T01:43:23.000+0000", "updated": "2019-01-30T01:43:23.000+0000" }, { "id": "447035", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed. Waiting on Jenkins build. ", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-03-20T23:52:25.000+0000", "updated": "2019-03-20T23:52:25.000+0000" }, { "id": "447124", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "merged to master, 8_0_X", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2019-03-25T16:03:25.000+0000", "updated": "2019-03-25T16:03:25.000+0000" }, { "id": "447153", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "*Closing ticket.* Fix verified in SDK version {{8.0.1.v20190325125116}} and SDK Version {{8.1.0.v20190325115012}}.\r\n\r\nTest and other information can be found at: \r\nPR (master): https://github.com/appcelerator/titanium_mobile/pull/10634\r\nPR (8.0.x): https://github.com/appcelerator/titanium_mobile/pull/10658", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-03-26T11:02:49.000+0000", "updated": "2019-03-26T11:03:05.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }