mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 10:48:19 +00:00
resolve merge conflicts of a24ed7267c to ub-launcher3-qt-future-dev
Bug: None Test: I solemnly swear I tested this conflict resolution. Change-Id: I89f3bcf309b10a359b12167474fcb3f93640787f
This commit is contained in:
@@ -16,8 +16,11 @@
|
||||
package com.android.launcher3.testing;
|
||||
|
||||
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
|
||||
import static android.graphics.Bitmap.Config.ARGB_8888;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.os.Debug;
|
||||
|
||||
@@ -30,6 +33,7 @@ import com.android.launcher3.R;
|
||||
import com.android.launcher3.allapps.AllAppsStore;
|
||||
import com.android.launcher3.util.ResourceBasedOverride;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
public class TestInformationHandler implements ResourceBasedOverride {
|
||||
@@ -43,6 +47,7 @@ public class TestInformationHandler implements ResourceBasedOverride {
|
||||
protected DeviceProfile mDeviceProfile;
|
||||
protected LauncherAppState mLauncherAppState;
|
||||
protected Launcher mLauncher;
|
||||
private static LinkedList mLeaks;
|
||||
|
||||
public void init(Context context) {
|
||||
mContext = context;
|
||||
@@ -121,7 +126,30 @@ public class TestInformationHandler implements ResourceBasedOverride {
|
||||
response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, mem.getTotalPss());
|
||||
break;
|
||||
}
|
||||
|
||||
case TestProtocol.REQUEST_JAVA_LEAK: {
|
||||
if (mLeaks == null) mLeaks = 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);
|
||||
}
|
||||
mLeaks.add(bytes);
|
||||
break;
|
||||
}
|
||||
|
||||
case TestProtocol.REQUEST_NATIVE_LEAK: {
|
||||
if (mLeaks == null) mLeaks = new LinkedList();
|
||||
|
||||
// Allocate and dirty a bitmap.
|
||||
final Bitmap bitmap = Bitmap.createBitmap(512, 512, ARGB_8888);
|
||||
bitmap.eraseColor(Color.RED);
|
||||
mLeaks.add(bitmap);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return response;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user