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

Commit 577164bd authored by Chalard Jean's avatar Chalard Jean
Browse files

Fix PermissionMonitorTest that has been failing.

The fail is related to a recent fix to PermissionMonitor
that went into pi-dev only : ag/3799094, which fixed getting
the remote package name for the correct macro user instead of
the default. That fix had broken the test, this change fixes it.

Test: test now passes
Bug: 77315205
Change-Id: I26f8276eafe80478d5fefcff92e7dc2f12128bb4
parent 6f5a8db2
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -26,6 +26,8 @@ import static android.content.pm.PackageManager.GET_PERMISSIONS;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.anyInt;
import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.when;

import android.content.Context;
@@ -62,8 +64,8 @@ public class PermissionMonitorTest {

    private void expectPermission(String[] permissions, boolean preinstalled) throws Exception {
        final PackageInfo packageInfo = packageInfoWithPermissions(permissions, preinstalled);
        when(mPackageManager.getPackageInfo(MOCK_PACKAGE_NAMES[0], GET_PERMISSIONS))
                .thenReturn(packageInfo);
        when(mPackageManager.getPackageInfoAsUser(
                eq(MOCK_PACKAGE_NAMES[0]), eq(GET_PERMISSIONS), anyInt())).thenReturn(packageInfo);
    }

    private PackageInfo packageInfoWithPermissions(String[] permissions, boolean preinstalled) {