Add account preference controller.

- Add account preference controller and move the handling for
displaying user's accounts from AccountSettings to the
controller.

- Move AccountPreference and RemoveUserFragment from inner class to
standalone class.

- Add AccountRestrictionHelper to handle API that needs to be mocked for
testing.

Bug: 31801423
Test: make RunSettingsRoboTests
Change-Id: I3d16d0b6a8922a8abec7037c52b7a4de2d76eb0d
This commit is contained in:
Doris Ling
2016-11-10 15:12:52 -08:00
parent 8a2e2fa2a7
commit bfac31b517
12 changed files with 1174 additions and 635 deletions

View File

@@ -76,6 +76,9 @@ public class DashboardDividerDecoration extends RecyclerView.ItemDecoration {
}
final PreferenceGroupAdapter prefAdapter = (PreferenceGroupAdapter) adapter;
final int adapterPosition = parent.getChildAdapterPosition(view);
if (adapterPosition == RecyclerView.NO_POSITION) {
return false;
}
final Preference pref = prefAdapter.getItem(adapterPosition);
final Preference nextPref = prefAdapter.getItem(adapterPosition + 1);
if (nextPref == null) {