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

Commit 8e4402d2 authored by d34d's avatar d34d Committed by Gerrit Code Review
Browse files

Themes: Remove unnecessary query in updateWallpaper

Not sure why this is here but it's not necessary since the returned
cursor was never used besides calling moveTofirst()

Change-Id: I95b579d89f3a77e2187cea498a4a22d67e6a3486
parent 905bf12d
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -673,28 +673,18 @@ public class ThemeService extends IThemeService.Stub {
    }

    private boolean updateWallpaper(String pkgName) {
        String selection = ThemesColumns.PKG_NAME + "= ?";
        String[] selectionArgs = { pkgName };
        Cursor c = mContext.getContentResolver().query(ThemesColumns.CONTENT_URI,
                null, selection,
                selectionArgs, null);
        c.moveToFirst();
        WallpaperManager wm = WallpaperManager.getInstance(mContext);
        if (SYSTEM_DEFAULT.equals(pkgName)) {
            try {
                wm.clear();
            } catch (IOException e) {
                return false;
            } finally {
                c.close();
            }
        } else if (TextUtils.isEmpty(pkgName)) {
            try {
                wm.clear(false);
            } catch (IOException e) {
                return false;
            } finally {
                c.close();
            }
        } else {
            InputStream in = null;
@@ -706,7 +696,6 @@ public class ThemeService extends IThemeService.Stub {
                return false;
            } finally {
                ThemeUtils.closeQuietly(in);
                c.close();
            }
        }
        return true;