Removing memory object checks based on "dumpsys meminfo"

This "dumpsys meminfo" can return phantom references that we have no control over and that can break all counting.

Given that the removed code haven't found issues in the past, and that we have Launcher activity counting implemented via TestProtocol.REQUEST_GET_ACTIVITIES, removing all "dumpsys meminfo" code.

Test: presubmit
Bug: 260260325
Flag: N/A
Change-Id: Ic80a6145d76d7cddfedad5328cb141a955b1eaf5
This commit is contained in:
vadimt
2023-05-24 18:06:19 -07:00
parent 883871e280
commit efe75cecad
3 changed files with 0 additions and 30 deletions

View File

@@ -16,7 +16,6 @@
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;
@@ -25,10 +24,7 @@ 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;
import androidx.annotation.Nullable;
@@ -42,7 +38,6 @@ import com.android.launcher3.testing.shared.TestProtocol;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedList;
import java.util.Map;
import java.util.WeakHashMap;
import java.util.concurrent.CountDownLatch;
@@ -52,7 +47,6 @@ import java.util.concurrent.TimeUnit;
* Class to handle requests from tests, including debug ones.
*/
public class DebugTestInformationHandler extends TestInformationHandler {
private static LinkedList sLeaks;
private static Collection<String> sEvents;
private static Application.ActivityLifecycleCallbacks sActivityLifecycleCallbacks;
private static final Map<Activity, Boolean> sActivities =
@@ -158,19 +152,6 @@ public class DebugTestInformationHandler extends TestInformationHandler {
return response;
}
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(