mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 11:18:21 +00:00
Further MemoryTracker robustness:
- grab a copy of the tracked processes list in the dumper - scan running processes when memorytracker starts to catch pids that may have survived a crash of the tracker's process - use RunningServiceInfo to figure out roughly how long a service scanned in this way has been alive Change-Id: I861642f07183e3945f7a7a41e1e5144567e17e13
This commit is contained in:
@@ -28,6 +28,7 @@ import android.util.Log;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
@@ -85,7 +86,9 @@ public class MemoryDumpActivity extends Activity {
|
||||
final ArrayList<String> paths = new ArrayList<String>();
|
||||
final int myPid = android.os.Process.myPid();
|
||||
|
||||
for (int pid : tracker.getTrackedProcesses()) {
|
||||
final int[] pids_orig = tracker.getTrackedProcesses();
|
||||
final int[] pids_copy = Arrays.copyOf(pids_orig, pids_orig.length);
|
||||
for (int pid : pids_copy) {
|
||||
MemoryTracker.ProcessMemInfo info = tracker.getMemInfo(pid);
|
||||
if (info != null) {
|
||||
body.append("pid ").append(pid).append(":")
|
||||
|
||||
Reference in New Issue
Block a user