{ "id": "167291", "key": "TIMOB-24629", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": "18414", "description": "", "name": "Release 6.2.0", "archived": false, "released": true, "releaseDate": "2017-09-13" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-08-28T18:34:14.000+0000", "created": "2017-04-25T18:46:19.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "android", "notification" ], "versions": [], "issuelinks": [ { "id": "56777", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "171997", "key": "TIMOB-26253", "fields": { "summary": "Android: NotificationManager.notify() will crash while screen is off and if app is missing WAKE_LOCK permission", "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": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "56776", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "108930", "key": "TIMOB-12509", "fields": { "summary": "TiAPI: Power management - Keep Screen On", "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": "Low", "id": "4" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-09-07T01:29:24.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": "Add the possibility to add a wakeLock to {{Titanium.Android.Notification}} to switch on the screen when a Notification is fired\r\n\r\n\r\n*Example:*\r\n{code:javascript}\r\nvar win = Ti.UI.createWindow({});\r\nvar btn = Ti.UI.createButton({\r\n\ttitle: \"click\"\r\n});\r\nwin.add(btn);\r\n\r\nbtn.addEventListener(\"click\", function() {\r\n\t_.delay(function() {\r\n\t\tvar intent = Ti.Android.createIntent({\r\n\t\t\taction: Ti.Android.ACTION_MAIN,\r\n\t\t\tclassName: 'com.appcelerator.notificationsample.NotificationsampleActivity',\r\n\t\t\tpackageName: 'com.appcelerator.notificationsample'\r\n\t\t});\r\n\t\tintent.flags |= Ti.Android.FLAG_ACTIVITY_CLEAR_TOP | Ti.Android.FLAG_ACTIVITY_NEW_TASK;\r\n\t\tintent.addCategory(Ti.Android.CATEGORY_LAUNCHER);\r\n\r\n\t\tvar pending = Titanium.Android.createPendingIntent({\r\n\t\t\tintent: intent,\r\n\t\t\tflags: Titanium.Android.FLAG_UPDATE_CURRENT\r\n\t\t});\r\n\r\n\t\tvar notification = Titanium.Android.createNotification({\r\n\t\t\tcontentTitle: 'Something Happened',\r\n\t\t\tcontentText: 'Click to return to the application.',\r\n\t\t\tcontentIntent: pending,\r\n\t\t\twakeLock: 100\r\n\t\t});\r\n\t\tTitanium.Android.NotificationManager.notify(1, notification);\r\n\t}, 4000);\r\n});\r\n\r\nwin.open();\r\n{code}\r\n\r\nAdd permission to tiapp.xml\r\n\r\n{noformat}\r\n\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\r\n{noformat}\r\n\r\n\r\n* start the app\r\n* click the button and lock the device\r\n* notification will appear and screen turns on\r\n\r\nIt will stay on the {{wakeLock}} time (+normal screen on time)", "attachment": [], "flagged": false, "summary": "Android: Add wakeLock to NotificationManager", "creator": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "closedSprints": [ { "id": 939, "state": "closed", "name": "2017 Sprint 17 SDK", "startDate": "2017-08-13T23:08:29.095Z", "endDate": "2017-08-27T23:08:00.000Z", "completeDate": "2017-08-27T21:10:54.125Z", "originBoardId": 114 }, { "id": 944, "state": "closed", "name": "2017 Sprint 18 SDK", "startDate": "2017-08-27T21:13:39.311Z", "endDate": "2017-09-10T21:13:00.000Z", "completeDate": "2017-09-10T21:24:16.435Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "418038", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/8990", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-04-25T18:49:01.000+0000", "updated": "2017-04-25T18:49:01.000+0000" }, { "id": "418050", "author": { "name": "titanium@webmasterei-hamburg.de", "key": "titanium@webmasterei-hamburg.de", "displayName": "Rainer Schleevoigt", "active": true, "timeZone": "Europe/Berlin" }, "body": "https://developer.android.com/reference/android/os/PowerManager.html#newWakeLock(int,%20java.lang.String)\r\n\r\nThere is more then one paramter (time). I think wee need more then one options => KrollDict", "updateAuthor": { "name": "titanium@webmasterei-hamburg.de", "key": "titanium@webmasterei-hamburg.de", "displayName": "Rainer Schleevoigt", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-04-25T21:12:09.000+0000", "updated": "2017-04-25T21:12:09.000+0000" }, { "id": "418079", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "I'll have a look at the parameters. In most cases the default parameter is enough because you would just need to turn the screen on (which is better than the current solution not to do it :-) ).\r\nBut it might be useful to have the levelAndFlags exposed.", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-04-26T07:24:49.000+0000", "updated": "2017-04-26T07:24:49.000+0000" }, { "id": "418084", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "This more a {{Feature}} than a {{Bug}} right? :-) Scheduling for 6.2.0.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-04-26T08:00:56.000+0000", "updated": "2017-04-26T08:00:56.000+0000" }, { "id": "418129", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "Yes, it's a new feature.\r\n\r\nI've changed the parameter and the example is :\r\n{code:javascript}\r\nvar win = Ti.UI.createWindow({});\r\nvar btn = Ti.UI.createButton({\r\n\ttitle: \"click\"\r\n});\r\nwin.add(btn);\r\n\r\nbtn.addEventListener(\"click\", function() {\r\n\t_.delay(function() {\r\n\t\tvar intent = Ti.Android.createIntent({\r\n\t\t\taction: Ti.Android.ACTION_MAIN,\r\n\t\t\tclassName: 'com.appcelerator.notificationsample.NotificationsampleActivity',\r\n\t\t\tpackageName: 'com.appcelerator.notificationsample'\r\n\t\t});\r\n\t\tintent.flags |= Ti.Android.FLAG_ACTIVITY_CLEAR_TOP | Ti.Android.FLAG_ACTIVITY_NEW_TASK;\r\n\t\tintent.addCategory(Ti.Android.CATEGORY_LAUNCHER);\r\n\r\n\t\tvar pending = Titanium.Android.createPendingIntent({\r\n\t\t\tintent: intent,\r\n\t\t\tflags: Titanium.Android.FLAG_UPDATE_CURRENT\r\n\t\t});\r\n\r\n\t\tvar notification = Titanium.Android.createNotification({\r\n\t\t\tcontentTitle: 'Something Happened',\r\n\t\t\tcontentText: 'Click to return to the application.',\r\n\t\t\tcontentIntent: pending, \r\n\t\t\twakeLock: {\r\n\t\t\t\ttime: 2000,\r\n\t\t\t\tflags: Ti.Android.PARTIAL_WAKE_LOCK | Ti.Android.ON_AFTER_RELEASE\r\n\t\t\t}\r\n\t\t});\r\n\t\tTitanium.Android.NotificationManager.notify(1, notification);\r\n\t}, 4000);\r\n});\r\n\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-04-26T19:08:21.000+0000", "updated": "2017-04-26T19:08:21.000+0000" }, { "id": "426540", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "6_2_X: https://github.com/appcelerator/titanium_mobile/pull/9307", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-08-11T16:36:30.000+0000", "updated": "2017-08-11T16:36:30.000+0000" }, { "id": "427064", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Failing review. Please see master PR for info.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-08-22T22:29:38.000+0000", "updated": "2017-08-22T22:29:38.000+0000" }, { "id": "427132", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed for master PR.\r\nMaster PR merged.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-08-24T00:26:19.000+0000", "updated": "2017-08-24T00:26:19.000+0000" }, { "id": "427322", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed for 6.2.0 PR & merged.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-08-28T18:33:19.000+0000", "updated": "2017-08-28T18:33:19.000+0000" }, { "id": "427362", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix in SDK 6.2.0.v20170828180251 & 7.0.0.v20170828180637.\r\n\r\nClosing.\r\n\r\nStudio Ver: 4.9.1.201707200100\r\nOS Ver: 10.12.3\r\nXcode Ver: Xcode 8.3.3\r\nAppc NPM: 4.2.9\r\nAppc CLI: 6.2.3\r\nTi CLI Ver: 5.0.14\r\nAlloy Ver: 1.9.13\r\nNode Ver: 6.10.1\r\nJava Ver: 1.8.0_101\r\nDevices: ⇨ google Pixel --- Android 7.1.1\r\n⇨ google Nexus 5 --- Android 6.0.1\r\n⇨ Motorola G2 --- Android 4.4.4", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-08-29T17:10:23.000+0000", "updated": "2017-08-29T17:10:23.000+0000" } ], "maxResults": 11, "total": 11, "startAt": 0 } } }