From cfa78b2080e590ca3b28dbf59e6d6f6e7ece7764 Mon Sep 17 00:00:00 2001 From: Man Cao Date: Thu, 11 Jun 2015 20:14:34 -0700 Subject: Add an AM option to start with allocation tracking The new option "--track-allocation" is to work with the new allocation tracker in ART. Bug:20037135 Change-Id: Ic5f8945ab4c1f167c27b05ad0d11d04bac680c1f --- core/java/android/app/ApplicationThreadNative.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'core/java/android/app/ApplicationThreadNative.java') diff --git a/core/java/android/app/ApplicationThreadNative.java b/core/java/android/app/ApplicationThreadNative.java index eb3ddb28c367..6c8b182feb8e 100644 --- a/core/java/android/app/ApplicationThreadNative.java +++ b/core/java/android/app/ApplicationThreadNative.java @@ -284,6 +284,7 @@ public abstract class ApplicationThreadNative extends Binder IUiAutomationConnection.Stub.asInterface(binder); int testMode = data.readInt(); boolean openGlTrace = data.readInt() != 0; + boolean trackAllocation = data.readInt() != 0; boolean restrictedBackupMode = (data.readInt() != 0); boolean persistent = (data.readInt() != 0); Configuration config = Configuration.CREATOR.createFromParcel(data); @@ -291,7 +292,7 @@ public abstract class ApplicationThreadNative extends Binder HashMap services = data.readHashMap(null); Bundle coreSettings = data.readBundle(); bindApplication(packageName, info, providers, testName, profilerInfo, testArgs, - testWatcher, uiAutomationConnection, testMode, openGlTrace, + testWatcher, uiAutomationConnection, testMode, openGlTrace, trackAllocation, restrictedBackupMode, persistent, config, compatInfo, services, coreSettings); return true; } @@ -961,13 +962,14 @@ class ApplicationThreadProxy implements IApplicationThread { data.recycle(); } + @Override public final void bindApplication(String packageName, ApplicationInfo info, List providers, ComponentName testName, ProfilerInfo profilerInfo, Bundle testArgs, IInstrumentationWatcher testWatcher, IUiAutomationConnection uiAutomationConnection, int debugMode, - boolean openGlTrace, boolean restrictedBackupMode, boolean persistent, - Configuration config, CompatibilityInfo compatInfo, Map services, - Bundle coreSettings) throws RemoteException { + boolean openGlTrace, boolean trackAllocation, boolean restrictedBackupMode, + boolean persistent, Configuration config, CompatibilityInfo compatInfo, + Map services, Bundle coreSettings) throws RemoteException { Parcel data = Parcel.obtain(); data.writeInterfaceToken(IApplicationThread.descriptor); data.writeString(packageName); @@ -990,6 +992,7 @@ class ApplicationThreadProxy implements IApplicationThread { data.writeStrongInterface(uiAutomationConnection); data.writeInt(debugMode); data.writeInt(openGlTrace ? 1 : 0); + data.writeInt(trackAllocation ? 1 : 0); data.writeInt(restrictedBackupMode ? 1 : 0); data.writeInt(persistent ? 1 : 0); config.writeToParcel(data, 0); -- cgit v1.2.3