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

Commit 6ff5967e authored by Dipankar Bhardwaj's avatar Dipankar Bhardwaj
Browse files

Add null check on ContentProviderClient in DownloadManager.onMediaStoreDownloadsDeleted

Fixes NullPointerException which happens when CP Client becomes null.

Change-Id: I7acb7947c6fcc3f85f33cb04689999529a478952
Test: n/a
Bug: 306956929
Flag: EXEMPT bug fix
parent 4466b845
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -1105,10 +1105,17 @@ public class DownloadManager {
           callExtras.putLongArray(android.provider.Downloads.EXTRA_IDS, ids);
           callExtras.putStringArray(android.provider.Downloads.EXTRA_MIME_TYPES,
                   mimeTypes);
           client.call(android.provider.Downloads.CALL_MEDIASTORE_DOWNLOADS_DELETED,
                   null, callExtras);
            if (client != null) {
                client.call(
                        android.provider.Downloads.CALL_MEDIASTORE_DOWNLOADS_DELETED,
                        null,
                        callExtras);
            } else {
                throw new IllegalStateException(
                        "Could not acquire stable provider for " + mBaseUri);
            }
        } catch (RemoteException e) {
            // Should not happen
            throw e.rethrowFromSystemServer();
        }
    }