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

Commit 32aac7b9 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Gerrit Code Review
Browse files

Merge "Only measure each UID once in InstallerTest."

parents 68d03b23 dd0edac9
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];