提交 c817aee5 编写于 作者: A Annie_wang

update docs

Signed-off-by: NAnnie_wang <annie.wangli@huawei.com>
上级 1a006fb4
......@@ -304,13 +304,13 @@ Checks whether an OS account is activated. This API uses a promise to return the
}
```
### checkConstraintEnabled<sup>9+</sup>
### checkOsAccountConstraintEnabled<sup>9+</sup>
checkConstraintEnabled(localId: number, constraint: string, callback: AsyncCallback&lt;boolean&gt;): void
checkOsAccountConstraintEnabled(localId: number, constraint: string, callback: AsyncCallback&lt;boolean&gt;): 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));
}
```
### checkConstraintEnabled<sup>9+</sup>
### checkOsAccountConstraintEnabled<sup>9+</sup>
checkConstraintEnabled(localId: number, constraint: string): Promise&lt;boolean&gt;
checkOsAccountConstraintEnabled(localId: number, constraint: string): Promise&lt;boolean&gt;
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
}
```
### queryOsAccountLocalIdFromProcess<sup>9+</sup>
### getOsAccountLocalId<sup>9+</sup>
queryOsAccountLocalIdFromProcess(callback: AsyncCallback&lt;number&gt;): void
getOsAccountLocalId(callback: AsyncCallback&lt;number&gt;): 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));
}
```
### queryOsAccountLocalIdFromProcess<sup>9+</sup>
### getOsAccountLocalId<sup>9+</sup>
queryOsAccountLocalIdFromProcess(): Promise&lt;number&gt;
getOsAccountLocalId(): Promise&lt;number&gt;
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));
}
```
### queryOsAccountLocalIdFromUid<sup>9+</sup>
### getOsAccountLocalIdForUid<sup>9+</sup>
queryOsAccountLocalIdFromUid(uid: number, callback: AsyncCallback&lt;number&gt;): void
getOsAccountLocalIdForUid(uid: number, callback: AsyncCallback&lt;number&gt;): 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));
}
```
### queryOsAccountLocalIdFromUid<sup>9+</sup>
### getOsAccountLocalIdForUid<sup>9+</sup>
queryOsAccountLocalIdFromUid(uid: number): Promise&lt;number&gt;
getOsAccountLocalIdForUid(uid: number): Promise&lt;number&gt;
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));
}
```
### queryOsAccountLocalIdFromDomain<sup>9+</sup>
### getOsAccountLocalIdForDomain<sup>9+</sup>
queryOsAccountLocalIdFromDomain(domainInfo: DomainAccountInfo, callback: AsyncCallback&lt;number&gt;): void
getOsAccountLocalIdForDomain(domainInfo: DomainAccountInfo, callback: AsyncCallback&lt;number&gt;): 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));
}
```
### queryOsAccountLocalIdFromDomain<sup>9+</sup>
### getOsAccountLocalIdForDomain<sup>9+</sup>
queryOsAccountLocalIdFromDomain(domainInfo: DomainAccountInfo): Promise&lt;number&gt;
getOsAccountLocalIdForDomain(domainInfo: DomainAccountInfo): Promise&lt;number&gt;
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
}
```
### getActivatedOsAccountIds<sup>9+</sup>
### getActivatedOsAccountLocalIds<sup>9+</sup>
getActivatedOsAccountIds(callback: AsyncCallback&lt;Array&lt;number&gt;&gt;): void
getActivatedOsAccountLocalIds(callback: AsyncCallback&lt;Array&lt;number&gt;&gt;): 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;i<idArray.length;i++) {
console.info('activated os account id: ' + idArray[i]);
}
});
} catch (e) {
console.log('getActivatedOsAccountIds exception:' + JSON.stringify(e));
console.log('getActivatedOsAccountLocalIds exception:' + JSON.stringify(e));
}
```
### getActivatedOsAccountIds<sup>9+</sup>
### getActivatedOsAccountLocalIds<sup>9+</sup>
getActivatedOsAccountIds(): Promise&lt;Array&lt;number&gt;&gt;
getActivatedOsAccountLocalIds(): Promise&lt;Array&lt;number&gt;&gt;
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
}
```
### queryOsAccountLocalIdBySerialNumber<sup>9+</sup>
### getOsAccountLocalIdForSerialNumber<sup>9+</sup>
queryOsAccountLocalIdBySerialNumber(serialNumber: number, callback: AsyncCallback&lt;number&gt;): void
getOsAccountLocalIdForSerialNumber(serialNumber: number, callback: AsyncCallback&lt;number&gt;): 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
}
```
### queryOsAccountLocalIdBySerialNumber<sup>9+</sup>
### getOsAccountLocalIdForSerialNumber<sup>9+</sup>
queryOsAccountLocalIdBySerialNumber(serialNumber: number): Promise&lt;number&gt;
getOsAccountLocalIdForSerialNumber(serialNumber: number): Promise&lt;number&gt;
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));
}
```
### querySerialNumberByOsAccountLocalId<sup>9+</sup>
### getSerialNumberForOsAccountLocalId<sup>9+</sup>
querySerialNumberByOsAccountLocalId(localId: number, callback: AsyncCallback&lt;number&gt;): void
getSerialNumberForOsAccountLocalId(localId: number, callback: AsyncCallback&lt;number&gt;): 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
}
```
### querySerialNumberByOsAccountLocalId<sup>9+</sup>
### getSerialNumberForOsAccountLocalId<sup>9+</sup>
querySerialNumberByOsAccountLocalId(localId: number): Promise&lt;number&gt;
getSerialNumberForOsAccountLocalId(localId: number): Promise&lt;number&gt;
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
}
```
### getBundleIdFromUid<sup>9+</sup>
### getBundleIdForUid<sup>9+</sup>
getBundleIdFromUid(uid: number, callback: AsyncCallback&lt;number&gt;): void;
getBundleIdForUid(uid: number, callback: AsyncCallback&lt;number&gt;): 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));
}
```
### getBundleIdFromUid<sup>9+</sup>
### getBundleIdForUid<sup>9+</sup>
getBundleIdFromUid(uid: number): Promise&lt;number&gt;;
getBundleIdForUid(uid: number): Promise&lt;number&gt;;
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));
}
```
### queryOsAccountConstraintSourceTypes<sup>9+</sup>
### getOsAccountConstraintSourceTypes<sup>9+</sup>
queryOsAccountConstraintSourceTypes(localId: number, constraint: string, callback: AsyncCallback&lt;Array&lt;ConstraintSourceTypeInfo&gt;&gt;): void;
getOsAccountConstraintSourceTypes(localId: number, constraint: string, callback: AsyncCallback&lt;Array&lt;ConstraintSourceTypeInfo&gt;&gt;): 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));
}
```
### queryOsAccountConstraintSourceTypes<sup>9+</sup>
### getOsAccountConstraintSourceTypes<sup>9+</sup>
queryOsAccountConstraintSourceTypes(localId: number, constraint: string): Promise&lt;Array&lt;ConstraintSourceTypeInfo&gt;&gt;;
getOsAccountConstraintSourceTypes(localId: number, constraint: string): Promise&lt;Array&lt;ConstraintSourceTypeInfo&gt;&gt;;
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&lt;Array&lt;number&gt;&gt;
> **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&lt;number&gt;
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
......
# 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<boolean>): void;
checkConstraintEnabled(localId: number, constraint: string): Promise<boolean>;
```
- After change:
```ts
checkOsAccountConstraintEnabled(localId: number, constraint: string, callback: AsyncCallback<boolean>): void;
checkOsAccountConstraintEnabled(localId: number, constraint: string): Promise<boolean>;
```
## 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<boolean>): void;
checkOsAccountConstraintEnabled(localId: number, constraint: string): Promise<boolean>;
```
- After change:
```ts
...
* @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
...
checkOsAccountConstraintEnabled(localId: number, constraint: string, callback: AsyncCallback<boolean>): void;
checkOsAccountConstraintEnabled(localId: number, constraint: string): Promise<boolean>;
```
## 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<number>): void;
queryOsAccountLocalIdFromProcess(): Promise<number>;
```
- After change:
```ts
getOsAccountLocalId(callback: AsyncCallback<number>): void;
getOsAccountLocalId(): Promise<number>;
```
## 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<number>): void;
queryOsAccountLocalIdFromUid(uid: number): Promise<number>;
```
- After change:
```ts
getOsAccountLocalIdForUid(uid: number, callback: AsyncCallback<number>): void;
getOsAccountLocalIdForUid(uid: number): Promise<number>;
```
## 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<number>): void;
queryOsAccountLocalIdFromDomain(domainInfo: DomainAccountInfo): Promise<number>;
```
- After change:
```ts
getOsAccountLocalIdForDomain(domainInfo: DomainAccountInfo, callback: AsyncCallback<number>): void;
getOsAccountLocalIdForDomain(domainInfo: DomainAccountInfo): Promise<number>;
```
## 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<Array<number>>): void;
getActivatedOsAccountIds(): Promise<Array<number>>;
```
- After change:
```ts
getActivatedOsAccountLocalIds(callback: AsyncCallback<Array<number>>): void;
getActivatedOsAccountLocalIds(): Promise<Array<number>>;
```
## 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<number>): void;
queryOsAccountLocalIdBySerialNumber(serialNumber: number): Promise<number>;
```
- After change:
```ts
getOsAccountLocalIdForSerialNumber(serialNumber: number, callback: AsyncCallback<number>): void;
getOsAccountLocalIdForSerialNumber(serialNumber: number): Promise<number>;
```
## 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<number>): void;
querySerialNumberByOsAccountLocalId(localId: number): Promise<number>;
```
- After change:
```ts
getSerialNumberForOsAccountLocalId(localId: number, callback: AsyncCallback<number>): void;
getSerialNumberForOsAccountLocalId(localId: number): Promise<number>;
```
## 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<number>): void;
getBundleIdFromUid(uid: number): Promise<number>;
```
- After change:
```ts
getBundleIdForUid(uid: number, callback: AsyncCallback<number>): void;
getBundleIdForUid(uid: number): Promise<number>;
```
## 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<Array<ConstraintSourceTypeInfo>>): void;
queryOsAccountConstraintSourceTypes(localId: number, constraint: string): Promise<Array<ConstraintSourceTypeInfo>>;
```
- After change:
```ts
getOsAccountConstraintSourceTypes(localId: number, constraint: string, callback: AsyncCallback<Array<ConstraintSourceTypeInfo>>): void;
getOsAccountConstraintSourceTypes(localId: number, constraint: string): Promise<Array<ConstraintSourceTypeInfo>>;
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册