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

Commit 998a0952 authored by Chienyuan Huang's avatar Chienyuan Huang
Browse files

OPP: Do not trimDatabase if ContentProvider doesn't exist

Bug: 257539713
Test: manual
Change-Id: I215dcc477cdda567feeed9d0d9c39c0a45f1b940
parent 9c697179
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1115,6 +1115,11 @@ public class BluetoothOppService extends ProfileService implements IObexConnecti

    // Run in a background thread at boot.
    private static void trimDatabase(ContentResolver contentResolver) {
        if (contentResolver.acquireContentProviderClient(BluetoothShare.CONTENT_URI) == null) {
            Log.w(TAG, "ContentProvider doesn't exist");
            return;
        }

        // remove the invisible/unconfirmed inbound shares
        int delNum = contentResolver.delete(BluetoothShare.CONTENT_URI, WHERE_INVISIBLE_UNCONFIRMED,
                null);