Make proc stats UI app-centric instead of process-centric.
The UI now shows a much simpler overview of memory use for the current measured duration, computing the weighted RAM user per application. (This is done basically by rolling up each individual process into an app that can contain multiple processes, and using the recently introduced weighted RAM for all data processing.) The details screen is updated to reflect this new design, showing an overview of a particular application, which separate entries for each process running for that app. Change-Id: I47d79c30086d733eb37440a6c21b18a92b767d01
This commit is contained in:
@@ -29,7 +29,7 @@ import com.android.settings.R;
|
||||
import com.android.settings.Utils;
|
||||
|
||||
public class ProcessStatsPreference extends Preference {
|
||||
private ProcStatsEntry mEntry;
|
||||
private ProcStatsPackageEntry mEntry;
|
||||
private int mProgress;
|
||||
private CharSequence mProgressText;
|
||||
|
||||
@@ -51,18 +51,19 @@ public class ProcessStatsPreference extends Preference {
|
||||
setLayoutResource(R.layout.preference_app_percentage);
|
||||
}
|
||||
|
||||
public void init(Drawable icon, ProcStatsEntry entry) {
|
||||
public void init(Drawable icon, ProcStatsPackageEntry entry) {
|
||||
mEntry = entry;
|
||||
setIcon(icon != null ? icon : new ColorDrawable(0));
|
||||
}
|
||||
|
||||
public ProcStatsEntry getEntry() {
|
||||
public ProcStatsPackageEntry getEntry() {
|
||||
return mEntry;
|
||||
}
|
||||
|
||||
public void setPercent(double percentOfWeight, double percentOfTime) {
|
||||
public void setPercent(double percentOfWeight, double percentOfTime, long memory) {
|
||||
mProgress = (int) Math.ceil(percentOfWeight);
|
||||
mProgressText = Utils.formatPercentage((int) percentOfTime);
|
||||
//mProgressText = Utils.formatPercentage((int) percentOfTime);
|
||||
mProgressText = Formatter.formatShortFileSize(getContext(), memory);
|
||||
notifyChanged();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user