More memory updates

- Some string changes
 - Make processes in memory details not clickable
 - Put processes in a 'detail' category
 - Hide processes when an app only has 1
 - Add memory item to bottom of app info page

Bug: 20694769
Change-Id: Ifbe2205aeef230e44752d075578524249b30bdf8
This commit is contained in:
Jason Monk
2015-05-27 12:58:21 -04:00
parent ecf4339bc7
commit ab2046aa76
8 changed files with 113 additions and 17 deletions

View File

@@ -18,14 +18,16 @@ package com.android.settings.applications;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ArrayAdapter;
import android.widget.Spinner;
import com.android.internal.app.ProcessStats;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
import com.android.settings.SettingsPreferenceFragment;
import com.android.settings.applications.ProcStatsData.MemInfo;
public abstract class ProcessStatsBase extends SettingsPreferenceFragment
implements OnItemSelectedListener {
@@ -124,4 +126,17 @@ public abstract class ProcessStatsBase extends SettingsPreferenceFragment
}
public abstract void refreshUi();
public static void launchMemoryDetail(SettingsActivity activity, MemInfo memInfo,
ProcStatsPackageEntry entry) {
Bundle args = new Bundle();
args.putParcelable(ProcessStatsDetail.EXTRA_PACKAGE_ENTRY, entry);
args.putDouble(ProcessStatsDetail.EXTRA_WEIGHT_TO_RAM, memInfo.weightToRam);
args.putLong(ProcessStatsDetail.EXTRA_TOTAL_TIME, memInfo.memTotalTime);
args.putDouble(ProcessStatsDetail.EXTRA_MAX_MEMORY_USAGE,
memInfo.usedWeight * memInfo.weightToRam);
args.putDouble(ProcessStatsDetail.EXTRA_TOTAL_SCALE, memInfo.totalScale);
activity.startPreferencePanel(ProcessStatsDetail.class.getName(), args,
R.string.memory_usage, null, null, 0);
}
}