summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorvadimt <vadimt@google.com>2019-08-14 17:45:45 -0700
committervadimt <vadimt@google.com>2019-09-06 16:50:51 -0700
commit2bad570b40506bab04650711db3a3155043554c8 (patch)
treecdc6929f8a646018b791ae8562ce84552959a08c /src/com
parent243dd30da31df6153e255368c3cc748decd45127 (diff)
downloadandroid_packages_apps_Trebuchet-2bad570b40506bab04650711db3a3155043554c8.tar.gz
android_packages_apps_Trebuchet-2bad570b40506bab04650711db3a3155043554c8.tar.bz2
android_packages_apps_Trebuchet-2bad570b40506bab04650711db3a3155043554c8.zip
Support for getting Launcher Pss by tests
Bug: 139137636 Change-Id: I8cad7dec07ce400cf927e3fc2ba9904fef942d9a
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/launcher3/testing/TestInformationHandler.java11
-rw-r--r--src/com/android/launcher3/testing/TestProtocol.java2
2 files changed, 7 insertions, 6 deletions
diff --git a/src/com/android/launcher3/testing/TestInformationHandler.java b/src/com/android/launcher3/testing/TestInformationHandler.java
index 4fd0f884d..243ff6f96 100644
--- a/src/com/android/launcher3/testing/TestInformationHandler.java
+++ b/src/com/android/launcher3/testing/TestInformationHandler.java
@@ -17,6 +17,7 @@ package com.android.launcher3.testing;
import android.content.Context;
import android.os.Bundle;
+import android.os.Debug;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.InvariantDeviceProfile;
@@ -113,13 +114,13 @@ public class TestInformationHandler implements ResourceBasedOverride {
break;
}
- case TestProtocol.REQUEST_ALLOCATED_MEMORY: {
- final Runtime runtime = Runtime.getRuntime();
- response.putLong(TestProtocol.TEST_INFO_RESPONSE_FIELD,
- runtime.totalMemory() - runtime.freeMemory());
+ case TestProtocol.REQUEST_TOTAL_PSS_KB: {
+ Debug.MemoryInfo mem = new Debug.MemoryInfo();
+ Debug.getMemoryInfo(mem);
+ response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, mem.getTotalPss());
break;
}
}
return response;
}
-}
+} \ No newline at end of file
diff --git a/src/com/android/launcher3/testing/TestProtocol.java b/src/com/android/launcher3/testing/TestProtocol.java
index d569d4007..60a59ddfa 100644
--- a/src/com/android/launcher3/testing/TestProtocol.java
+++ b/src/com/android/launcher3/testing/TestProtocol.java
@@ -73,7 +73,7 @@ public final class TestProtocol {
public static final String REQUEST_APP_LIST_FREEZE_FLAGS = "app-list-freeze-flags";
public static final String REQUEST_OVERVIEW_LEFT_GESTURE_MARGIN = "overview-left-margin";
public static final String REQUEST_OVERVIEW_RIGHT_GESTURE_MARGIN = "overview-right-margin";
- public static final String REQUEST_ALLOCATED_MEMORY = "allocated-memory";
+ public static final String REQUEST_TOTAL_PSS_KB = "total_pss";
public static boolean sDebugTracing = false;
public static final String REQUEST_ENABLE_DEBUG_TRACING = "enable-debug-tracing";