Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit be4e6aaa authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Initial super-primitive process tracker.

The goal of this is to keep track of what app processes
are doing, to determine who is being abusive, when the system
is getting into memory constrained situations, and help the
user determine how to resolve this.

Right now it doesn't really do any of that, just keeps track
of how long every process has been running since boot.

Also update the activity manager to use "cached" as the terminology
for what it used to interchangeably call hidden and background
processes, and switch ProcessMap over to using ArrayMap.

Change-Id: I270b0006aab1f38e17b7d9b65728679173c343f2
parent 2df80446
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -16,13 +16,12 @@

package com.android.server;

import android.util.ArrayMap;
import android.util.SparseArray;

import java.util.HashMap;

public class ProcessMap<E> {
    final HashMap<String, SparseArray<E>> mMap
            = new HashMap<String, SparseArray<E>>();
    final ArrayMap<String, SparseArray<E>> mMap
            = new ArrayMap<String, SparseArray<E>>();
    
    public E get(String name, int uid) {
        SparseArray<E> uids = mMap.get(name);
@@ -50,7 +49,7 @@ public class ProcessMap<E> {
        }
    }
    
    public HashMap<String, SparseArray<E>> getMap() {
    public ArrayMap<String, SparseArray<E>> getMap() {
        return mMap;
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ import android.util.Slog;
import android.util.SparseArray;
import android.util.TimeUtils;

public class ActiveServices {
public final class ActiveServices {
    static final boolean DEBUG_SERVICE = ActivityManagerService.DEBUG_SERVICE;
    static final boolean DEBUG_SERVICE_EXECUTING = ActivityManagerService.DEBUG_SERVICE_EXECUTING;
    static final boolean DEBUG_MU = ActivityManagerService.DEBUG_MU;
+263 −210

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ import android.os.Bundle;
/**
 * Pending result information to send back to an activity.
 */
class ActivityResult extends ResultInfo {
final class ActivityResult extends ResultInfo {
    final ActivityRecord mFrom;
    
    public ActivityResult(ActivityRecord from, String resultWho,
+1 −1
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;

public class ActivityStackSupervisor {
public final class ActivityStackSupervisor {
    static final boolean DEBUG = ActivityManagerService.DEBUG || false;
    static final boolean DEBUG_ADD_REMOVE = DEBUG || false;
    static final boolean DEBUG_APP = DEBUG || false;
Loading