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

Commit eb23cb2a authored by Winson Chung's avatar Winson Chung
Browse files

Properly releasing ContentProviderClient after LauncherModel check.

Change-Id: I0823ada46661b5ba0c36a0bb9f792969a1d04561
parent 706ab0d0
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -191,8 +191,12 @@ public class LauncherModel extends BroadcastReceiver {
        ContentResolver contentResolver = context.getContentResolver();

        mAppsCanBeOnRemoveableStorage = Environment.isExternalStorageRemovable();
        mOldContentProviderExists = (contentResolver.acquireContentProviderClient(
                LauncherSettings.Favorites.OLD_CONTENT_URI) != null);
        ContentProviderClient client = contentResolver.acquireContentProviderClient(
                LauncherSettings.Favorites.OLD_CONTENT_URI);
        mOldContentProviderExists = (client != null);
        if (client != null) {
            client.release();
        }
        mApp = app;
        mBgAllAppsList = new AllAppsList(iconCache, appFilter);
        mIconCache = iconCache;