1# JS API Changes of the Account Subsystem 2 3The table below lists the APIs changes of the account subsystem in OpenHarmony 3.1 Release over OpenHarmony 3.0 LTS. 4 5## API Changes 6 7| Module| Class| Method/Attribute/Enumeration/Constant| Change Type| 8|---|---|---|---| 9| ohos.account.osAccount | OsAccountType | GUEST | Added| 10| ohos.account.osAccount | OsAccountType | NORMAL | Added| 11| ohos.account.osAccount | OsAccountType | ADMIN = 0 | Added| 12| ohos.account.osAccount | DomainAccountInfo | accountName: string; | Added| 13| ohos.account.osAccount | DomainAccountInfo | domain: string; | Added| 14| ohos.account.osAccount | OsAccountInfo | domainInfo: DomainAccountInfo; | Added| 15| ohos.account.osAccount | OsAccountInfo | distributedInfo: distributedAccount.DistributedInfo; | Added| 16| ohos.account.osAccount | OsAccountInfo | isCreateCompleted: boolean; | Added| 17| ohos.account.osAccount | OsAccountInfo | isActived: boolean; | Added| 18| ohos.account.osAccount | OsAccountInfo | serialNumber: number; | Added| 19| ohos.account.osAccount | OsAccountInfo | lastLoginTime: number; | Added| 20| ohos.account.osAccount | OsAccountInfo | createTime: number; | Added| 21| ohos.account.osAccount | OsAccountInfo | photo: string; | Added| 22| ohos.account.osAccount | OsAccountInfo | isVerified: boolean; | Added| 23| ohos.account.osAccount | OsAccountInfo | constraints: Array\<string>; | Added| 24| ohos.account.osAccount | OsAccountInfo | type: OsAccountType; | Added| 25| ohos.account.osAccount | OsAccountInfo | localName: string; | Added| 26| ohos.account.osAccount | OsAccountInfo | localId: number; | Added| 27| ohos.account.osAccount | AccountManager | getSerialNumberByOsAccountLocalId(localId: number, callback: AsyncCallback\<number>): void;<br>getSerialNumberByOsAccountLocalId(localId: number): Promise\<number>; | Added| 28| ohos.account.osAccount | AccountManager | getOsAccountLocalIdBySerialNumber(serialNumber: number, callback: AsyncCallback\<number>): void;<br>getOsAccountLocalIdBySerialNumber(serialNumber: number): Promise\<number>; | Added| 29| ohos.account.osAccount | AccountManager | getDistributedVirtualDeviceId(callback: AsyncCallback\<string>): void;<br>getDistributedVirtualDeviceId(): Promise\<string>; | Added| 30| ohos.account.osAccount | AccountManager | getOsAccountTypeFromProcess(callback: AsyncCallback\<OsAccountType>): void;<br>getOsAccountTypeFromProcess(): Promise\<OsAccountType>; | Added| 31| ohos.account.osAccount | AccountManager | queryCurrentOsAccount(callback: AsyncCallback\<OsAccountInfo>): void;<br>queryCurrentOsAccount(): Promise\<OsAccountInfo>; | Added| 32| ohos.account.osAccount | AccountManager | queryActivatedOsAccountIds(callback: AsyncCallback\<Array\<number>>): void;<br>queryActivatedOsAccountIds(): Promise\<Array\<number>>; | Added| 33| ohos.account.osAccount | AccountManager | getOsAccountAllConstraints(localId: number, callback: AsyncCallback\<Array\<string>>): void;<br>getOsAccountAllConstraints(localId: number): Promise\<Array\<string>>; | Added| 34| ohos.account.osAccount | AccountManager | getOsAccountLocalIdFromDomain(domainInfo: DomainAccountInfo, callback: AsyncCallback\<number>): void;<br>getOsAccountLocalIdFromDomain(domainInfo: DomainAccountInfo): Promise\<number>; | Added| 35| ohos.account.osAccount | AccountManager | getOsAccountLocalIdFromUid(uid: number, callback: AsyncCallback\<number>): void;<br>getOsAccountLocalIdFromUid(uid: number): Promise\<number>; | Added| 36| ohos.account.osAccount | AccountManager | getOsAccountLocalIdFromProcess(callback: AsyncCallback\<number>): void;<br>getOsAccountLocalIdFromProcess(): Promise\<number>; | Added| 37| ohos.account.osAccount | AccountManager | getCreatedOsAccountsCount(callback: AsyncCallback\<number>): void;<br>getCreatedOsAccountsCount(): Promise\<number>; | Added| 38| ohos.account.osAccount | AccountManager | isOsAccountVerified(callback: AsyncCallback\<boolean>): void;<br>isOsAccountVerified(localId: number, callback: AsyncCallback\<boolean>): void;<br>isOsAccountVerified(localId?: number): Promise\<boolean>; | Added| 39| ohos.account.osAccount | AccountManager | isTestOsAccount(callback: AsyncCallback\<boolean>): void;<br>isTestOsAccount(): Promise\<boolean>; | Added| 40| ohos.account.osAccount | AccountManager | isOsAccountConstraintEnable(localId: number, constraint: string, callback: AsyncCallback\<boolean>): void;<br>isOsAccountConstraintEnable(localId: number, constraint: string): Promise\<boolean>; | Added| 41| ohos.account.osAccount | AccountManager | isOsAccountActived(localId: number, callback: AsyncCallback\<boolean>): void;<br>isOsAccountActived(localId: number): Promise\<boolean>; | Added| 42| ohos.account.osAccount | AccountManager | isMultiOsAccountEnable(callback: AsyncCallback\<boolean>): void;<br>isMultiOsAccountEnable(): Promise\<boolean>; | Added| 43| ohos.account.osAccount | osAccount | getAccountManager(): AccountManager; | Added| 44| ohos.account.appAccount | Authenticator | authenticate(name: string, authType: string, callerBundleName: string, options: {[key: string]: any}, callback: AuthenticatorCallback): void; | Added| 45| ohos.account.appAccount | Authenticator | addAccountImplicitly(authType: string, callerBundleName: string, options: {[key: string]: any}, callback: AuthenticatorCallback): void; | Added| 46| ohos.account.appAccount | AuthenticatorCallback | onRequestRedirected: (request: Want) => void; | Added| 47| ohos.account.appAccount | AuthenticatorCallback | onResult: (code: number, result: {[key: string]: any}) => void; | Added| 48| ohos.account.appAccount | ResultCode | ERROR_PERMISSION_DENIED = 10018 | Added| 49| ohos.account.appAccount | ResultCode | ERROR_OAUTH_UNSUPPORT_AUTH_TYPE = 10017 | Added| 50| ohos.account.appAccount | ResultCode | ERROR_OAUTH_UNSUPPORT_ACTION = 10016 | Added| 51| ohos.account.appAccount | ResultCode | ERROR_OAUTH_TOKEN_TOO_MANY = 10015 | Added| 52| ohos.account.appAccount | ResultCode | ERROR_OAUTH_TOKEN_NOT_EXIST = 10014 | Added| 53| ohos.account.appAccount | ResultCode | ERROR_OAUTH_TIMEOUT = 10013 | Added| 54| ohos.account.appAccount | ResultCode | ERROR_OAUTH_SESSION_NOT_EXIST = 10012 | Added| 55| ohos.account.appAccount | ResultCode | ERROR_OAUTH_SERVICE_EXCEPTION = 10011 | Added| 56| ohos.account.appAccount | ResultCode | ERROR_OAUTH_SERVICE_BUSY = 10010 | Added| 57| ohos.account.appAccount | ResultCode | ERROR_OAUTH_LIST_TOO_LARGE = 10009 | Added| 58| ohos.account.appAccount | ResultCode | ERROR_OAUTH_CANCELED = 10008 | Added| 59| ohos.account.appAccount | ResultCode | ERROR_OAUTH_AUTHENTICATOR_NOT_EXIST = 10007 | Added| 60| ohos.account.appAccount | ResultCode | ERROR_NETWORK_EXCEPTION = 10006 | Added| 61| ohos.account.appAccount | ResultCode | ERROR_INVALID_RESPONSE = 10005 | Added| 62| ohos.account.appAccount | ResultCode | ERROR_INVALID_REQUEST = 10004 | Added| 63| ohos.account.appAccount | ResultCode | ERROR_INVALID_PASSWORD = 10003 | Added| 64| ohos.account.appAccount | ResultCode | ERROR_APP_ACCOUNT_SERVICE_EXCEPTION = 10002 | Added| 65| ohos.account.appAccount | ResultCode | ERROR_ACCOUNT_NOT_EXIST = 10001 | Added| 66| ohos.account.appAccount | ResultCode | SUCCESS = 0 | Added| 67| ohos.account.appAccount | Constants | KEY_CALLER_BUNDLE_NAME = "callerBundleName" | Added| 68| ohos.account.appAccount | Constants | KEY_CALLER_UID = "callerUid" | Added| 69| ohos.account.appAccount | Constants | KEY_CALLER_PID = "callerPid" | Added| 70| ohos.account.appAccount | Constants | KEY_SESSION_ID = "sessionId" | Added| 71| ohos.account.appAccount | Constants | KEY_AUTH_TYPE = "authType" | Added| 72| ohos.account.appAccount | Constants | KEY_ACTION = "action" | Added| 73| ohos.account.appAccount | Constants | KEY_TOKEN = "token" | Added| 74| ohos.account.appAccount | Constants | KEY_OWNER = "owner" | Added| 75| ohos.account.appAccount | Constants | KEY_NAME = "name" | Added| 76| ohos.account.appAccount | Constants | ACTION_AUTHENTICATE = "authenticate" | Added| 77| ohos.account.appAccount | Constants | ACTION_ADD_ACCOUNT_IMPLICITLY = "addAccountImplicitly" | Added| 78| ohos.account.appAccount | AuthenticatorInfo | labelId: number; | Added| 79| ohos.account.appAccount | AuthenticatorInfo | iconId: number; | Added| 80| ohos.account.appAccount | AuthenticatorInfo | owner: string; | Added| 81| ohos.account.appAccount | OAuthTokenInfo | token: string; | Added| 82| ohos.account.appAccount | OAuthTokenInfo | authType: string; | Added| 83| ohos.account.appAccount | AppAccountInfo | name: string; | Added| 84| ohos.account.appAccount | AppAccountInfo | owner: string; | Added| 85| ohos.account.appAccount | AppAccountManager | getAuthenticatorInfo(owner: string, callback: AsyncCallback\<AuthenticatorInfo>): void;<br>getAuthenticatorInfo(owner: string): Promise\<AuthenticatorInfo>; | Added| 86| ohos.account.appAccount | AppAccountManager | getAuthenticatorCallback(sessionId: string, callback: AsyncCallback\<AuthenticatorCallback>): void;<br>getAuthenticatorCallback(sessionId: string): Promise\<AuthenticatorCallback>; | Added| 87| ohos.account.appAccount | AppAccountManager | getOAuthList(name: string, authType: string, callback: AsyncCallback\<Array\<string>>): void;<br>getOAuthList(name: string, authType: string): Promise\<Array\<string>>; | Added| 88| ohos.account.appAccount | AppAccountManager | getAllOAuthTokens(name: string, owner: string, callback: AsyncCallback\<Array\<OAuthTokenInfo>>): void;<br>getAllOAuthTokens(name: string, owner: string): Promise\<Array\<OAuthTokenInfo>>; | Added| 89| ohos.account.appAccount | AppAccountManager | checkOAuthTokenVisibility(name: string, authType: string, bundleName: string, callback: AsyncCallback\<boolean>): void;<br>checkOAuthTokenVisibility(name: string, authType: string, bundleName: string): Promise\<boolean>; | Added| 90| ohos.account.appAccount | AppAccountManager | setOAuthTokenVisibility(name: string, authType: string, bundleName: string, isVisible: boolean, callback: AsyncCallback\<void>): void;<br>setOAuthTokenVisibility(name: string, authType: string, bundleName: string, isVisible: boolean): Promise\<void>; | Added| 91| ohos.account.appAccount | AppAccountManager | deleteOAuthToken(name: string, owner: string, authType: string, token: string, callback: AsyncCallback\<void>): void;<br>deleteOAuthToken(name: string, owner: string, authType: string, token: string): Promise\<void>; | Added| 92| ohos.account.appAccount | AppAccountManager | setOAuthToken(name: string, authType: string, token: string, callback: AsyncCallback\<void>): void;<br>setOAuthToken(name: string, authType: string, token: string): Promise\<void>; | Added| 93| ohos.account.appAccount | AppAccountManager | getOAuthToken(name: string, owner: string, authType: string, callback: AsyncCallback\<string>): void;<br>getOAuthToken(name: string, owner: string, authType: string): Promise\<string>; | Added| 94| ohos.account.appAccount | AppAccountManager | authenticate(name: string, owner: string, authType: string, options: {[key: string]: any}, callback: AuthenticatorCallback): void; | Added| 95| ohos.account.appAccount | AppAccountManager | off(type: 'change', callback?: Callback\<Array\<AppAccountInfo>>): void; | Added| 96| ohos.account.appAccount | AppAccountManager | on(type: 'change', owners: Array\<string>, callback: Callback\<Array\<AppAccountInfo>>): void; | Added| 97| ohos.account.appAccount | AppAccountManager | getAssociatedData(name: string, key: string, callback: AsyncCallback\<string>): void;<br>getAssociatedData(name: string, key: string): Promise\<string>; | Added| 98| ohos.account.appAccount | AppAccountManager | getAccountExtraInfo(name: string, callback: AsyncCallback\<string>): void;<br>getAccountExtraInfo(name: string): Promise\<string>; | Added| 99| ohos.account.appAccount | AppAccountManager | getAccountCredential(name: string, credentialType: string, callback: AsyncCallback\<string>): void;<br>getAccountCredential(name: string, credentialType: string): Promise\<string>; | Added| 100| ohos.account.appAccount | AppAccountManager | getAllAccounts(owner: string, callback: AsyncCallback\<Array\<AppAccountInfo>>): void;<br>getAllAccounts(owner: string): Promise\<Array\<AppAccountInfo>>; | Added| 101| ohos.account.appAccount | AppAccountManager | getAllAccessibleAccounts(callback: AsyncCallback\<Array\<AppAccountInfo>>): void;<br>getAllAccessibleAccounts(): Promise\<Array\<AppAccountInfo>>; | Added| 102| ohos.account.appAccount | AppAccountManager | setAssociatedData(name: string, key: string, value: string, callback: AsyncCallback\<void>): void;<br>setAssociatedData(name: string, key: string, value: string): Promise\<void>; | Added| 103| ohos.account.appAccount | AppAccountManager | setAppAccountSyncEnable(name: string, isEnable: boolean, callback: AsyncCallback\<void>): void;<br>setAppAccountSyncEnable(name: string, isEnable: boolean): Promise\<void>; | Added| 104| ohos.account.appAccount | AppAccountManager | setAccountExtraInfo(name: string, extraInfo: string, callback: AsyncCallback\<void>): void;<br>setAccountExtraInfo(name: string, extraInfo: string): Promise\<void>; | Added| 105| ohos.account.appAccount | AppAccountManager | setAccountCredential(name: string, credentialType: string, credential: string, callback: AsyncCallback\<void>): void;<br>setAccountCredential(name: string, credentialType: string, credential: string): Promise\<void>; | Added| 106| ohos.account.appAccount | AppAccountManager | checkAppAccountSyncEnable(name: string, callback: AsyncCallback\<boolean>): void;<br>checkAppAccountSyncEnable(name: string): Promise\<boolean>; | Added| 107| ohos.account.appAccount | AppAccountManager | enableAppAccess(name: string, bundleName: string, callback: AsyncCallback\<void>): void;<br>enableAppAccess(name: string, bundleName: string): Promise\<void>; | Added| 108| ohos.account.appAccount | AppAccountManager | disableAppAccess(name: string, bundleName: string, callback: AsyncCallback\<void>): void;<br>disableAppAccess(name: string, bundleName: string): Promise\<void>; | Added| 109| ohos.account.appAccount | AppAccountManager | deleteAccount(name: string, callback: AsyncCallback\<void>): void;<br>deleteAccount(name: string): Promise\<void>; | Added| 110| ohos.account.appAccount | AppAccountManager | addAccountImplicitly(owner: string, authType: string, options: {[key: string]: any}, callback: AuthenticatorCallback): void; | Added| 111| ohos.account.appAccount | AppAccountManager | addAccount(name: string, callback: AsyncCallback\<void>): void;<br>addAccount(name: string, extraInfo: string, callback: AsyncCallback\<void>): void;<br>addAccount(name: string, extraInfo?: string): Promise\<void>; | Added| 112| ohos.account.appAccount | appAccount | createAppAccountManager(): AppAccountManager; | Added| 113