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

Commit 1e9ab0ae authored by d34d's avatar d34d
Browse files

Themes: Stop using ThemeUtils.getBootThemeDirty()

Settings are no longer stored in a SQLite DB so this method is no
longer applicable

Change-Id: If46d5d854fe8b4c97f91fdfb4f663f2256d5fbf6
parent f3d9fdc0
Loading
Loading
Loading
Loading
+0 −45
Original line number Diff line number Diff line
@@ -709,51 +709,6 @@ public class ThemeUtils {
        }
    }

    /**
     * Get the boot theme by accessing the settings.db directly instead of using a content resolver.
     * Only use this when the system is starting up and the settings content provider is not ready.
     *
     * Note: This method will only succeed if the system is calling this since normal apps will not
     * be able to access the settings db path.
     *
     * @return The boot theme or null if unable to read the database or get the entry for theme
     *         config
     */
    public static ThemeConfig getBootThemeDirty() {
        ThemeConfig config = null;
        SQLiteDatabase db = null;
        try {
            db = SQLiteDatabase.openDatabase(SETTINGS_DB, null,
                    SQLiteDatabase.OPEN_READONLY);
            if (db != null) {
                String selection = "name=?";
                String[] selectionArgs =
                        { Configuration.THEME_PKG_CONFIGURATION_PERSISTENCE_PROPERTY };
                String[] columns = {"value"};
                Cursor c = db.query(SETTINGS_SECURE_TABLE, columns, selection, selectionArgs,
                        null, null, null);
                if (c != null) {
                    if (c.getCount() > 0) {
                        c.moveToFirst();
                        String json = c.getString(0);
                        if (json != null) {
                            config = ThemeConfig.fromJson(json);
                        }
                    }
                    c.close();
                }
            }
        } catch (Exception e) {
            Log.w(TAG, "Unable to open " + SETTINGS_DB, e);
        } finally {
            if (db != null) {
                db.close();
            }
        }

        return config;
    }

    /**
     * Convenience method to determine if a theme component is a per app theme and not a standard
     * component.
+1 −1
Original line number Diff line number Diff line
@@ -2125,7 +2125,7 @@ public class PackageManagerService extends IPackageManager.Stub {
                }
            }
            mBootThemeConfig = ThemeUtils.getBootThemeDirty();
            mBootThemeConfig = ThemeConfig.getSystemTheme();
            // Collect vendor overlay packages.
            // (Do this before scanning any apps.)