use of com.android.settings.accounts.AccountFeatureProvider in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class BrandedAccountPreferenceController method displayPreference.
@Override
public void displayPreference(PreferenceScreen screen) {
super.displayPreference(screen);
final AccountFeatureProvider accountFeatureProvider = FeatureFactory.getFactory(mContext).getAccountFeatureProvider();
final Preference accountPreference = screen.findPreference(getPreferenceKey());
if (accountPreference != null && (mAccounts == null || mAccounts.length == 0)) {
screen.removePreference(accountPreference);
return;
}
accountPreference.setSummary(mAccounts[0].name);
accountPreference.setOnPreferenceClickListener(preference -> {
final Bundle args = new Bundle();
args.putParcelable(AccountDetailDashboardFragment.KEY_ACCOUNT, mAccounts[0]);
args.putParcelable(AccountDetailDashboardFragment.KEY_USER_HANDLE, android.os.Process.myUserHandle());
args.putString(AccountDetailDashboardFragment.KEY_ACCOUNT_TYPE, accountFeatureProvider.getAccountType());
new SubSettingLauncher(mContext).setDestination(AccountDetailDashboardFragment.class.getName()).setTitleRes(R.string.account_sync_title).setArguments(args).setSourceMetricsCategory(SettingsEnums.DEVICEINFO).launch();
return true;
});
}
Aggregations