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

Commit dd9784bd authored by Stanislav Zholnin's avatar Stanislav Zholnin Committed by Automerger Merge Worker
Browse files

Merge "Make DiscreteRegistry react only to offsetHistory() calls made as...

Merge "Make DiscreteRegistry react only to offsetHistory() calls made as TestApi call. Initialize DiscreteRegistry first as it doesn't depend on HistoricalRegistry." into sc-dev am: 6eb35894 am: 0edd2560

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14551806

Change-Id: I80bf748805c563e8cdd4d1fc2f4643ca7bd5a99e
parents 95fa9061 0edd2560
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -6470,6 +6470,7 @@ public class AppOpsService extends IAppOpsService.Stub {
                "offsetHistory");
        // Must not hold the appops lock
        mHistoricalRegistry.offsetHistory(offsetMillis);
        mHistoricalRegistry.offsetDiscreteHistory(offsetMillis);
    }

    @Override
+4 −1
Original line number Diff line number Diff line
@@ -212,6 +212,7 @@ final class HistoricalRegistry {
    }

    void systemReady(@NonNull ContentResolver resolver) {
        mDiscreteRegistry.systemReady();
        final Uri uri = Settings.Global.getUriFor(Settings.Global.APPOP_HISTORY_PARAMETERS);
        resolver.registerContentObserver(uri, false, new ContentObserver(
                FgThread.getHandler()) {
@@ -249,7 +250,6 @@ final class HistoricalRegistry {
                }
            }
        }
        mDiscreteRegistry.systemReady();
    }

    private boolean isPersistenceInitializedMLocked() {
@@ -594,6 +594,9 @@ final class HistoricalRegistry {
                mPersistence.persistHistoricalOpsDLocked(history);
            }
        }
    }

    void offsetDiscreteHistory(long offsetMillis) {
        mDiscreteRegistry.offsetHistory(offsetMillis);
    }