Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26953] Android: Modify Service.foregroundNotify() to support "foregroundServiceType" for Android Q

GitHub Issuen/a
TypeImprovement
PriorityNone
StatusClosed
ResolutionFixed
Resolution Date2019-10-03T15:24:09.000+0000
Affected Version/sn/a
Fix Version/sRelease 8.3.0
ComponentsAndroid
Labelsandroid, foreground, location, service
ReporterJoshua Quick
AssigneeGary Mathews
Created2019-03-29T22:16:19.000+0000
Updated2019-10-03T15:27:47.000+0000

Description

*Summary:* Android Q requires foreground services to set a new "foregroundServiceType" setting to "location" in order to collect location data while the app is backgrounded. https://developer.android.com/preview/privacy/device-location#continuation-user-initiated-action *Recommended Solution:* We don't have to set "android:foregroundServiceType" in the "AndroidManifest.xml". We can set it dynamically via the new Android Q [Service.startForeground()](https://developer.android.com/reference/android/app/Service.html#startForeground(int,%20android.app.Notification,%20int)) method overload which accepts a foregroundServiceType as a 3rd argument. We should modify Titanium's [Service.foregroundNotify()](https://docs.appcelerator.com/platform/latest/#!/api/Titanium.Android.Service-method-foregroundNotify) to support this new setting as well.

Comments

  1. Gary Mathews 2019-09-05

    8_3_X: https://github.com/appcelerator/titanium_mobile/pull/11197
  2. Samir Mohammed 2019-09-25

    FR Passed, waiting on Jenkins build.
  3. Christopher Williams 2019-10-02

    merged to master
  4. Sohail Saddique 2019-10-03

    Verified working correctly on 8.3.0. Ticket closed.
  5. Sohail Saddique 2019-10-03

    Build: 8.3.0.v20191002165629

JSON Source