Moving all DB management logic from LauncherProvider into a separate class

This would make it easier to move the controller to LauncherModel

Bug: 277345535
Test: Presubmit
Flag: N/A
Change-Id: I4d044cf41361f400968ef65e18de5d3976fcdec7
This commit is contained in:
Sunny Goyal
2023-04-10 15:28:59 -07:00
parent f8e0e7270e
commit 1ae46ca868
6 changed files with 497 additions and 324 deletions

View File

@@ -39,7 +39,6 @@ import com.android.launcher3.AutoInstallsLayout.LayoutParserCallback;
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.LauncherFiles;
import com.android.launcher3.LauncherPrefs;
import com.android.launcher3.LauncherProvider;
import com.android.launcher3.LauncherSettings;
import com.android.launcher3.LauncherSettings.Favorites;
import com.android.launcher3.Utilities;
@@ -77,6 +76,7 @@ public class DatabaseHelper extends NoLocaleSQLiteHelper implements
private static final boolean LOGD = false;
private static final String DOWNGRADE_SCHEMA_FILE = "downgrade_schema.json";
public static final String EMPTY_DATABASE_CREATED = "EMPTY_DATABASE_CREATED";
private final Context mContext;
private final boolean mForMigration;
@@ -165,8 +165,7 @@ public class DatabaseHelper extends NoLocaleSQLiteHelper implements
*/
protected void onEmptyDbCreated() {
// Set the flag for empty DB
LauncherPrefs.getPrefs(mContext).edit().putBoolean(getKey(
LauncherProvider.EMPTY_DATABASE_CREATED), true)
LauncherPrefs.getPrefs(mContext).edit().putBoolean(getKey(EMPTY_DATABASE_CREATED), true)
.commit();
}