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

Commit f6a34a1c authored by Manjeet Rulhania's avatar Manjeet Rulhania
Browse files

Update DiscreteOpsXmlRegistry instantiation to use a lock.

fixing the typo.

Bug: 377584611
Test: presubmit
Flag: EXEMPT bug fix
Change-Id: Idf9bb1c41fb7dc8d476f32ed6037c27f7e471ba2
parent 1fde0526
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -238,7 +238,9 @@ public class HistoricalRegistry implements HistoricalRegistryInterface {
        // migrate discrete ops from xml or sqlite to unified-schema sqlite database.
        if (DiscreteOpsXmlRegistry.getDiscreteOpsDir().exists()) {
            Slog.i(TAG, "migrate discrete ops from xml to unified sqlite.");
            DiscreteOpsXmlRegistry xmlRegistry = new DiscreteOpsXmlRegistry(mContext);
            // We don't really need to use AppOpsService lock here as this is a one time migration.
            Object lock = new Object();
            DiscreteOpsXmlRegistry xmlRegistry = new DiscreteOpsXmlRegistry(lock);
            DiscreteOpsMigrationHelper.migrateFromXmlToUnifiedSchemaSqlite(
                    xmlRegistry, mShortIntervalHistoryHelper);
        } else if (DiscreteOpsDbHelper.getDatabaseFile().exists()) {
+2 −2
Original line number Diff line number Diff line
@@ -263,7 +263,7 @@ final class LegacyHistoricalRegistry implements HistoricalRegistryInterface {
            DiscreteOpsSqlRegistry sqlRegistry = (DiscreteOpsSqlRegistry) mDiscreteRegistry;
            if (DiscreteOpsXmlRegistry.getDiscreteOpsDir().exists()) {
                Slog.i(LOG_TAG, "migrate discrete ops from xml to sqlite.");
                DiscreteOpsXmlRegistry xmlRegistry = new DiscreteOpsXmlRegistry(mContext);
                DiscreteOpsXmlRegistry xmlRegistry = new DiscreteOpsXmlRegistry(mInMemoryLock);
                xmlRegistry.systemReady();
                DiscreteOpsMigrationHelper.migrateFromXmlToSqlite(
                        xmlRegistry, sqlRegistry);
@@ -277,7 +277,7 @@ final class LegacyHistoricalRegistry implements HistoricalRegistryInterface {
        } else {
            if (HistoricalRegistry.getDiscreteOpsDatabaseFile().exists()) {
                Slog.i(LOG_TAG, "rollback discrete ops from unified sqlite to xml.");
                DiscreteOpsXmlRegistry xmlRegistry = new DiscreteOpsXmlRegistry(mContext);
                DiscreteOpsXmlRegistry xmlRegistry = new DiscreteOpsXmlRegistry(mInMemoryLock);
                AppOpHistoryHelper appOpHistoryHelper = getAppOpHistoryHelper();
                DiscreteOpsMigrationHelper.rollbackFromUnifiedSchemaSqliteToXml(
                        appOpHistoryHelper, xmlRegistry);