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

Commit 3e8d92c3 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix deadlock b/w historical and discrete registry in xml implementation" into main

parents 61c9b1f8 d29a726e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -7014,6 +7014,7 @@ public class AppOpsService extends IAppOpsService.Stub {
        offsetHistory_enforcePermission();
        // Must not hold the appops lock
        mHistoricalRegistry.offsetHistory(offsetMillis);
        mHistoricalRegistry.offsetDiscreteHistory(offsetMillis);
    }

    @android.annotation.EnforcePermission(android.Manifest.permission.MANAGE_APPOPS)
+5 −0
Original line number Diff line number Diff line
@@ -135,6 +135,11 @@ public interface HistoricalRegistryInterface {
     */
    void offsetHistory(long offsetMillis);

      /**
     * Offsets discrete history by the given duration.
     */
    void offsetDiscreteHistory(long offsetMillis);

    /**
     * Retrieve historical app op stats for a period form disk.
     */
+5 −0
Original line number Diff line number Diff line
@@ -130,6 +130,11 @@ public class HistoricalRegistrySql implements HistoricalRegistryInterface {

    }

    @Override
    public void offsetDiscreteHistory(long offsetMillis) {

    }

    @Override
    public void getHistoricalOpsFromDiskRaw(int uid, @Nullable String packageName,
            @Nullable String attributionTag, @Nullable String[] opNames, int historyFlags,
+5 −1
Original line number Diff line number Diff line
@@ -619,6 +619,10 @@ final class LegacyHistoricalRegistry implements HistoricalRegistryInterface {
                mPersistence.persistHistoricalOpsDLocked(history);
            }
        }
    }

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