|
@@ -36,6 +36,7 @@ import android.app.PendingIntent;
|
|
|
import android.app.Service;
|
|
|
import android.content.Context;
|
|
|
import android.content.Intent;
|
|
|
+import android.content.pm.ServiceInfo;
|
|
|
import android.graphics.BitmapFactory;
|
|
|
import android.os.Binder;
|
|
|
import android.os.Build;
|
|
@@ -305,7 +306,11 @@ public class FileUploader extends Service
|
|
|
public int onStartCommand(Intent intent, int flags, int startId) {
|
|
|
Log_OC.d(TAG, "Starting command with id " + startId);
|
|
|
|
|
|
- startForeground(FOREGROUND_SERVICE_ID, mNotification);
|
|
|
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
|
|
+ startForeground(FOREGROUND_SERVICE_ID, mNotification, ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC);
|
|
|
+ } else {
|
|
|
+ startForeground(FOREGROUND_SERVICE_ID, mNotification);
|
|
|
+ }
|
|
|
|
|
|
if (intent == null) {
|
|
|
Log_OC.e(TAG, "Intent is null");
|
|
@@ -603,7 +608,7 @@ public class FileUploader extends Service
|
|
|
|
|
|
/**
|
|
|
* Core upload method: sends the file(s) to upload WARNING: legacy code, must be in sync with @{{@link
|
|
|
- * FilesUploadWorker#upload(UploadFileOperation, User)}
|
|
|
+ * FilesUploadWorker upload(UploadFileOperation, User)}
|
|
|
*
|
|
|
* @param uploadKey Key to access the upload to perform, contained in mPendingUploads
|
|
|
*/
|