diff --git a/app/src/main/java/org/lineageos/recorder/task/DeleteRecordingTask.java b/app/src/main/java/org/lineageos/recorder/task/DeleteRecordingTask.java index eae14a7d..6b14c9f1 100644 --- a/app/src/main/java/org/lineageos/recorder/task/DeleteRecordingTask.java +++ b/app/src/main/java/org/lineageos/recorder/task/DeleteRecordingTask.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 The LineageOS Project + * Copyright (C) 2021-2023 The LineageOS Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,10 +17,13 @@ import android.content.ContentResolver; import android.net.Uri; +import android.util.Log; import androidx.annotation.NonNull; public final class DeleteRecordingTask implements Runnable { + private static final String TAG = "DeleteRecordingTask"; + @NonNull private final ContentResolver cr; @NonNull @@ -33,6 +36,10 @@ public DeleteRecordingTask(@NonNull ContentResolver cr, @NonNull Uri uri) { @Override public void run() { - cr.delete(uri, null, null); + try { + cr.delete(uri, null, null); + } catch (SecurityException e) { + Log.e(TAG, "Failed to delete recording", e); + } } }