Merge "Only measure each UID once in InstallerTest." am: 32aac7b9c9 am: 7b6d21b37e
am: 5092952317
Change-Id: Ib352977f7f01e97bc3afefb743f3ccb7725cbaec
This commit is contained in:
@@ -44,11 +44,19 @@ public class InstallerTest extends AndroidTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testGetAppSize() throws Exception {
|
public void testGetAppSize() throws Exception {
|
||||||
|
int[] appIds = null;
|
||||||
|
|
||||||
final PackageManager pm = getContext().getPackageManager();
|
final PackageManager pm = getContext().getPackageManager();
|
||||||
for (ApplicationInfo app : pm.getInstalledApplications(0)) {
|
for (ApplicationInfo app : pm.getInstalledApplications(0)) {
|
||||||
final int userId = UserHandle.getUserId(app.uid);
|
final int userId = UserHandle.getUserId(app.uid);
|
||||||
final int appId = UserHandle.getAppId(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 String[] packageNames = pm.getPackagesForUid(app.uid);
|
||||||
final long[] ceDataInodes = new long[packageNames.length];
|
final long[] ceDataInodes = new long[packageNames.length];
|
||||||
final String[] codePaths = new String[packageNames.length];
|
final String[] codePaths = new String[packageNames.length];
|
||||||
|
|||||||
Reference in New Issue
Block a user