mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 03:08:19 +00:00
Removing pss checks in memory tests
Test: presubmit Bug: 185181057 Change-Id: I4f504f9540b80c62cd3f1024ff1d1b57102f2ed6
This commit is contained in:
@@ -16,16 +16,11 @@
|
||||
|
||||
package com.android.launcher3.testing;
|
||||
|
||||
import static android.graphics.Bitmap.Config.ARGB_8888;
|
||||
|
||||
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Color;
|
||||
import android.os.Binder;
|
||||
import android.os.Bundle;
|
||||
import android.os.Debug;
|
||||
import android.system.Os;
|
||||
import android.view.View;
|
||||
|
||||
@@ -106,34 +101,8 @@ public class DebugTestInformationHandler extends TestInformationHandler {
|
||||
return response;
|
||||
}
|
||||
|
||||
case TestProtocol.REQUEST_TOTAL_PSS_KB: {
|
||||
case TestProtocol.REQUEST_FORCE_GC: {
|
||||
runGcAndFinalizersSync();
|
||||
Debug.MemoryInfo mem = new Debug.MemoryInfo();
|
||||
Debug.getMemoryInfo(mem);
|
||||
response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, mem.getTotalPss());
|
||||
return response;
|
||||
}
|
||||
|
||||
case TestProtocol.REQUEST_JAVA_LEAK: {
|
||||
if (sLeaks == null) sLeaks = new LinkedList();
|
||||
|
||||
// Allocate and dirty the memory.
|
||||
final int leakSize = 1024 * 1024;
|
||||
final byte[] bytes = new byte[leakSize];
|
||||
for (int i = 0; i < leakSize; i += 239) {
|
||||
bytes[i] = (byte) (i % 256);
|
||||
}
|
||||
sLeaks.add(bytes);
|
||||
return response;
|
||||
}
|
||||
|
||||
case TestProtocol.REQUEST_NATIVE_LEAK: {
|
||||
if (sLeaks == null) sLeaks = new LinkedList();
|
||||
|
||||
// Allocate and dirty a bitmap.
|
||||
final Bitmap bitmap = Bitmap.createBitmap(512, 512, ARGB_8888);
|
||||
bitmap.eraseColor(Color.RED);
|
||||
sLeaks.add(bitmap);
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user