Loading res/xml/app_and_notification.xml +5 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,11 @@ </Preference> </PreferenceCategory> <!-- Empty category to draw divider --> <PreferenceCategory android:key="all_app_info_divider" android:order="-190"/> <Preference android:key="manage_perms" android:title="@string/app_permissions" Loading src/com/android/settings/applications/AppAndNotificationDashboardFragment.java +1 −1 Original line number Diff line number Diff line Loading @@ -50,7 +50,7 @@ public class AppAndNotificationDashboardFragment extends DashboardFragment { @Override public void onAttach(Context context) { super.onAttach(context); mProgressiveDisclosureMixin.setTileLimit(3); mProgressiveDisclosureMixin.setTileLimit(4); } @Override Loading src/com/android/settings/applications/RecentAppsPreferenceController.java +7 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,8 @@ public class RecentAppsPreferenceController extends PreferenceController private static final String TAG = "RecentAppsCtrl"; private static final String KEY_PREF_CATEGORY = "recent_apps_category"; @VisibleForTesting static final String KEY_DIVIDER = "all_app_info_divider"; @VisibleForTesting static final String KEY_SEE_ALL = "all_app_info"; private static final int SHOW_RECENT_APP_COUNT = 5; private static final Set<String> SKIP_SYSTEM_PACKAGES = new ArraySet<>(); Loading @@ -78,6 +80,7 @@ public class RecentAppsPreferenceController extends PreferenceController private PreferenceCategory mCategory; private Preference mSeeAllPref; private Preference mDivider; private boolean mHasRecentApps; static { Loading Loading @@ -122,12 +125,14 @@ public class RecentAppsPreferenceController extends PreferenceController super.updateNonIndexableKeys(keys); // Don't index category name into search. It's not actionable. keys.add(KEY_PREF_CATEGORY); keys.add(KEY_DIVIDER); } @Override public void displayPreference(PreferenceScreen screen) { mCategory = (PreferenceCategory) screen.findPreference(getPreferenceKey()); mSeeAllPref = screen.findPreference(KEY_SEE_ALL); mDivider = screen.findPreference(KEY_DIVIDER); super.displayPreference(screen); refreshUi(mCategory.getContext()); } Loading Loading @@ -181,6 +186,7 @@ public class RecentAppsPreferenceController extends PreferenceController private void displayOnlyAppInfo() { mCategory.setTitle(null); mDivider.setVisible(false); mSeeAllPref.setTitle(R.string.applications_settings); mSeeAllPref.setIcon(null); int prefCount = mCategory.getPreferenceCount(); Loading @@ -194,6 +200,7 @@ public class RecentAppsPreferenceController extends PreferenceController private void displayRecentApps(Context prefContext, List<UsageStats> recentApps) { mCategory.setTitle(R.string.recent_app_category_title); mDivider.setVisible(true); mSeeAllPref.setSummary(null); mSeeAllPref.setIcon(R.drawable.ic_chevron_right_24dp); Loading tests/robotests/src/com/android/settings/applications/RecentAppsPreferenceControllerTest.java +8 −1 Original line number Diff line number Diff line Loading @@ -72,6 +72,8 @@ public class RecentAppsPreferenceControllerTest { private PreferenceCategory mCategory; @Mock private Preference mSeeAllPref; @Mock private PreferenceCategory mDivider; @Mock(answer = Answers.RETURNS_DEEP_STUBS) private Context mMockContext; @Mock Loading @@ -98,6 +100,8 @@ public class RecentAppsPreferenceControllerTest { when(mScreen.findPreference(RecentAppsPreferenceController.KEY_SEE_ALL)) .thenReturn(mSeeAllPref); when(mScreen.findPreference(RecentAppsPreferenceController.KEY_DIVIDER)) .thenReturn(mDivider); when(mCategory.getContext()).thenReturn(mContext); } Loading @@ -112,7 +116,8 @@ public class RecentAppsPreferenceControllerTest { mController.updateNonIndexableKeys(nonIndexable); assertThat(nonIndexable).containsExactly(mController.getPreferenceKey()); assertThat(nonIndexable).containsAllOf(mController.getPreferenceKey(), RecentAppsPreferenceController.KEY_DIVIDER); } @Test Loading Loading @@ -140,6 +145,7 @@ public class RecentAppsPreferenceControllerTest { verify(mCategory).setTitle(null); verify(mSeeAllPref).setTitle(R.string.applications_settings); verify(mSeeAllPref).setIcon(null); verify(mDivider).setVisible(false); } @Test Loading Loading @@ -186,6 +192,7 @@ public class RecentAppsPreferenceControllerTest { verify(mSeeAllPref).setSummary(null); verify(mSeeAllPref).setIcon(R.drawable.ic_chevron_right_24dp); verify(mDivider).setVisible(true); } @Test Loading Loading
res/xml/app_and_notification.xml +5 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,11 @@ </Preference> </PreferenceCategory> <!-- Empty category to draw divider --> <PreferenceCategory android:key="all_app_info_divider" android:order="-190"/> <Preference android:key="manage_perms" android:title="@string/app_permissions" Loading
src/com/android/settings/applications/AppAndNotificationDashboardFragment.java +1 −1 Original line number Diff line number Diff line Loading @@ -50,7 +50,7 @@ public class AppAndNotificationDashboardFragment extends DashboardFragment { @Override public void onAttach(Context context) { super.onAttach(context); mProgressiveDisclosureMixin.setTileLimit(3); mProgressiveDisclosureMixin.setTileLimit(4); } @Override Loading
src/com/android/settings/applications/RecentAppsPreferenceController.java +7 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,8 @@ public class RecentAppsPreferenceController extends PreferenceController private static final String TAG = "RecentAppsCtrl"; private static final String KEY_PREF_CATEGORY = "recent_apps_category"; @VisibleForTesting static final String KEY_DIVIDER = "all_app_info_divider"; @VisibleForTesting static final String KEY_SEE_ALL = "all_app_info"; private static final int SHOW_RECENT_APP_COUNT = 5; private static final Set<String> SKIP_SYSTEM_PACKAGES = new ArraySet<>(); Loading @@ -78,6 +80,7 @@ public class RecentAppsPreferenceController extends PreferenceController private PreferenceCategory mCategory; private Preference mSeeAllPref; private Preference mDivider; private boolean mHasRecentApps; static { Loading Loading @@ -122,12 +125,14 @@ public class RecentAppsPreferenceController extends PreferenceController super.updateNonIndexableKeys(keys); // Don't index category name into search. It's not actionable. keys.add(KEY_PREF_CATEGORY); keys.add(KEY_DIVIDER); } @Override public void displayPreference(PreferenceScreen screen) { mCategory = (PreferenceCategory) screen.findPreference(getPreferenceKey()); mSeeAllPref = screen.findPreference(KEY_SEE_ALL); mDivider = screen.findPreference(KEY_DIVIDER); super.displayPreference(screen); refreshUi(mCategory.getContext()); } Loading Loading @@ -181,6 +186,7 @@ public class RecentAppsPreferenceController extends PreferenceController private void displayOnlyAppInfo() { mCategory.setTitle(null); mDivider.setVisible(false); mSeeAllPref.setTitle(R.string.applications_settings); mSeeAllPref.setIcon(null); int prefCount = mCategory.getPreferenceCount(); Loading @@ -194,6 +200,7 @@ public class RecentAppsPreferenceController extends PreferenceController private void displayRecentApps(Context prefContext, List<UsageStats> recentApps) { mCategory.setTitle(R.string.recent_app_category_title); mDivider.setVisible(true); mSeeAllPref.setSummary(null); mSeeAllPref.setIcon(R.drawable.ic_chevron_right_24dp); Loading
tests/robotests/src/com/android/settings/applications/RecentAppsPreferenceControllerTest.java +8 −1 Original line number Diff line number Diff line Loading @@ -72,6 +72,8 @@ public class RecentAppsPreferenceControllerTest { private PreferenceCategory mCategory; @Mock private Preference mSeeAllPref; @Mock private PreferenceCategory mDivider; @Mock(answer = Answers.RETURNS_DEEP_STUBS) private Context mMockContext; @Mock Loading @@ -98,6 +100,8 @@ public class RecentAppsPreferenceControllerTest { when(mScreen.findPreference(RecentAppsPreferenceController.KEY_SEE_ALL)) .thenReturn(mSeeAllPref); when(mScreen.findPreference(RecentAppsPreferenceController.KEY_DIVIDER)) .thenReturn(mDivider); when(mCategory.getContext()).thenReturn(mContext); } Loading @@ -112,7 +116,8 @@ public class RecentAppsPreferenceControllerTest { mController.updateNonIndexableKeys(nonIndexable); assertThat(nonIndexable).containsExactly(mController.getPreferenceKey()); assertThat(nonIndexable).containsAllOf(mController.getPreferenceKey(), RecentAppsPreferenceController.KEY_DIVIDER); } @Test Loading Loading @@ -140,6 +145,7 @@ public class RecentAppsPreferenceControllerTest { verify(mCategory).setTitle(null); verify(mSeeAllPref).setTitle(R.string.applications_settings); verify(mSeeAllPref).setIcon(null); verify(mDivider).setVisible(false); } @Test Loading Loading @@ -186,6 +192,7 @@ public class RecentAppsPreferenceControllerTest { verify(mSeeAllPref).setSummary(null); verify(mSeeAllPref).setIcon(R.drawable.ic_chevron_right_24dp); verify(mDivider).setVisible(true); } @Test Loading