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

Commit fbb9dff8 authored by Yao Li's avatar Yao Li
Browse files

Disable cache in mocked UserManagerServiceTest

The entire test class is failing due to cache related issue.
Disable caching as this test class is not testing caching itself.

Bug: 390496349
Flag: EXEMPT bugfix
Test: atest FrameworksMockingServicesTests:com.android.server.pm.UserManagerServiceTest
Change-Id: If20bfb380ee4602325545aff2ca5abbf7007729e
parent 21ea1530
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ import android.annotation.UserIdInt;
import android.app.ActivityManager;
import android.app.ActivityManagerInternal;
import android.app.KeyguardManager;
import android.app.PropertyInvalidatedCache;
import android.content.Context;
import android.content.pm.PackageManagerInternal;
import android.content.pm.UserInfo;
@@ -181,8 +182,8 @@ public final class UserManagerServiceTest {
        MockitoAnnotations.initMocks(this);
        mSpiedContext = spy(mRealContext);

        // Called when WatchedUserStates is constructed
        doNothing().when(() -> UserManager.invalidateIsUserUnlockedCache());
        // Disable binder caches in this process.
        PropertyInvalidatedCache.disableForTestMode();

        // Called when creating new users
        when(mDeviceStorageMonitorInternal.isMemoryLow()).thenReturn(false);