mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 18:58:19 +00:00
Add debug logs to help investigate view and activity leak test failures.
Flag: not needed Test: MemoryTests Bug: 260260325 Change-Id: Ie9ed8e607c574e81696a4246f701534c18cf0b7c
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.launcher3.testing;
|
||||
|
||||
import static com.android.launcher3.testing.shared.TestProtocol.VIEW_AND_ACTIVITY_LEAKS;
|
||||
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
|
||||
import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
|
||||
|
||||
@@ -24,7 +25,9 @@ import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.os.Binder;
|
||||
import android.os.Bundle;
|
||||
import android.os.Process;
|
||||
import android.system.Os;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.Keep;
|
||||
@@ -157,11 +160,17 @@ public class DebugTestInformationHandler extends TestInformationHandler {
|
||||
|
||||
case TestProtocol.REQUEST_VIEW_LEAK: {
|
||||
if (sLeaks == null) sLeaks = new LinkedList();
|
||||
Log.d(VIEW_AND_ACTIVITY_LEAKS, "forcefully leaking 2 views");
|
||||
sLeaks.add(new View(mContext));
|
||||
sLeaks.add(new View(mContext));
|
||||
return response;
|
||||
}
|
||||
|
||||
case TestProtocol.PRINT_VIEW_LEAK: {
|
||||
Log.d(VIEW_AND_ACTIVITY_LEAKS, "(pid=" + Process.myPid() + ") sLeaks=" + sLeaks);
|
||||
return response;
|
||||
}
|
||||
|
||||
case TestProtocol.REQUEST_START_EVENT_LOGGING: {
|
||||
sEvents = new ArrayList<>();
|
||||
TestLogging.setEventConsumer(
|
||||
|
||||
Reference in New Issue
Block a user