From 1740ce4f0ca39635eeb8a286bc271dd11438ff09 Mon Sep 17 00:00:00 2001 From: Julia Reynolds Date: Mon, 27 Jul 2015 16:00:06 -0400 Subject: [PATCH] Hide usage graph on app usage details pages. Also make the back button work properly on these pages. Bug: 22691655 Change-Id: Icb4d7730cfe5a89ffada0489a69e646cddff5560 --- src/com/android/settings/DataUsageSummary.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/DataUsageSummary.java b/src/com/android/settings/DataUsageSummary.java index 7a5a60aac0d..e0144656bef 100644 --- a/src/com/android/settings/DataUsageSummary.java +++ b/src/com/android/settings/DataUsageSummary.java @@ -485,7 +485,7 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable // a header at the top. FrameLayout pinnedHeader = (FrameLayout) rootView.findViewById(R.id.pinned_header); AppHeader.createAppHeader(getActivity(), detail.icon, detail.label, null, pinnedHeader); - AppDetailsFragment.show(DataUsageSummary.this, app, detail.label, false); + AppDetailsFragment.show(DataUsageSummary.this, app, detail.label, true); } catch (NameNotFoundException e) { Log.w(TAG, "Could not find " + mShowAppImmediatePkg, e); Toast.makeText(getActivity(), getString(R.string.unknown_app), Toast.LENGTH_LONG) @@ -936,9 +936,11 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable if (isAppDetailMode()) { mAppDetail.setVisibility(View.VISIBLE); mCycleAdapter.setChangeVisible(false); + mChart.setVisibility(View.GONE); } else { mAppDetail.setVisibility(View.GONE); mCycleAdapter.setChangeVisible(true); + mChart.setVisibility(View.VISIBLE); // hide detail stats when not in detail mode mChart.bindDetailNetworkStats(null); @@ -1998,6 +2000,16 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable target.mCurrentApp = null; target.updateBody(); } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case android.R.id.home: + getFragmentManager().popBackStack(); + return true; + } + return super.onOptionsItemSelected(item); + } } /**