From 08d34b6a99e98eb278bca42ce126808859c922b7 Mon Sep 17 00:00:00 2001 From: Doris Ling Date: Wed, 13 Jul 2016 12:56:18 -0700 Subject: [PATCH] Revert equal check in DashboardAdapter.setCondition(). 1. Remove the equality check for the conditions list which causes "Airplane mode is on" to be shown always even when airplane mode is turned off. 2. Also add mIsShowingAll and mSuggestionMode to instance state. Bug: 30055644 Change-Id: I0709e9a1b0139e80cdb834cb76a9334dce753e14 --- .../settings/dashboard/DashboardAdapter.java | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/com/android/settings/dashboard/DashboardAdapter.java b/src/com/android/settings/dashboard/DashboardAdapter.java index b49bb7b4459..b161c4151e1 100644 --- a/src/com/android/settings/dashboard/DashboardAdapter.java +++ b/src/com/android/settings/dashboard/DashboardAdapter.java @@ -53,6 +53,8 @@ public class DashboardAdapter extends RecyclerView.Adapter getSuggestions() { @@ -149,10 +155,8 @@ public class DashboardAdapter extends RecyclerView.Adapter conditions) { - if (!Objects.equals(mConditions, conditions)) { - mConditions = conditions; - recountItems(); - } + mConditions = conditions; + recountItems(); } public boolean isShowingAll() { @@ -441,9 +445,16 @@ public class DashboardAdapter extends RecyclerView.Adapter(mSuggestions)); - outState.putParcelableArrayList(STATE_CATEGORY_LIST, - new ArrayList(mCategories)); + if (mSuggestions != null) { + outState.putParcelableArrayList(STATE_SUGGESTION_LIST, + new ArrayList(mSuggestions)); + } + if (mCategories != null) { + outState.putParcelableArrayList(STATE_CATEGORY_LIST, + new ArrayList(mCategories)); + } + outState.putBoolean(STATE_IS_SHOWING_ALL, mIsShowingAll); + outState.putInt(STATE_SUGGESTION_MODE, mSuggestionMode); } private static class IconCache {