Search in sources :

Example 11 with AuthenticatorHelper

use of com.android.settingslib.accounts.AuthenticatorHelper in project android_packages_apps_Settings by DirtyUnicorns.

the class AccountDetailDashboardFragment method updateUi.

@VisibleForTesting
void updateUi() {
    final Context context = getContext();
    UserHandle userHandle = null;
    Bundle args = getArguments();
    if (args != null && args.containsKey(KEY_USER_HANDLE)) {
        userHandle = args.getParcelable(KEY_USER_HANDLE);
    }
    final AuthenticatorHelper helper = new AuthenticatorHelper(context, userHandle, null);
    final AccountTypePreferenceLoader accountTypePreferenceLoader = new AccountTypePreferenceLoader(this, helper, userHandle);
    PreferenceScreen prefs = accountTypePreferenceLoader.addPreferencesForType(mAccountType, getPreferenceScreen());
    if (prefs != null) {
        accountTypePreferenceLoader.updatePreferenceIntents(prefs, mAccountType, mAccount);
    }
}
Also used : Context(android.content.Context) AuthenticatorHelper(com.android.settingslib.accounts.AuthenticatorHelper) PreferenceScreen(android.support.v7.preference.PreferenceScreen) Bundle(android.os.Bundle) UserHandle(android.os.UserHandle) VisibleForTesting(android.support.annotation.VisibleForTesting)

Example 12 with AuthenticatorHelper

use of com.android.settingslib.accounts.AuthenticatorHelper in project android_packages_apps_Settings by DirtyUnicorns.

the class AccountSyncPreferenceController method init.

public void init(Account account, UserHandle userHandle) {
    mAccount = account;
    mUserHandle = userHandle;
    mAuthenticatorHelper = new AuthenticatorHelper(mContext, mUserHandle, this);
}
Also used : AuthenticatorHelper(com.android.settingslib.accounts.AuthenticatorHelper)

Example 13 with AuthenticatorHelper

use of com.android.settingslib.accounts.AuthenticatorHelper in project android_packages_apps_Settings by DirtyUnicorns.

the class AccountHeaderPreferenceController method onResume.

@Override
public void onResume() {
    final AuthenticatorHelper helper = new AuthenticatorHelper(mContext, mUserHandle, null);
    EntityHeaderController.newInstance(mActivity, mHost, mHeaderPreference.findViewById(R.id.entity_header)).setLabel(mAccount.name).setIcon(helper.getDrawableForType(mContext, mAccount.type)).done(mActivity, true);
}
Also used : AuthenticatorHelper(com.android.settingslib.accounts.AuthenticatorHelper)

Example 14 with AuthenticatorHelper

use of com.android.settingslib.accounts.AuthenticatorHelper in project platform_packages_apps_Settings by BlissRoms.

the class AccountSyncPreferenceController method init.

public void init(Account account, UserHandle userHandle) {
    mAccount = account;
    mUserHandle = userHandle;
    mAuthenticatorHelper = new AuthenticatorHelper(mContext, mUserHandle, this);
}
Also used : AuthenticatorHelper(com.android.settingslib.accounts.AuthenticatorHelper)

Example 15 with AuthenticatorHelper

use of com.android.settingslib.accounts.AuthenticatorHelper in project platform_packages_apps_Settings by BlissRoms.

the class AccountPreferenceBase method onCreate.

@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    mUm = (UserManager) getSystemService(Context.USER_SERVICE);
    final Activity activity = getActivity();
    mUserHandle = Utils.getSecureTargetUser(activity.getActivityToken(), mUm, getArguments(), activity.getIntent().getExtras());
    mAuthenticatorHelper = new AuthenticatorHelper(activity, mUserHandle, this);
    mAccountTypePreferenceLoader = new AccountTypePreferenceLoader(this, mAuthenticatorHelper, mUserHandle);
}
Also used : AuthenticatorHelper(com.android.settingslib.accounts.AuthenticatorHelper) Activity(android.app.Activity)

Aggregations

AuthenticatorHelper (com.android.settingslib.accounts.AuthenticatorHelper)43 Context (android.content.Context)15 PreferenceScreen (android.support.v7.preference.PreferenceScreen)10 AccessiblePreferenceCategory (com.android.settings.AccessiblePreferenceCategory)8 Account (android.accounts.Account)7 Activity (android.app.Activity)7 Bundle (android.os.Bundle)7 UserHandle (android.os.UserHandle)7 Before (org.junit.Before)7 ShadowApplication (org.robolectric.shadows.ShadowApplication)7 VisibleForTesting (android.support.annotation.VisibleForTesting)5 SearchFeatureProviderImpl (com.android.settings.search.SearchFeatureProviderImpl)5 PreferenceScreen (androidx.preference.PreferenceScreen)4 VisibleForTesting (androidx.annotation.VisibleForTesting)2 BidiFormatter (android.text.BidiFormatter)1 ArrayList (java.util.ArrayList)1