mirror of
https://github.com/nextcloud/android.git
synced 2024-11-28 02:17:43 +03:00
fix kotlin format violations and remove unused function
Signed-off-by: Jonas Mayer <jonas.a.mayer@gmx.net>
This commit is contained in:
parent
0535cb8fbc
commit
2a3d698b20
2 changed files with 10 additions and 25 deletions
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue