Procházet zdrojové kódy

fix kotlin format violations and remove unused function

Signed-off-by: Jonas Mayer <jonas.a.mayer@gmx.net>
Jonas Mayer před 1 rokem
rodič
revize
2a3d698b20

+ 10 - 7
app/src/main/java/com/nextcloud/client/jobs/FilesUploadWorker.kt

@@ -198,13 +198,17 @@ class FilesUploadWorker(
      * adapted from [com.owncloud.android.files.services.FileUploader.notifyUploadStart]
      */
     private fun createNotification(uploadFileOperation: UploadFileOperation) {
-
-        val notificationActionIntent = Intent(context,FileUploader.UploadNotificationActionReceiver::class.java)
-        notificationActionIntent.putExtra(FileUploader.EXTRA_ACCOUNT_NAME,uploadFileOperation.user.accountName)
-        notificationActionIntent.putExtra(FileUploader.EXTRA_REMOTE_PATH,uploadFileOperation.remotePath)
+        val notificationActionIntent = Intent(context, FileUploader.UploadNotificationActionReceiver::class.java)
+        notificationActionIntent.putExtra(FileUploader.EXTRA_ACCOUNT_NAME, uploadFileOperation.user.accountName)
+        notificationActionIntent.putExtra(FileUploader.EXTRA_REMOTE_PATH, uploadFileOperation.remotePath)
         notificationActionIntent.action = FileUploader.ACTION_CANCEL_BROADCAST
 
-        val pendingIntent = PendingIntent.getBroadcast(context,SecureRandom().nextInt(),notificationActionIntent, PendingIntent.FLAG_MUTABLE)
+        val pendingIntent = PendingIntent.getBroadcast(
+            context,
+            SecureRandom().nextInt(),
+            notificationActionIntent,
+            PendingIntent.FLAG_MUTABLE
+        )
 
         notificationBuilder
             .setOngoing(true)
@@ -219,8 +223,7 @@ class FilesUploadWorker(
                 )
             )
             .clearActions() // to make sure there is only one action
-            .addAction(R.drawable.ic_action_cancel_grey,context.getString(R.string.common_cancel),pendingIntent)
-
+            .addAction(R.drawable.ic_action_cancel_grey, context.getString(R.string.common_cancel), pendingIntent)
 
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
             notificationBuilder.setChannelId(NotificationUtils.NOTIFICATION_CHANNEL_UPLOAD)

+ 0 - 18
app/src/main/java/com/owncloud/android/datamodel/UploadsStorageManager.java

@@ -345,24 +345,6 @@ public class UploadsStorageManager extends Observable {
         return getUploads(null, (String[]) null);
     }
 
-    public OCUpload getUploadByRemotePath(String remotePath){
-        OCUpload result = null;
-        Cursor cursor = getDB().query(
-            ProviderTableMeta.CONTENT_URI_UPLOADS,
-            null,
-            ProviderTableMeta.UPLOADS_REMOTE_PATH + "=?",
-            new String[]{remotePath},
-            ProviderTableMeta.UPLOADS_REMOTE_PATH+ " ASC");
-
-        if (cursor != null) {
-            if (cursor.moveToFirst()) {
-                result = createOCUploadFromCursor(cursor);
-            }
-        }
-        Log_OC.d(TAG, "Retrieve job " + result + " for remote path " + remotePath);
-        return result;
-    }
-
     public @Nullable
     OCUpload getUploadById(long id) {
         OCUpload result = null;