Update all preferences when the account preference updates UI

When an account is added or removed, the account preference controller
just updates the account list, whereas there's no trigger point for the
account data sync preferences to refresh.

Add an API to update all preferences in DashboardFragment, so we can
refresh the account sync preferences whenever the account list is
updated.

Bug: 185479221
Test: robotest, manual
Change-Id: Ide3d972abae09ce0175e3bafbb1f4a5e307d20c8
This commit is contained in:
Jason Chiu
2022-07-06 16:53:59 +08:00
parent f29e93bf9e
commit c89755525f
8 changed files with 47 additions and 14 deletions

View File

@@ -24,7 +24,6 @@ import android.app.settings.SettingsEnums;
import android.content.Context;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
import com.android.settings.applications.autofill.PasswordsPreferenceController;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.dashboard.profileselector.ProfileSelectFragment;
@@ -78,7 +77,7 @@ public class AccountWorkProfileDashboardFragment extends DashboardFragment {
}
private static void buildAccountPreferenceControllers(
Context context, SettingsPreferenceFragment parent, String[] authorities,
Context context, DashboardFragment parent, String[] authorities,
List<AbstractPreferenceController> controllers) {
final AccountPreferenceController accountPrefController =
new AccountPreferenceController(context, parent, authorities,