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

Commit dd0edac9 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Only measure each UID once in InstallerTest.

Test: builds, boots
Bug: 34341727
Change-Id: Ic8250b7383f52adf30139ceed02469a9d278dc18
parent 68d03b23
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -44,11 +44,19 @@ public class InstallerTest extends AndroidTestCase {
    }

    public void testGetAppSize() throws Exception {
        int[] appIds = null;

        final PackageManager pm = getContext().getPackageManager();
        for (ApplicationInfo app : pm.getInstalledApplications(0)) {
            final int userId = UserHandle.getUserId(app.uid);
            final int appId = UserHandle.getAppId(app.uid);

            if (ArrayUtils.contains(appIds, appId)) {
                continue;
            } else {
                appIds = ArrayUtils.appendInt(appIds, appId);
            }

            final String[] packageNames = pm.getPackagesForUid(app.uid);
            final long[] ceDataInodes = new long[packageNames.length];
            final String[] codePaths = new String[packageNames.length];