Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 24287b55 authored by Hyundo Moon's avatar Hyundo Moon Committed by Gerrit Code Review
Browse files

Merge "OPP: Delete incomplete download file" into main

parents 6af3053f 3620bb5d
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ import com.android.bluetooth.BluetoothStatsLog;
import com.android.bluetooth.Utils;
import com.android.bluetooth.btservice.MetricsLogger;
import com.android.bluetooth.content_profiles.ContentProfileErrorReportUtils;
import com.android.bluetooth.flags.Flags;
import com.android.obex.HeaderSet;
import com.android.obex.ObexTransport;
import com.android.obex.Operation;
@@ -426,6 +427,18 @@ public class BluetoothOppObexServerSession extends ServerRequestHandler
                    msg.obj = mInfo;
                    msg.sendToTarget();
                }

                if (Flags.oppRemoveIncompleteDownload() && mFileInfo.mInsertUri != null) {
                    Log.d(
                        TAG,
                        "Download failed. Removing the file. Uri=" + mFileInfo.mInsertUri);
                    BluetoothMethodProxy.getInstance()
                            .contentResolverDelete(
                                    mContext.getContentResolver(),
                                    mFileInfo.mInsertUri,
                                    null,
                                    null);
                }
            }
        } else if (mAccepted == BluetoothShare.USER_CONFIRMATION_DENIED
                || mAccepted == BluetoothShare.USER_CONFIRMATION_TIMEOUT) {