diff --git a/en/application-dev/reference/apis/js-apis-osAccount.md b/en/application-dev/reference/apis/js-apis-osAccount.md index c7b8ecb87cca8ffe72417ca65c07086c8421fae1..94a4257dfcc0af730c79334f61473c4811cb3bfd 100644 --- a/en/application-dev/reference/apis/js-apis-osAccount.md +++ b/en/application-dev/reference/apis/js-apis-osAccount.md @@ -304,13 +304,13 @@ Checks whether an OS account is activated. This API uses a promise to return the } ``` -### checkConstraintEnabled9+ +### checkOsAccountConstraintEnabled9+ -checkConstraintEnabled(localId: number, constraint: string, callback: AsyncCallback<boolean>): void +checkOsAccountConstraintEnabled(localId: number, constraint: string, callback: AsyncCallback<boolean>): void Checks whether the specified constraint is enabled for an OS account. This API uses an asynchronous callback to return the result. -**Required permissions**: ohos.permission.MANAGE_LOCAL_ACCOUNTS +**Required permissions**: ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS **System capability**: SystemCapability.Account.OsAccount @@ -337,25 +337,25 @@ Checks whether the specified constraint is enabled for an OS account. This API u let localId = 100; let constraint = "constraint.wifi"; try { - accountManager.checkConstraintEnabled(localId, constraint, (err, isEnabled)=>{ + accountManager.checkOsAccountConstraintEnabled(localId, constraint, (err, isEnabled)=>{ if (err) { - console.log("checkConstraintEnabled failed, error: " + JSON.stringify(err)); + console.log("checkOsAccountConstraintEnabled failed, error: " + JSON.stringify(err)); } else { - console.log("checkConstraintEnabled successfully, isEnabled: " + isEnabled); + console.log("checkOsAccountConstraintEnabled successfully, isEnabled: " + isEnabled); } }); } catch (err) { - console.log("checkConstraintEnabled exception: " + JSON.stringify(err)); + console.log("checkOsAccountConstraintEnabled exception: " + JSON.stringify(err)); } ``` -### checkConstraintEnabled9+ +### checkOsAccountConstraintEnabled9+ -checkConstraintEnabled(localId: number, constraint: string): Promise<boolean> +checkOsAccountConstraintEnabled(localId: number, constraint: string): Promise<boolean> Checks whether the specified constraint is enabled for an OS account. This API uses a promise to return the result. -**Required permissions**: ohos.permission.MANAGE_LOCAL_ACCOUNTS +**Required permissions**: ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS **System capability**: SystemCapability.Account.OsAccount @@ -387,13 +387,13 @@ Checks whether the specified constraint is enabled for an OS account. This API u let localId = 100; let constraint = "constraint.wifi"; try { - accountManager.checkConstraintEnabled(localId, constraint).then((isEnabled) => { - console.log("checkConstraintEnabled successfully, isEnabled: " + isEnabled); + accountManager.checkOsAccountConstraintEnabled(localId, constraint).then((isEnabled) => { + console.log("checkOsAccountConstraintEnabled successfully, isEnabled: " + isEnabled); }).catch((err) => { - console.log("checkConstraintEnabled failed, error: " + JSON.stringify(err)); + console.log("checkOsAccountConstraintEnabled failed, error: " + JSON.stringify(err)); }); } catch (err) { - console.log("checkConstraintEnabled exception: " + JSON.stringify(err)); + console.log("checkOsAccountConstraintEnabled exception: " + JSON.stringify(err)); } ``` @@ -973,9 +973,9 @@ Obtains the number of OS accounts created. This API uses a promise to return the } ``` -### queryOsAccountLocalIdFromProcess9+ +### getOsAccountLocalId9+ -queryOsAccountLocalIdFromProcess(callback: AsyncCallback<number>): void +getOsAccountLocalId(callback: AsyncCallback<number>): void Obtains the ID of the OS account to which the current process belongs. This API uses an asynchronous callback to return the result. @@ -998,21 +998,21 @@ Obtains the ID of the OS account to which the current process belongs. This API ```js let accountManager = account_osAccount.getAccountManager(); try { - accountManager.queryOsAccountLocalIdFromProcess((err, localId) => { + accountManager.getOsAccountLocalId((err, localId) => { if (err) { - console.log("queryOsAccountLocalIdFromProcess failed, error: " + JSON.stringify(err)); + console.log("getOsAccountLocalId failed, error: " + JSON.stringify(err)); } else { - console.log("queryOsAccountLocalIdFromProcess successfully, localId: " + localId); + console.log("getOsAccountLocalId successfully, localId: " + localId); } }); } catch (err) { - console.log("queryOsAccountLocalIdFromProcess exception: " + JSON.stringify(err)); + console.log("getOsAccountLocalId exception: " + JSON.stringify(err)); } ``` -### queryOsAccountLocalIdFromProcess9+ +### getOsAccountLocalId9+ -queryOsAccountLocalIdFromProcess(): Promise<number> +getOsAccountLocalId(): Promise<number> Obtains the ID of the OS account to which the current process belongs. This API uses a promise to return the result. @@ -1035,19 +1035,19 @@ Obtains the ID of the OS account to which the current process belongs. This API ```js let accountManager = account_osAccount.getAccountManager(); try { - accountManager.queryOsAccountLocalIdFromProcess().then((localId) => { - console.log("queryOsAccountLocalIdFromProcess successfully, localId: " + localId); + accountManager.getOsAccountLocalId().then((localId) => { + console.log("getOsAccountLocalId successfully, localId: " + localId); }).catch((err) => { - console.log("queryOsAccountLocalIdFromProcess failed, error: " + JSON.stringify(err)); + console.log("getOsAccountLocalId failed, error: " + JSON.stringify(err)); }); } catch (err) { - console.log('queryOsAccountLocalIdFromProcess exception: ' + JSON.stringify(err)); + console.log('getOsAccountLocalId exception: ' + JSON.stringify(err)); } ``` -### queryOsAccountLocalIdFromUid9+ +### getOsAccountLocalIdForUid9+ -queryOsAccountLocalIdFromUid(uid: number, callback: AsyncCallback<number>): void +getOsAccountLocalIdForUid(uid: number, callback: AsyncCallback<number>): void Obtains the OS account ID based on the process UID. This API uses an asynchronous callback to return the result. @@ -1073,20 +1073,20 @@ Obtains the OS account ID based on the process UID. This API uses an asynchronou let accountManager = account_osAccount.getAccountManager(); let uid = 12345678; try { - accountManager.queryOsAccountLocalIdFromUid(uid, (err, localId) => { + accountManager.getOsAccountLocalIdForUid(uid, (err, localId) => { if (err) { - console.log("queryOsAccountLocalIdFromUid failed, error: " + JSON.stringify(err)); + console.log("getOsAccountLocalIdForUid failed, error: " + JSON.stringify(err)); } - console.log("queryOsAccountLocalIdFromUid successfully, localId: " + localId); + console.log("getOsAccountLocalIdForUid successfully, localId: " + localId); }); } catch (err) { - console.log("queryOsAccountLocalIdFromUid exception: " + JSON.stringify(err)); + console.log("getOsAccountLocalIdForUid exception: " + JSON.stringify(err)); } ``` -### queryOsAccountLocalIdFromUid9+ +### getOsAccountLocalIdForUid9+ -queryOsAccountLocalIdFromUid(uid: number): Promise<number> +getOsAccountLocalIdForUid(uid: number): Promise<number> Obtains the OS account ID based on the process UID. This API uses a promise to return the result. @@ -1117,19 +1117,19 @@ Obtains the OS account ID based on the process UID. This API uses a promise to r let accountManager = account_osAccount.getAccountManager(); let uid = 12345678; try { - accountManager.queryOsAccountLocalIdFromUid(uid).then((localId) => { - console.log("queryOsAccountLocalIdFromUid successfully, localId: " + localId); + accountManager.getOsAccountLocalIdForUid(uid).then((localId) => { + console.log("getOsAccountLocalIdForUid successfully, localId: " + localId); }).catch((err) => { - console.log("queryOsAccountLocalIdFromUid failed, error: " + JSON.stringify(err)); + console.log("getOsAccountLocalIdForUid failed, error: " + JSON.stringify(err)); }); } catch (err) { - console.log('queryOsAccountLocalIdFromUid exception: ' + JSON.stringify(err)); + console.log('getOsAccountLocalIdForUid exception: ' + JSON.stringify(err)); } ``` -### queryOsAccountLocalIdFromDomain9+ +### getOsAccountLocalIdForDomain9+ -queryOsAccountLocalIdFromDomain(domainInfo: DomainAccountInfo, callback: AsyncCallback<number>): void +getOsAccountLocalIdForDomain(domainInfo: DomainAccountInfo, callback: AsyncCallback<number>): void Obtains the OS account ID based on the domain account information. This API uses an asynchronous callback to return the result. @@ -1157,21 +1157,21 @@ Obtains the OS account ID based on the domain account information. This API uses let domainInfo = {domain: 'testDomain', accountName: 'testAccountName'}; let accountManager = account_osAccount.getAccountManager(); try { - accountManager.queryOsAccountLocalIdFromDomain(domainInfo, (err, localId) => { + accountManager.getOsAccountLocalIdForDomain(domainInfo, (err, localId) => { if (err) { - console.log("queryOsAccountLocalIdFromDomain failed, error: " + JSON.stringify(err)); + console.log("getOsAccountLocalIdForDomain failed, error: " + JSON.stringify(err)); } else { - console.log("queryOsAccountLocalIdFromDomain successfully, localId: " + localId); + console.log("getOsAccountLocalIdForDomain successfully, localId: " + localId); } }); } catch (err) { - console.log('queryOsAccountLocalIdFromDomain exception: ' + JSON.stringify(err)); + console.log('getOsAccountLocalIdForDomain exception: ' + JSON.stringify(err)); } ``` -### queryOsAccountLocalIdFromDomain9+ +### getOsAccountLocalIdForDomain9+ -queryOsAccountLocalIdFromDomain(domainInfo: DomainAccountInfo): Promise<number> +getOsAccountLocalIdForDomain(domainInfo: DomainAccountInfo): Promise<number> Obtains the OS account ID based on the domain account information. This API uses a promise to return the result. @@ -1204,13 +1204,13 @@ Obtains the OS account ID based on the domain account information. This API uses let accountManager = account_osAccount.getAccountManager(); let domainInfo = {domain: 'testDomain', accountName: 'testAccountName'}; try { - accountManager.queryOsAccountLocalIdFromDomain(domainInfo).then((localId) => { - console.log("queryOsAccountLocalIdFromDomain successfully, localId: " + localId); + accountManager.getOsAccountLocalIdForDomain(domainInfo).then((localId) => { + console.log("getOsAccountLocalIdForDomain successfully, localId: " + localId); }).catch((err) => { - console.log("queryOsAccountLocalIdFromDomain failed, error: " + JSON.stringify(err)); + console.log("getOsAccountLocalIdForDomain failed, error: " + JSON.stringify(err)); }); } catch (err) { - console.log("queryOsAccountLocalIdFromDomain exception: " + JSON.stringify(err)); + console.log("getOsAccountLocalIdForDomain exception: " + JSON.stringify(err)); } ``` @@ -1456,9 +1456,9 @@ Obtains information about all the OS accounts created. This API uses a promise t } ``` -### getActivatedOsAccountIds9+ +### getActivatedOsAccountLocalIds9+ -getActivatedOsAccountIds(callback: AsyncCallback<Array<number>>): void +getActivatedOsAccountLocalIds(callback: AsyncCallback<Array<number>>): void Obtains information about all activated OS accounts. This API uses an asynchronous callback to return the result. @@ -1481,21 +1481,21 @@ Obtains information about all activated OS accounts. This API uses an asynchrono ```js let accountManager = account_osAccount.getAccountManager(); try { - accountManager.getActivatedOsAccountIds((err, idArray)=>{ - console.log('getActivatedOsAccountIds err:' + JSON.stringify(err)); - console.log('getActivatedOsAccountIds idArray length:' + idArray.length); + accountManager.getActivatedOsAccountLocalIds((err, idArray)=>{ + console.log('getActivatedOsAccountLocalIds err:' + JSON.stringify(err)); + console.log('getActivatedOsAccountLocalIds idArray length:' + idArray.length); for(let i=0;i9+ +### getActivatedOsAccountLocalIds9+ -getActivatedOsAccountIds(): Promise<Array<number>> +getActivatedOsAccountLocalIds(): Promise<Array<number>> Obtains information about all activated OS accounts. This API uses a promise to return the result. @@ -1518,13 +1518,13 @@ Obtains information about all activated OS accounts. This API uses a promise to ```js let accountManager = account_osAccount.getAccountManager(); try { - accountManager.getActivatedOsAccountIds().then((idArray) => { - console.log('getActivatedOsAccountIds, idArray: ' + idArray); + accountManager.getActivatedOsAccountLocalIds().then((idArray) => { + console.log('getActivatedOsAccountLocalIds, idArray: ' + idArray); }).catch((err) => { - console.log('getActivatedOsAccountIds err: ' + JSON.stringify(err)); + console.log('getActivatedOsAccountLocalIds err: ' + JSON.stringify(err)); }); } catch (e) { - console.log('getActivatedOsAccountIds exception:' + JSON.stringify(e)); + console.log('getActivatedOsAccountLocalIds exception:' + JSON.stringify(e)); } ``` @@ -2214,9 +2214,9 @@ Sets a profile photo for an OS account. This API uses a promise to return the re } ``` -### queryOsAccountLocalIdBySerialNumber9+ +### getOsAccountLocalIdForSerialNumber9+ -queryOsAccountLocalIdBySerialNumber(serialNumber: number, callback: AsyncCallback<number>): void +getOsAccountLocalIdForSerialNumber(serialNumber: number, callback: AsyncCallback<number>): void Obtains the OS account ID based on the serial number (SN). This API uses an asynchronous callback to return the result. @@ -2243,7 +2243,7 @@ Obtains the OS account ID based on the serial number (SN). This API uses an asyn let accountManager = account_osAccount.getAccountManager(); let serialNumber = 12345; try { - accountManager.queryOsAccountLocalIdBySerialNumber(serialNumber, (err, localId)=>{ + accountManager.getOsAccountLocalIdForSerialNumber(serialNumber, (err, localId)=>{ console.log('ger localId err:' + JSON.stringify(err)); console.log('get localId:' + localId + ' by serialNumber: ' + serialNumber); }); @@ -2252,9 +2252,9 @@ Obtains the OS account ID based on the serial number (SN). This API uses an asyn } ``` -### queryOsAccountLocalIdBySerialNumber9+ +### getOsAccountLocalIdForSerialNumber9+ -queryOsAccountLocalIdBySerialNumber(serialNumber: number): Promise<number> +getOsAccountLocalIdForSerialNumber(serialNumber: number): Promise<number> Obtains the OS account ID based on the SN. This API uses a promise to return the result. @@ -2286,19 +2286,19 @@ Obtains the OS account ID based on the SN. This API uses a promise to return the let accountManager = account_osAccount.getAccountManager(); let serialNumber = 12345; try { - accountManager.queryOsAccountLocalIdBySerialNumber(serialNumber).then((localId) => { - console.log('queryOsAccountLocalIdBySerialNumber localId: ' + localId); + accountManager.getOsAccountLocalIdForSerialNumber(serialNumber).then((localId) => { + console.log('getOsAccountLocalIdForSerialNumber localId: ' + localId); }).catch((err) => { - console.log('queryOsAccountLocalIdBySerialNumber err: ' + JSON.stringify(err)); + console.log('getOsAccountLocalIdForSerialNumber err: ' + JSON.stringify(err)); }); } catch (e) { - console.log('queryOsAccountLocalIdBySerialNumber exception: ' + JSON.stringify(e)); + console.log('getOsAccountLocalIdForSerialNumber exception: ' + JSON.stringify(e)); } ``` -### querySerialNumberByOsAccountLocalId9+ +### getSerialNumberForOsAccountLocalId9+ -querySerialNumberByOsAccountLocalId(localId: number, callback: AsyncCallback<number>): void +getSerialNumberForOsAccountLocalId(localId: number, callback: AsyncCallback<number>): void Obtains the SN of an OS account based on the account ID. This API uses an asynchronous callback to return the result. @@ -2325,7 +2325,7 @@ Obtains the SN of an OS account based on the account ID. This API uses an asynch let accountManager = account_osAccount.getAccountManager(); let localId = 100; try { - accountManager.querySerialNumberByOsAccountLocalId(localId, (err, serialNumber)=>{ + accountManager.getSerialNumberForOsAccountLocalId(localId, (err, serialNumber)=>{ console.log('ger serialNumber err:' + JSON.stringify(err)); console.log('get serialNumber:' + serialNumber + ' by localId: ' + localId); }); @@ -2334,9 +2334,9 @@ Obtains the SN of an OS account based on the account ID. This API uses an asynch } ``` -### querySerialNumberByOsAccountLocalId9+ +### getSerialNumberForOsAccountLocalId9+ -querySerialNumberByOsAccountLocalId(localId: number): Promise<number> +getSerialNumberForOsAccountLocalId(localId: number): Promise<number> Obtains the SN of an OS account based on the account ID. This API uses a promise to return the result. @@ -2368,13 +2368,13 @@ Obtains the SN of an OS account based on the account ID. This API uses a promise let accountManager = account_osAccount.getAccountManager(); let localId = 100; try { - accountManager.querySerialNumberByOsAccountLocalId(localId).then((serialNumber) => { - console.log('querySerialNumberByOsAccountLocalId serialNumber: ' + serialNumber); + accountManager.getSerialNumberForOsAccountLocalId(localId).then((serialNumber) => { + console.log('getSerialNumberForOsAccountLocalId serialNumber: ' + serialNumber); }).catch((err) => { - console.log('querySerialNumberByOsAccountLocalId err: ' + JSON.stringify(err)); + console.log('getSerialNumberForOsAccountLocalId err: ' + JSON.stringify(err)); }); } catch (e) { - console.log('querySerialNumberByOsAccountLocalId exception:' + JSON.stringify(e)); + console.log('getSerialNumberForOsAccountLocalId exception:' + JSON.stringify(e)); } ``` @@ -2462,9 +2462,9 @@ Unsubscribes from the OS account activation states, including the states of the } ``` -### getBundleIdFromUid9+ +### getBundleIdForUid9+ -getBundleIdFromUid(uid: number, callback: AsyncCallback<number>): void; +getBundleIdForUid(uid: number, callback: AsyncCallback<number>): void; Obtains the bundle ID based on the UID. This API uses an asynchronous callback to return the result. @@ -2492,17 +2492,17 @@ Obtains the bundle ID based on the UID. This API uses an asynchronous callback t let accountManager = account_osAccount.getAccountManager(); let testUid = 1000000; try { - accountManager.getBundleIdFromUid(testUid, (err, bundleId) => { - console.info('getBundleIdFromUid errInfo:' + JSON.stringify(err)); - console.info('getBundleIdFromUid bundleId:' + JSON.stringify(bundleId)); + accountManager.getBundleIdForUid(testUid, (err, bundleId) => { + console.info('getBundleIdForUid errInfo:' + JSON.stringify(err)); + console.info('getBundleIdForUid bundleId:' + JSON.stringify(bundleId)); }); } catch (e) { - console.info('getBundleIdFromUid exception:' + JSON.stringify(e)); + console.info('getBundleIdForUid exception:' + JSON.stringify(e)); } ``` -### getBundleIdFromUid9+ +### getBundleIdForUid9+ -getBundleIdFromUid(uid: number): Promise<number>; +getBundleIdForUid(uid: number): Promise<number>; Obtains the bundle ID based on the UID. This API uses a promise to return the result. @@ -2535,13 +2535,13 @@ Obtains the bundle ID based on the UID. This API uses a promise to return the re let accountManager = account_osAccount.getAccountManager(); let testUid = 1000000; try { - accountManager.getBundleIdFromUid(testUid).then((result) => { - console.info('getBundleIdFromUid bundleId:' + JSON.stringify(result)); + accountManager.getBundleIdForUid(testUid).then((result) => { + console.info('getBundleIdForUid bundleId:' + JSON.stringify(result)); }).catch((err)=>{ - console.info('getBundleIdFromUid errInfo:' + JSON.stringify(err)); + console.info('getBundleIdForUid errInfo:' + JSON.stringify(err)); }); } catch (e) { - console.info('getBundleIdFromUid exception:' + JSON.stringify(e)); + console.info('getBundleIdForUid exception:' + JSON.stringify(e)); } ``` @@ -2620,9 +2620,9 @@ Checks whether the current process belongs to the main OS account. This API uses console.info('isMainOsAccount exception:' + JSON.stringify(e)); } ``` -### queryOsAccountConstraintSourceTypes9+ +### getOsAccountConstraintSourceTypes9+ -queryOsAccountConstraintSourceTypes(localId: number, constraint: string, callback: AsyncCallback<Array<ConstraintSourceTypeInfo>>): void; +getOsAccountConstraintSourceTypes(localId: number, constraint: string, callback: AsyncCallback<Array<ConstraintSourceTypeInfo>>): void; Obtains the constraint source information of an OS account. This API uses an asynchronous callback to return the result. @@ -2653,18 +2653,18 @@ Obtains the constraint source information of an OS account. This API uses an asy ```js let accountManager = account_osAccount.getAccountManager(); try { - accountManager.queryOsAccountConstraintSourceTypes(100, 'constraint.wifi',(err,sourceTypeInfos)=>{ - console.info('queryOsAccountConstraintSourceType errInfo:' + JSON.stringify(err)); - console.info('queryOsAccountConstraintSourceType sourceTypeInfos:' + JSON.stringify(sourceTypeInfos)); + accountManager.getOsAccountConstraintSourceTypes(100, 'constraint.wifi',(err,sourceTypeInfos)=>{ + console.info('getOsAccountConstraintSourceTypes errInfo:' + JSON.stringify(err)); + console.info('getOsAccountConstraintSourceTypes sourceTypeInfos:' + JSON.stringify(sourceTypeInfos)); }); } catch (e) { - console.info('queryOsAccountConstraintSourceType exception:' + JSON.stringify(e)); + console.info('getOsAccountConstraintSourceTypes exception:' + JSON.stringify(e)); } ``` -### queryOsAccountConstraintSourceTypes9+ +### getOsAccountConstraintSourceTypes9+ -queryOsAccountConstraintSourceTypes(localId: number, constraint: string): Promise<Array<ConstraintSourceTypeInfo>>; +getOsAccountConstraintSourceTypes(localId: number, constraint: string): Promise<Array<ConstraintSourceTypeInfo>>; Obtains the constraint source information of an OS account. This API uses a promise to return the result. @@ -2700,13 +2700,13 @@ Obtains the constraint source information of an OS account. This API uses a prom ```js let accountManager = account_osAccount.getAccountManager(); try { - accountManager.queryOsAccountConstraintSourceTypes(100, 'constraint.wifi').then((result) => { - console.info('queryOsAccountConstraintSourceType sourceTypeInfos:' + JSON.stringify(result)); + accountManager.getOsAccountConstraintSourceTypes(100, 'constraint.wifi').then((result) => { + console.info('getOsAccountConstraintSourceTypes sourceTypeInfos:' + JSON.stringify(result)); }).catch((err)=>{ - console.info('queryOsAccountConstraintSourceType errInfo:' + JSON.stringify(err)); + console.info('getOsAccountConstraintSourceTypes errInfo:' + JSON.stringify(err)); }); } catch (e) { - console.info('queryOsAccountConstraintSourceType exception:' + JSON.stringify(e)); + console.info('getOsAccountConstraintSourceTypes exception:' + JSON.stringify(e)); } ``` @@ -2852,7 +2852,7 @@ Checks whether the specified constraint is enabled for an OS account. This API u > **NOTE** > -> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [checkConstraintEnabled](#checkconstraintenabled9). +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [checkOsAccountConstraintEnabled](#checkosaccountconstraintenabled9). **Required permissions**: ohos.permission.MANAGE_LOCAL_ACCOUNTS @@ -2889,7 +2889,7 @@ Checks whether the specified constraint is enabled for an OS account. This API u > **NOTE** > -> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [checkConstraintEnabled](#checkconstraintenabled9-1). +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [checkOsAccountConstraintEnabled](#checkosaccountconstraintenabled9-1). **Required permissions**: ohos.permission.MANAGE_LOCAL_ACCOUNTS @@ -3158,7 +3158,7 @@ Obtains the ID of the OS account to which the current process belongs. This API > **NOTE** > -> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [queryOsAccountLocalIdFromProcess](#queryosaccountlocalidfromprocess9). +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [getOsAccountLocalId](#getosaccountlocalid9). **System capability**: SystemCapability.Account.OsAccount @@ -3189,7 +3189,7 @@ Obtains the ID of the OS account to which the current process belongs. This API > **NOTE** > -> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [queryOsAccountLocalIdFromProcess](#queryosaccountlocalidfromprocess9-1). +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [getOsAccountLocalId](#getosaccountlocalid9-1). **System capability**: SystemCapability.Account.OsAccount @@ -3218,7 +3218,7 @@ Obtains the OS account ID based on the process UID. This API uses an asynchronou > **NOTE** > -> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [queryOsAccountLocalIdFromUid](#queryosaccountlocalidfromuid9). +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [getOsAccountLocalIdForUid](#getosaccountlocalidforuid9). **System capability**: SystemCapability.Account.OsAccount @@ -3251,7 +3251,7 @@ Obtains the OS account ID based on the process UID. This API uses a promise to r > **NOTE** > -> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [queryOsAccountLocalIdFromUid](#queryosaccountlocalidfromuid9-1). +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [getOsAccountLocalIdForUid](#getosaccountlocalidforuid9-1). **System capability**: SystemCapability.Account.OsAccount @@ -3287,7 +3287,7 @@ Obtains the OS account ID based on the domain account information. This API uses > **NOTE** > -> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [queryOsAccountLocalIdFromDomain](#queryosaccountlocalidfromdomain9). +> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [getOsAccountLocalIdForDomain](#getosaccountlocalidfordomain9). **Required permissions**: ohos.permission.MANAGE_LOCAL_ACCOUNTS @@ -3322,7 +3322,7 @@ Obtains the OS account ID based on the domain account information. This API uses > **NOTE** > -> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [queryOsAccountLocalIdFromDomain](#queryosaccountlocalidfromdomain9-1). +> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [getOsAccountLocalIdForDomain](#getosaccountlocalidfordomain9-1). **Required permissions**: ohos.permission.MANAGE_LOCAL_ACCOUNTS @@ -3430,7 +3430,7 @@ Obtains information about all activated OS accounts. This API uses an asynchrono > **NOTE** > -> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [getActivatedOsAccountIds](#getactivatedosaccountids9). +> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [getActivatedOsAccountLocalIds](#getactivatedosaccountlocalids9). **System capability**: SystemCapability.Account.OsAccount @@ -3459,7 +3459,7 @@ queryActivatedOsAccountIds(): Promise<Array<number>> > **NOTE** > -> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [getActivatedOsAccountIds](#getactivatedosaccountids9-1). +> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [getActivatedOsAccountLocalIds](#getactivatedosaccountlocalids9-1). Obtains information about all activated OS accounts. This API uses a promise to return the result. @@ -3669,7 +3669,7 @@ Obtains the OS account ID based on the SN. This API uses an asynchronous callbac > **NOTE** > -> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [queryOsAccountLocalIdBySerialNumber](#queryosaccountlocalidbyserialnumber9). +> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [getOsAccountLocalIdForSerialNumber](#getosaccountlocalidforserialnumber9). **System capability**: SystemCapability.Account.OsAccount @@ -3695,11 +3695,11 @@ Obtains the OS account ID based on the SN. This API uses an asynchronous callbac getOsAccountLocalIdBySerialNumber(serialNumber: number): Promise<number> -Obtains the OS account ID based on the serial number. This API uses a promise to return the result. +Obtains the OS account ID based on the SN. This API uses a promise to return the result. > **NOTE** > -> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [queryOsAccountLocalIdBySerialNumber](#queryosaccountlocalidbyserialnumber9-1). +> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [getOsAccountLocalIdForSerialNumber](#getosaccountlocalidforserialnumber9-1). **System capability**: SystemCapability.Account.OsAccount @@ -3735,7 +3735,7 @@ Obtains the SN of an OS account based on the account ID. This API uses an asynch > **NOTE** > -> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [querySerialNumberByOsAccountLocalId](#queryserialnumberbyosaccountlocalid9). +> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [getSerialNumberForOsAccountLocalId](#getserialnumberforosaccountlocalid9). **System capability**: SystemCapability.Account.OsAccount @@ -3765,7 +3765,7 @@ Obtains the SN of an OS account based on the account ID. This API uses a promise > **NOTE** > -> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [querySerialNumberByOsAccountLocalId](#queryserialnumberbyosaccountlocalid9-1). +> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [getSerialNumberForOsAccountLocalId](#getserialnumberforosaccountlocalid9-1). **System capability**: SystemCapability.Account.OsAccount diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelogs-account_os_account.md b/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelogs-account_os_account.md new file mode 100644 index 0000000000000000000000000000000000000000..8678507b6c8d8449e8cac47e6b8669611865bec2 --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelogs-account_os_account.md @@ -0,0 +1,391 @@ +# Account Subsystem Changelog + +OpenHarmony 4.0.3.2 has the following changes in account module APIs: + +## cl.account_os_account.1 App Account API isAccountRemovable Renamed + +Changed **isAccountRemovable** in the **Authenticator** class to **checkAccountRemovable**. + +**Change Impact** + +The **isAccountRemovable** API in the **Authenticator** class cannot be used from 4.0.3.2. Use **checkAccountRemovable** instead. + +**Key API/Component Changes** + +- Involved APIs: + ```ts + class Authenticator { + ... + isAccountRemovable + ... + } + ``` +- Before change: + + ```ts + class Authenticator { + ... + /** + * Checks whether the specified account can be removed. + * @param name Indicates the account name. + * @param callback Indicates the authenticator callback. + * @returns void. + * @since 9 + */ + isAccountRemovable(name: string, callback: AuthCallback): void; + ... + } + ``` + +- After change: + + ```ts + class Authenticator { + ... + /** + * Checks whether the specified account can be removed. + * @param name Indicates the account name. + * @param callback Indicates the authenticator callback. + * @returns void. + * @since 9 + */ + checkAccountRemovable(name: string, callback: AuthCallback): void; + ... + } + ``` + +## cl.account_os_account.2 OS Account API checkConstraintEnabled Renamed + +Changed **checkConstraintEnabled** to **checkOsAccountConstraintEnabled**. + +**Change Impact** + +The **checkConstraintEnabled** API cannot be used from 4.0.3.2. Use **checkOsAccountConstraintEnabled** instead. + +**Key API/Component Changes** + +- Involved APIs: +``` +interface AccountManager { + ... + checkConstraintEnabled + ... +} +``` + +- Before change: + + ```ts + checkConstraintEnabled(localId: number, constraint: string, callback: AsyncCallback): void; + checkConstraintEnabled(localId: number, constraint: string): Promise; + ``` + +- After change: + + ```ts + checkOsAccountConstraintEnabled(localId: number, constraint: string, callback: AsyncCallback): void; + checkOsAccountConstraintEnabled(localId: number, constraint: string): Promise; + ``` + +## cl.account_os_account.3 OS Account API **checkOsAccountConstraintEnabled** Permission Scenario Change + +Added an optional permission **ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS** to the **checkOsAccountConstraintEnabled** API. + +**Change Impact** + +In 4.0.3.2 and later versions, an app with the **ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS** permission can also call **checkOsAccountConstraintEnabled**. +The use of **ohos.permission.MANAGE_LOCAL_ACCOUNTS** is not affected. + +**Key API/Component Changes** + +- Involved APIs: +``` +interface AccountManager { + ... + checkOsAccountConstraintEnabled + ... +} +``` + +- Before change: + + ```ts + ... + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS + ... + checkOsAccountConstraintEnabled(localId: number, constraint: string, callback: AsyncCallback): void; + checkOsAccountConstraintEnabled(localId: number, constraint: string): Promise; + ``` + +- After change: + + ```ts + ... + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + ... + checkOsAccountConstraintEnabled(localId: number, constraint: string, callback: AsyncCallback): void; + checkOsAccountConstraintEnabled(localId: number, constraint: string): Promise; + ``` + +## cl.account_os_account.4 OS Account API queryOsAccountLocalIdFromProcessd Renamed + +Changed **queryOsAccountLocalIdFromProcess** to **getOsAccountLocalId**. + +**Change Impact** + +The **queryOsAccountLocalIdFromProcess** API cannot be used from 4.0.3.2. Use **getOsAccountLocalId** instead. + +**Key API/Component Changes** + +- Involved APIs: +``` +interface AccountManager { + ... + queryOsAccountLocalIdFromProcess + ... +} +``` +- Before change: + + ```ts + queryOsAccountLocalIdFromProcess(callback: AsyncCallback): void; + queryOsAccountLocalIdFromProcess(): Promise; + ``` + +- After change: + + ```ts + getOsAccountLocalId(callback: AsyncCallback): void; + getOsAccountLocalId(): Promise; + ``` + +## cl.account_os_account.5 OS Account API queryOsAccountLocalIdFromUid Renamed + +Changed **queryOsAccountLocalIdFromUid** to **getOsAccountLocalIdForUid**. + +**Change Impact** + +The **queryOsAccountLocalIdFromUid** API cannot be used from 4.0.3.2. Use **getOsAccountLocalIdForUid** instead. + +**Key API/Component Changes** + +- Involved APIs: +``` +interface AccountManager { + ... + queryOsAccountLocalIdFromUid + ... +} +``` + +- Before change: + + ```ts + queryOsAccountLocalIdFromUid(uid: number, callback: AsyncCallback): void; + queryOsAccountLocalIdFromUid(uid: number): Promise; + ``` + +- After change: + + ```ts + getOsAccountLocalIdForUid(uid: number, callback: AsyncCallback): void; + getOsAccountLocalIdForUid(uid: number): Promise; + ``` + +## cl.account_os_account.6 OS Account API queryOsAccountLocalIdFromDomain Renamed + +Changed **queryOsAccountLocalIdFromDomain** to **getOsAccountLocalIdForDomain**. + +**Change Impact** + +The **queryOsAccountLocalIdFromDomain** API cannot be used from 4.0.3.2. Use **getOsAccountLocalIdForDomain** instead. + +**Key API/Component Changes** + +- Involved APIs: +``` +interface AccountManager { + ... + queryOsAccountLocalIdFromDomain + ... +} +``` + +- Before change: + + ```ts + queryOsAccountLocalIdFromDomain(domainInfo: DomainAccountInfo, callback: AsyncCallback): void; + queryOsAccountLocalIdFromDomain(domainInfo: DomainAccountInfo): Promise; + ``` + +- After change: + + ```ts + getOsAccountLocalIdForDomain(domainInfo: DomainAccountInfo, callback: AsyncCallback): void; + getOsAccountLocalIdForDomain(domainInfo: DomainAccountInfo): Promise; + ``` + +## cl.account_os_account.7 OS Account API getActivatedOsAccountIds Renamed + +Changed **getActivatedOsAccountIds** to **getActivatedOsAccountLocalIds**. + +**Change Impact** + +The **getActivatedOsAccountIds** API cannot be used from 4.0.3.2. Use **getActivatedOsAccountLocalIds** instead. + +**Key API/Component Changes** + +- Involved APIs: +``` +interface AccountManager { + ... + getActivatedOsAccountIds + ... +} +``` + +- Before change: + + ```ts + getActivatedOsAccountIds(callback: AsyncCallback>): void; + getActivatedOsAccountIds(): Promise>; + ``` + +- After change: + + ```ts + getActivatedOsAccountLocalIds(callback: AsyncCallback>): void; + getActivatedOsAccountLocalIds(): Promise>; + ``` + +## cl.account_os_account.8 OS Account API queryOsAccountLocalIdBySerialNumber Renamed + +Changed **queryOsAccountLocalIdBySerialNumber** to **getOsAccountLocalIdForSerialNumber**. + +**Change Impact** + +The **queryOsAccountLocalIdBySerialNumber** API cannot be used from 4.0.3.2. Use **getOsAccountLocalIdForSerialNumber** instead. + +**Key API/Component Changes** + +- Involved APIs: +``` +interface AccountManager { + ... + queryOsAccountLocalIdBySerialNumber + ... +} +``` + +- Before change: + + ```ts + queryOsAccountLocalIdBySerialNumber(serialNumber: number, callback: AsyncCallback): void; + queryOsAccountLocalIdBySerialNumber(serialNumber: number): Promise; + ``` + +- After change: + + ```ts + getOsAccountLocalIdForSerialNumber(serialNumber: number, callback: AsyncCallback): void; + getOsAccountLocalIdForSerialNumber(serialNumber: number): Promise; + ``` + +## cl.account_os_account.9 OS Account API querySerialNumberByOsAccountLocalId Renamed + +Changed **querySerialNumberByOsAccountLocalId** to **getSerialNumberForOsAccountLocalId**. + +**Change Impact** + +The **querySerialNumberByOsAccountLocalId** API cannot be used from 4.0.3.2. Use **getSerialNumberForOsAccountLocalId** instead. + +**Key API/Component Changes** + +- Involved APIs: +``` +interface AccountManager { + ... + querySerialNumberByOsAccountLocalId + ... +} +``` + +- Before change: + + ```ts + querySerialNumberByOsAccountLocalId(localId: number, callback: AsyncCallback): void; + querySerialNumberByOsAccountLocalId(localId: number): Promise; + ``` + +- After change: + + ```ts + getSerialNumberForOsAccountLocalId(localId: number, callback: AsyncCallback): void; + getSerialNumberForOsAccountLocalId(localId: number): Promise; + ``` + +## cl.account_os_account.10 OS Account API getBundleIdFromUid Renamed + +Changed **getBundleIdFromUid** to **getBundleIdForUid**. + +**Change Impact** + +The **getBundleIdFromUid** API cannot be used from 4.0.3.2. Use **getBundleIdForUid** instead. + +**Key API/Component Changes** + +- Involved APIs: +``` +interface AccountManager { + ... + getBundleIdFromUid + ... +} +``` + +- Before change: + + ```ts + getBundleIdFromUid(uid: number, callback: AsyncCallback): void; + getBundleIdFromUid(uid: number): Promise; + ``` + +- After change: + + ```ts + getBundleIdForUid(uid: number, callback: AsyncCallback): void; + getBundleIdForUid(uid: number): Promise; + ``` + +## cl.account_os_account.11 OS Account API queryOsAccountConstraintSourceTypes Renamed + +Changed **queryOsAccountConstraintSourceTypes** to **getOsAccountConstraintSourceTypes**. + +**Change Impact** + +The **queryOsAccountConstraintSourceTypes** API cannot be used from 4.0.3.2. Use **getOsAccountConstraintSourceTypes** instead. + +**Key API/Component Changes** + +- Involved APIs: +``` +interface AccountManager { + ... + queryOsAccountConstraintSourceTypes + ... +} +``` + +- Before change: + + ```ts + queryOsAccountConstraintSourceTypes(localId: number, constraint: string, callback: AsyncCallback>): void; + queryOsAccountConstraintSourceTypes(localId: number, constraint: string): Promise>; + ``` + +- After change: + + ```ts + getOsAccountConstraintSourceTypes(localId: number, constraint: string, callback: AsyncCallback>): void; + getOsAccountConstraintSourceTypes(localId: number, constraint: string): Promise>; + ```