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

Commit c0864047 authored by Lee Shombert's avatar Lee Shombert
Browse files

Fix AccountManagerServiceTest

Bug: 226979591

AccountManagerServiceTest fails because a PropertyInvalidatedCache
tries to set a system property.  This change puts the caches in test
mode so the test can run.

The change uses the legacy PropertyInvalidatedCache to match a change
that has already gone into master.

Test:
 * atest FrameworksServicesTests:AccountManagerServiceTest

Change-Id: I960120f00290968b4d48ceecd71b22bc8c548e0c
parent 1ccb6f2a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ import android.accounts.AccountManagerInternal;
import android.accounts.CantAddAccountActivity;
import android.accounts.IAccountManagerResponse;
import android.app.AppOpsManager;
import android.app.PropertyInvalidatedCache;
import android.app.INotificationManager;
import android.app.admin.DevicePolicyManager;
import android.app.admin.DevicePolicyManagerInternal;
@@ -132,6 +133,8 @@ public class AccountManagerServiceTest extends AndroidTestCase {
    protected void setUp() throws Exception {
        MockitoAnnotations.initMocks(this);

        PropertyInvalidatedCache.disableForTestMode();

        when(mMockPackageManager.checkSignatures(anyInt(), anyInt()))
                    .thenReturn(PackageManager.SIGNATURE_MATCH);
        final UserInfo ui = new UserInfo(UserHandle.USER_SYSTEM, "user0", 0);