Share via


AccountManager.GetAccountVisibility(Account, String) Method

Definition

Get visibility of certain account for given application.

[Android.Runtime.Register("getAccountVisibility", "(Landroid/accounts/Account;Ljava/lang/String;)I", "GetGetAccountVisibility_Landroid_accounts_Account_Ljava_lang_String_Handler", ApiSince=26)]
public virtual Android.Accounts.AccountVisibility GetAccountVisibility (Android.Accounts.Account? account, string? packageName);
[<Android.Runtime.Register("getAccountVisibility", "(Landroid/accounts/Account;Ljava/lang/String;)I", "GetGetAccountVisibility_Landroid_accounts_Account_Ljava_lang_String_Handler", ApiSince=26)>]
abstract member GetAccountVisibility : Android.Accounts.Account * string -> Android.Accounts.AccountVisibility
override this.GetAccountVisibility : Android.Accounts.Account * string -> Android.Accounts.AccountVisibility

Parameters

account
Account

Account to get visibility

packageName
String

Package name of the application to get account visibility

Returns

int Visibility of given account. For the caller targeting API level 34 and above, #VISIBILITY_NOT_VISIBLE is returned if the given package is filtered by the rules of package visibility.

Attributes

Remarks

Get visibility of certain account for given application. Possible returned values are: <ul> <li>#VISIBILITY_VISIBLE</li> <li>#VISIBILITY_USER_MANAGED_VISIBLE</li> <li>#VISIBILITY_NOT_VISIBLE<li>#VISIBILITY_USER_MANAGED_NOT_VISIBLE</li> </ul>

This method requires the caller to have a signature match with the authenticator that owns the specified account.

Java documentation for android.accounts.AccountManager.getAccountVisibility(android.accounts.Account, java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to