Loading tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java +10 −1 Original line number Diff line number Diff line Loading @@ -100,6 +100,7 @@ public abstract class AbstractLauncherUiTest { private static final String TAG = "AbstractLauncherUiTest"; private static String sStrictmodeDetectedActivityLeak; private static boolean sDumpWasGenerated = false; private static boolean sActivityLeakReported; private static final String SYSTEMUI_PACKAGE = "com.android.systemui"; protected static final ActivityLeakTracker ACTIVITY_LEAK_TRACKER = new ActivityLeakTracker(); Loading Loading @@ -151,10 +152,18 @@ public abstract class AbstractLauncherUiTest { } public static String dumpHprofData() { if (sDumpWasGenerated) return "dump has already been generated by another test"; try { final String fileName = getInstrumentation().getTargetContext().getFilesDir().getPath() + "/ActivityLeakHeapDump.hprof"; if (TestHelpers.isInLauncherProcess()) { Debug.dumpHprofData(fileName); } else { final UiDevice device = UiDevice.getInstance(getInstrumentation()); device.executeShellCommand( "am dumpheap " + device.getLauncherPackageName() + " " + fileName); } sDumpWasGenerated = true; return "memory dump filename: " + fileName; } catch (Throwable e) { Log.e(TAG, "dumpHprofData failed", e); Loading Loading
tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java +10 −1 Original line number Diff line number Diff line Loading @@ -100,6 +100,7 @@ public abstract class AbstractLauncherUiTest { private static final String TAG = "AbstractLauncherUiTest"; private static String sStrictmodeDetectedActivityLeak; private static boolean sDumpWasGenerated = false; private static boolean sActivityLeakReported; private static final String SYSTEMUI_PACKAGE = "com.android.systemui"; protected static final ActivityLeakTracker ACTIVITY_LEAK_TRACKER = new ActivityLeakTracker(); Loading Loading @@ -151,10 +152,18 @@ public abstract class AbstractLauncherUiTest { } public static String dumpHprofData() { if (sDumpWasGenerated) return "dump has already been generated by another test"; try { final String fileName = getInstrumentation().getTargetContext().getFilesDir().getPath() + "/ActivityLeakHeapDump.hprof"; if (TestHelpers.isInLauncherProcess()) { Debug.dumpHprofData(fileName); } else { final UiDevice device = UiDevice.getInstance(getInstrumentation()); device.executeShellCommand( "am dumpheap " + device.getLauncherPackageName() + " " + fileName); } sDumpWasGenerated = true; return "memory dump filename: " + fileName; } catch (Throwable e) { Log.e(TAG, "dumpHprofData failed", e); Loading