{ "id": "172212", "key": "TIMOB-26382", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "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": null, "resolutiondate": null, "created": "2018-09-11T20:33:43.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "build", "cli", "run" ], "versions": [], "issuelinks": [], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-10-23T21:16:20.000+0000", "status": { "description": "This issue was once resolved, but the resolution was deemed incorrect. From here issues are either marked assigned or resolved.", "name": "Reopened", "id": "4", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "*Summary:*\r\nWhen doing an \"appc run\" to an Android device with the screen powered off or the screen-lock shown, the app will be ran in the background. The Android device will not automatically turn on the screen and dismiss the screen-lock. Ideally, it should.\r\n\r\n*Reason:*\r\nUI events such as \"postlayout\" will not occur in an Android app while it is running in the background. This is especially an issue for automated testing.\r\n\r\n*Recommended Solution:*\r\nGoogle recommends to invoke the \"menu\" key to dismiss the screen-lock for automated test.\r\nhttps://developer.android.com/studio/test/monkeyrunner\r\n\r\nWe can do this via the \"adb\" command line as follows. Note that we need to invoke the \"menu\" key twice. Once to power on the screen (if off) and a second time to dismiss the screen-lock.\r\n{code}\r\nadb shell input keyevent KEYCODE_MENU\r\nadb shell input keyevent KEYCODE_MENU\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Android: \"appc run\" should dismiss screen-lock before running built app", "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": 1073, "state": "closed", "name": "2018 Sprint 19 SDK", "startDate": "2018-09-09T21:02:56.422Z", "endDate": "2018-09-23T21:02:00.000Z", "completeDate": "2018-09-23T22:28:10.932Z", "originBoardId": 114 }, { "id": 1070, "state": "closed", "name": "2018 Sprint 18 SDK", "startDate": "2018-08-26T16:14:35.297Z", "endDate": "2018-09-09T16:14:00.000Z", "completeDate": "2018-09-11T20:59:21.495Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "441487", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/10318", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-09-11T21:21:03.000+0000", "updated": "2018-09-11T21:21:03.000+0000" }, { "id": "441544", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed.\r\n\r\nWaiting for CR.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-09-13T21:48:33.000+0000", "updated": "2018-09-13T21:48:33.000+0000" }, { "id": "441669", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR Merged.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-09-18T22:43:10.000+0000", "updated": "2018-09-18T22:43:10.000+0000" }, { "id": "441922", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "Just a quick note because I was a bit confused and found this ticket:\r\n\r\nWhen I compile an app now (latest 7.5.0) and my screen is not switched off it will go into \"edit home screen\" mode and back to the first home screen before starting the app (I was on the third screen). Luckly It doesn't change anything on the screens but the behaviour is different and at first very confusing. \r\n\r\nHere is a video: http://migaweb.de/ti_home_bug.mp4", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-09-23T10:57:42.000+0000", "updated": "2018-09-23T10:58:14.000+0000" }, { "id": "441989", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~michael], Yes I have confirmed it with [~jquick] & its expected due to the only way this change can be done. You will see this when app is complied & installed using studio or CLI. If launched manually after the first install you won't see this behaviour.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-09-24T16:49:44.000+0000", "updated": "2018-09-24T16:49:44.000+0000" }, { "id": "441990", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "you could check\r\n{{adb shell dumpsys power | grep 'mHolding'}}\r\nbefore. It will output:\r\n\r\n{code}\r\n mHoldingWakeLockSuspendBlocker=true // lock true/false\r\n mHoldingDisplaySuspendBlocker=true // screen on/off\r\n{code}", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-09-24T17:04:43.000+0000", "updated": "2018-09-24T17:04:43.000+0000" }, { "id": "442010", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hmm... the behavior is harmless and doesn't bother me. But if this behavior bothers [~michael] and [~lchoudhary], then it might bother others too. I don't want this to turn into a tech-support issue for us. I'll have to re-think this.\r\n\r\n_*Edit:*_\r\n_[~michael], your solution doesn't work on all devices. Have a look at the stackoverflow link below. I'd prefer to stick to public APIs to make this work, but we may be out of luck in this case._\r\nhttps://stackoverflow.com/questions/35275828/is-there-a-way-to-check-if-android-device-screen-is-locked-via-adb\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-09-24T21:10:48.000+0000", "updated": "2018-09-25T21:45:51.000+0000" }, { "id": "442012", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reopening for now.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-09-24T21:24:12.000+0000", "updated": "2018-09-24T21:24:12.000+0000" }, { "id": "442022", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~jquick] ah ok. But keep in mind that the \"menu - menu\" won't bring any benefit when your device has a pin/fingerprint lock and is switched off, since it won't unlock them (which I guess most user devices use). Perhaps we could check if it's an emulator or not. ", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-09-25T06:17:37.000+0000", "updated": "2018-09-25T06:17:37.000+0000" }, { "id": "442886", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Let's revert this change for now. I don't want this to turn into a tech-support issue.\r\n\r\nPR (master): https://github.com/appcelerator/titanium_mobile/pull/10396\r\n\r\nNote that the intention of this change was to help with automated testing systems. Perhaps an alternative solution would be to run the \"adb\" command like I was doing via build plugin instead. Something to ponder later.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-10-23T20:08:56.000+0000", "updated": "2018-10-23T20:08:56.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }