public String startUpload ( ) { UploadService . setUploadStatusDelegate ( params . id , delegate ) ; final Intent intent = new Intent ( context , UploadService . class ) ; this . initializeIntent ( intent ) ; intent . setAction ( UploadService . getActionUpload ( ) ) ; if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . O ) { if ( params . notificationConfig == null ) { throw new IllegalArgumentException ( "Android Oreo requires a notification configuration for the service to run. https://developer.android.com/reference/android/content/Context.html#startForegroundService(android.content.Intent)" ) ; } context . startForegroundService ( intent ) ; } else { context . startService ( intent ) ; } return params . id ; }
Start the background file upload service .