From 90aa945df5b2b19d60de72d86966033239e3a8ad Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Fri, 29 Mar 2019 13:49:35 -0700 Subject: [PATCH] Pass debug.allocTracker.stackDepth to runtime if it exists Since this is no longer called in ART, pass it down in bind application. Bug: 37291459 Test: test-art-host Change-Id: I23623e9b8e9ca6261d90cc1ae1c5d8c24cc4eba5 --- core/java/android/app/ActivityThread.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index 9bc719eae2237..7cd1b087d9cad 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -5659,6 +5659,11 @@ public final class ActivityThread extends ClientTransactionHandler { private void handleBindApplication(AppBindData data) { // Register the UI Thread as a sensitive thread to the runtime. VMRuntime.registerSensitiveThread(); + // In the case the stack depth property exists, pass it down to the runtime. + String property = SystemProperties.get("debug.allocTracker.stackDepth"); + if (property.length() != 0) { + VMDebug.setAllocTrackerStackDepth(Integer.parseInt(property)); + } if (data.trackAllocation) { DdmVmInternal.enableRecentAllocations(true); }