[TIMOB-26260] Android: Update "Ti.Android.Service" to handle "FOREGROUND_SERVICE" permission
| GitHub Issue | n/a |
|---|---|
| Type | Improvement |
| Priority | High |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2018-10-04T00:20:33.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 7.5.0 |
| Components | Android |
| Labels | android, foreground, permissions, service |
| Reporter | Joshua Quick |
| Assignee | Joshua Quick |
| Created | 2018-08-04T01:06:44.000+0000 |
| Updated | 2018-10-08T19:43:07.000+0000 |
Description
Apps targeting Android P must add a new
FOREGROUND_SERVICE permission to the "AndroidManifest.xml" or else calling Ti.Android.Service.foregroundNotify() will throw a Java SecurityException internally and fail to start.
https://developer.android.com/preview/behavior-changes#fg-svc
We need to do the following:
* Log an error if the permission is missing when calling Service.foregroundNotify().
* Document that that this permission is required.
PR (master): https://github.com/appcelerator/titanium_mobile/pull/10314
FR Passed.
PR Merged.
Verified the fix on SDK 7.5.0.v20181005164109. Forgeround service permission works as expected. Closing
Operating System Name = Mac OS X Version = 10.13.6 Architecture = 64bit Node.js Node.js Version = 8.9.1 npm Version = 5.5.1 Titanium CLI CLI Version = 5.1.1 Titanium SDK SDK Version =7.5.0.v20181005164109 Device =Oneplus 5T Android 8 samsung s5 android 6 samsung galaxy 2 android 4.4