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

Commit 0ed8440b authored by Philip P. Moltmann's avatar Philip P. Moltmann Committed by android-build-merger
Browse files

Merge "Disable historical appops" into qt-dev

am: 16128cc7

Change-Id: Ic35af3464c0d9c1a9ef57f2b427f0a9fe2942fa3
parents 9c9e7038 16128cc7
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -150,9 +150,11 @@ final class HistoricalRegistry {


    /**
    /**
     * Whether history is enabled.
     * Whether history is enabled.
     *
     * <p>The feature is permanently disabled in Android Q
     */
     */
    @GuardedBy("mInMemoryLock")
    @GuardedBy("mInMemoryLock")
    private int mMode = AppOpsManager.HISTORICAL_MODE_ENABLED_ACTIVE;
    private final int mMode = AppOpsManager.HISTORICAL_MODE_DISABLED;


    /**
    /**
     * This granularity has been chosen to allow clean delineation for intervals
     * This granularity has been chosen to allow clean delineation for intervals
@@ -451,6 +453,7 @@ final class HistoricalRegistry {


    void setHistoryParameters(@HistoricalMode int mode,
    void setHistoryParameters(@HistoricalMode int mode,
            long baseSnapshotInterval, long intervalCompressionMultiplier) {
            long baseSnapshotInterval, long intervalCompressionMultiplier) {
        /*
        synchronized (mOnDiskLock) {
        synchronized (mOnDiskLock) {
            synchronized (mInMemoryLock) {
            synchronized (mInMemoryLock) {
                // NOTE: We allow this call if persistence is not initialized as
                // NOTE: We allow this call if persistence is not initialized as
@@ -479,6 +482,7 @@ final class HistoricalRegistry {
                }
                }
            }
            }
        }
        }
        */
    }
    }


    void offsetHistory(long offsetMillis) {
    void offsetHistory(long offsetMillis) {
+2 −0
Original line number Original line Diff line number Diff line
@@ -46,6 +46,7 @@ import androidx.test.runner.AndroidJUnit4;
import org.junit.AfterClass;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runner.RunWith;


@@ -242,6 +243,7 @@ public class AppOpsServiceTest {
        assertThat(getLoggedOps()).isNull();
        assertThat(getLoggedOps()).isNull();
    }
    }


    @Ignore("Historical appops are disabled in Android Q")
    @Test
    @Test
    public void testPackageRemovedHistoricalOps() throws InterruptedException {
    public void testPackageRemovedHistoricalOps() throws InterruptedException {
        mAppOpsService.setMode(OP_READ_SMS, mMyUid, mMyPackageName, MODE_ALLOWED);
        mAppOpsService.setMode(OP_READ_SMS, mMyUid, mMyPackageName, MODE_ALLOWED);