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

Commit 959e172e authored by Hai Zhang's avatar Hai Zhang Committed by Android (Google) Code Review
Browse files

Merge "Fix AppOpsServiceTest flakiness."

parents ee8fa8c7 efc0db38
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1889,6 +1889,7 @@ public class AppOpsService extends IAppOpsService.Stub {
        synchronized (this) {
            if (mWriteScheduled) {
                mWriteScheduled = false;
                mHandler.removeCallbacks(mWriteRunner);
                doWrite = true;
            }
        }
+5 −5
Original line number Diff line number Diff line
@@ -130,7 +130,9 @@ public class AppOpsServiceTest {
    }

    @After
    public void resetStaticMocks() {
    public void tearDown() {
        mAppOpsService.shutdown();

        mMockingSession.finishMocking();
    }

@@ -216,9 +218,8 @@ public class AppOpsServiceTest {
                false);
        mAppOpsService.writeState();

        // Create a new app ops service, and initialize its state from XML.
        // Create a new app ops service which will initialize its state from XML.
        setupAppOpsService();
        mAppOpsService.readState();

        // Query the state of the 2nd service.
        List<PackageOps> loggedOps = getLoggedOps();
@@ -233,9 +234,8 @@ public class AppOpsServiceTest {
        mAppOpsService.noteOperation(OP_READ_SMS, mMyUid, sMyPackageName, null, false, null, false);
        mAppOpsService.shutdown();

        // Create a new app ops service, and initialize its state from XML.
        // Create a new app ops service which will initialize its state from XML.
        setupAppOpsService();
        mAppOpsService.readState();

        // Query the state of the 2nd service.
        List<PackageOps> loggedOps = getLoggedOps();