Due to Background Service Limitations in Oreo, I put up my Service (used in Nougat, API 25) to send data to Wear (API 23) using Jobscheduler (as recommended replacement). There I am using an AsyncTask to send data to my wearable.
PutDataMapRequest putDataMapReq = PutDataMapRequest.create("/nextAppt");
putDataMapReq.getDataMap().putLong("appt", nextAppt);
PutDataRequest putDataReq = putDataMapReq.asPutDataRequest();
putDataReq.setUrgent();
PendingResult<DataApi.DataItemResult> pendingResult =
Wearable.DataApi.putDataItem(mGoogleApiClient, putDataReq);
This works fine as a regular Service (pre-Oreo), but not from a Jobservice (no matter if my MainActivity is in foreground or not). There is also no error message, etc. Just that nothing arrives at my Wear-device.
As I want to avoid using a foreground Service I am out of ideas right now, how to accomplish this or why exactly it does not work...