提交 8e25e91b 编写于 作者: X xsz233

Merge remote-tracking branch 'upstream/master'

......@@ -397,7 +397,7 @@ zh-cn/application-dev/reference/apis/js-apis-notification.md @jayleehw @RayShih
zh-cn/application-dev/reference/apis/js-apis-observer.md @zhang-hai-feng @zengyawen @jyh926 @gaoxi785
zh-cn/application-dev/reference/apis/js-apis-osAccount.md @nianCode @zengyawen @JiDong-CS @murphy1984
zh-cn/application-dev/reference/apis/js-apis-particleAbility.md @littlejerry1 @RayShih @gwang2008 @chengxingzhen
zh-cn/application-dev/reference/apis/js-apis-pasteboard.md @feng-aiwen @ge-yafang @gong-a-shi @logic42
zh-cn/application-dev/reference/apis/js-apis-pasteboard.md @han-zhengshi @ge-yafang @logic42
zh-cn/application-dev/reference/apis/js-apis-permissionrequestresult.md @littlejerry1 @RayShih @gwang2008 @chengxingzhen
zh-cn/application-dev/reference/apis/js-apis-plainarray.md @gongjunsong @ge-yafang @flyingwolf @BlackStone
zh-cn/application-dev/reference/apis/js-apis-pointer.md @yuanxinying @ningningW @cococoler @alien0208
......
......@@ -18,7 +18,7 @@
- master:最新开发版本。
- OpenHarmony 3.2 Beta5版本:点击[此处](zh-cn/release-notes/OpenHarmony-v3.2-beta5.md)了解版本详情。
- OpenHarmony 3.2 Release版本:点击[此处](zh-cn/release-notes/OpenHarmony-v3.2-release.md)了解版本详情。
- OpenHarmony 3.1 Release版本:点击[此处](zh-cn/release-notes/OpenHarmony-v3.1-release.md)了解版本详情。
......
......@@ -17,7 +17,6 @@
- ExtensionAbility Component
- [ExtensionAbility Component Overview](extensionability-overview.md)
- [ServiceExtensionAbility](serviceextensionability.md)
- [DataShareExtensionAbility (for System Applications Only)](datashareextensionability.md)
- [FormExtensionAbility (Widget)](widget-development-stage.md)
- [AccessibilityExtensionAbility](accessibilityextensionability.md)
- [EnterpriseAdminExtensionAbility](enterprise-extensionAbility.md)
......@@ -46,7 +45,7 @@
- [Common Event Subscription Overview](common-event-subscription-overview.md)
- [Subscribing to Common Events in Dynamic Mode](common-event-subscription.md)
- [Subscribing to Common Events in Static Mode (for System Applications Only)](common-event-static-subscription.md)
- [Unsubscribing from Common Events](common-event-unsubscription.md)
- [Unsubscribing from Common Events](common-event-unsubscription.md)
- [Publishing Common Events](common-event-publish.md)
- [Background Services](background-services.md)
- Inter-Thread Communication
......
......@@ -25,6 +25,12 @@ An [ExtensionAbilityType](../reference/apis/js-apis-bundleManager.md#extensionab
- [EnterpriseAdminExtensionAbility](../reference/apis/js-apis-EnterpriseAdminExtensionAbility.md): ExtensionAbility component of the enterprise_admin type, which provides APIs for processing enterprise management events, such as application installation events on devices and events indicating too many incorrect screen-lock password attempts.
> **NOTE**<br>
> 1. Third-party applications cannot implement ServiceExtensionAbility, DataShareExtensionAbility, StaticSubscriberExtensionAbility, or WindowExtensionAbility.
>
> 2. To implement transaction processing in the background for a third-party application, use background tasks rather than ServiceExtensionAbility. For details, see [Background Task](../task-management/background-task-overview.md).
>
> 3. Third-party applications can use other types of ExtensionAbility components that have been defined.
## Using ExtensionAbility of the Specified Type
......
......@@ -10,7 +10,7 @@ The following figure shows the basic concepts used in the stage model.
- [UIAbility component](uiability-overview.md) and [ExtensionAbility component](extensionability-overview.md)
The stage model provides two types of application components: UIAbility and ExtensionAbility. Both have specific classes and support object-oriented development. They are the specific implementation of the abstract ability concept on the stage model. They are also units scheduled by the Ability Manager Service (AMS), which schedules their lifecycles as well.
The stage model provides two types of application components: UIAbility and ExtensionAbility. Both have specific classes and support object-oriented development.
- UIAbility has the UI and is mainly used for user interaction. For example, with UIAbility, the Gallery application can display images in the liquid layout. After a user selects an image, it uses a new UI to display the image details. The user can touch the **Back** button to return to the liquid layout. The lifecycle of the UIAbility component contains the creation, destruction, foreground, and background states. Display-related states are exposed through WindowStage events.
......@@ -22,6 +22,7 @@ The following figure shows the basic concepts used in the stage model.
- [Context](application-context-stage.md)
In the stage model, Context and its derived classes provide a variety of resources and capabilities that can be called during the runtime. The UIAbility component and ExtensionAbility derived classes have different Context classes. These classes, which all inherit from the base class Context, provide different capabilities.
- [AbilityStage](abilitystage.md)
Each HAP of the Entry or Feature type has an AbilityStage class instance during the runtime. When the code in the HAP is loaded to the process for the first time, the system creates an AbilityStage class instance first. Each UIAbility class defined in the HAP is associated with this class instance after instantiation. Through this class instance, you can obtain the runtime information of the UIAbility instances in the HAP.
......
......@@ -5,10 +5,25 @@
UIAbility is a type of application component that provides the UI for user interaction.
UIAbility is the basic unit scheduled by the system and provides a window for applications to draw UIs. An application can contain one or more UIAbility components. For example, for a payment application, you can use two UIAbility components to carry the entry and payment functionalities. You are advised to use one UIAbility component to carry the same functional module, with multiple pages (if necessary).
The following design philosophy is behind UIAbility:
1. Native support for [cross-device migration](hop-cross-device-migration.md) and [multi-device collaboration](hop-multi-device-collaboration.md) at the application component level
2. Support for multiple device types and window forms
For details, see [Interpretation of the Application Model](application-model-description.md).
The UIAbility division principles and suggestions are as follows:
UIAbility is the basic unit scheduled by the system and provides a window for applications to draw UIs. An application can contain one or more UIAbility components. For example, for a payment application, you can use two UIAbility components to carry the entry and payment functionalities.
Each UIAbility component instance is displayed as a mission in Recents.
You can develop a single UIAbility or multiple UIAbilities for your application based on service requirements.
- If you want only one mission to be displayed in Recents, use one UIAbility and multiple pages.
- If you want multiple missions to be displayed in Recents or multiple windows to be opened simultaneously, use multiple UIAbilities.
## Privacy Statement Configuration
......
......@@ -173,6 +173,7 @@
- [@ohos.promptAction (Prompt)](js-apis-promptAction.md)
- [@ohos.router (Page Routing)](js-apis-router.md)
- [@ohos.measure (Text Measurement)](js-apis-measure.md)
- [@ohos.uiAppearance (UI Appearance)](js-apis-uiappearance.md)
- Graphics
- [@ohos.animation.windowAnimationManager (Window Animation Management)](js-apis-windowAnimationManager.md)
......@@ -227,7 +228,7 @@
- [@ohos.data.dataShareResultSet (DataShare Result Set)](js-apis-data-DataShareResultSet.md)
- [@ohos.data.distributedDataObject (Distributed Data Object)](js-apis-data-distributedobject.md)
- [@ohos.data.distributedKVStore (Distributed KV Store)](js-apis-distributedKVStore.md)
- [@ohos.data.preferences (Preferences)](js-apis-data-preferences.md)
- [@ohos.data.preferences (User Preferences)](js-apis-data-preferences.md)
- [@ohos.data.relationalStore (RDB Store)](js-apis-data-relationalStore.md)
- [@ohos.data.ValuesBucket (Value Bucket)](js-apis-data-valuesBucket.md)
......@@ -266,6 +267,7 @@
- [@ohos.request (Upload and Download)](js-apis-request.md)
- Connectivity
- [@ohos.bluetooth (Bluetooth)(To Be Deprecated Soon)](js-apis-bluetooth.md)
- [@ohos.bluetoothManager (Bluetooth)(js-apis-bluetoothManager.md)
- [@ohos.connectedTag (Active Tags)](js-apis-connectedTag.md)
- [@ohos.nfc.cardEmulation (Standard NFC Card Emulation)](js-apis-cardEmulation.md)
......@@ -274,8 +276,8 @@
- [@ohos.rpc (RPC)](js-apis-rpc.md)
- [@ohos.wifiManager (WLAN)](js-apis-wifiManager.md)
- [@ohos.wifiManagerExt (WLAN Extension)](js-apis-wifiManagerExt.md)
- [@ohos.wifi (To Be Deprecated Soon)](js-apis-wifi.md)
- [@ohos.wifiext (To Be Deprecated Soon)](js-apis-wifiext.md)
- [@ohos.wifi (WLAN)(To Be Deprecated Soon)](js-apis-wifi.md)
- [@ohos.wifiext (WLAN Extension)(To Be Deprecated Soon)](js-apis-wifiext.md)
- tag
- [nfctech (Standard NFC Technologies)](js-apis-nfctech.md)
- [tagSession (Standard NFC Tag Session)](js-apis-tagSession.md)
......@@ -340,7 +342,7 @@
- [@ohos.systemParameterEnhance (System Parameter)](js-apis-system-parameterEnhance.md)
- [@ohos.thermal (Thermal Management)](js-apis-thermal.md)
- [@ohos.update (Update)](js-apis-update.md)
- [@ohos.usbManager (USB Management)](js-apis-usbManager.md)
- [@ohos.usbManager (USB Manager)](js-apis-usbManager.md)
- [@ohos.vibrator (Vibrator)](js-apis-vibrator.md)
- Account Management
......@@ -390,7 +392,6 @@
- APIs No Longer Maintained
- [@ohos.backgroundTaskManager (Background Task Management)](js-apis-backgroundTaskManager.md)
- [@ohos.bluetooth (Bluetooth)](js-apis-bluetooth.md)
- [@ohos.bundle (Bundle)](js-apis-Bundle.md)
- [@ohos.bundle.innerBundleManager (innerBundleManager)](js-apis-Bundle-InnerBundleManager.md)
- [@ohos.bundleState (Device Usage Statistics)](js-apis-deviceUsageStatistics.md)
......
......@@ -79,7 +79,7 @@ try {
}
});
} catch (paramError) {
console.error('error.code: ${JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)}');
console.error('error.code: ${paramError.code}, error.message: ${paramError.message}');
}
```
......@@ -135,7 +135,7 @@ try {
console.error('updateConfiguration fail, err: ${JSON.stringify(err)}');
});
} catch (paramError) {
console.error('error.code: ${JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)}');
console.error('error.code: ${paramError.code}, error.message: ${paramError.message}');
}
```
......@@ -177,7 +177,7 @@ try {
}
});
} catch (paramError) {
console.error('error.code: ${JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)}');
console.error('error.code: ${paramError.code}, error.message: ${paramError.message}');
}
```
......@@ -217,7 +217,7 @@ try {
console.error('getAbilityRunningInfos fail, err: ${JSON.stringify(err)}');
});
} catch (paramError) {
console.error('error.code: ${JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)}');
console.error('error.code: ${paramError.code}, error.message: ${paramError.message}');
}
```
......@@ -262,7 +262,7 @@ try {
}
});
} catch (paramError) {
console.error('error.code: ${JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)}');
console.error('error.code: ${paramError.code}, error.message: ${paramError.message}');
}
```
......@@ -310,7 +310,7 @@ try {
console.error('getExtensionRunningInfos fail, err: ${JSON.stringify(err)}');
});
} catch (paramError) {
console.error('error.code: ${JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)}');
console.error('error.code: ${paramError.code}, error.message: ${paramError.message}');
}
```
......
......@@ -306,7 +306,7 @@ Obtains the information about a given mission. This API uses an asynchronous cal
missionManager.getMissionInfo('', testMissionId, (error, mission) => {
if (error) {
console.error('getMissionInfo failed, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}');
console.error('getMissionInfo failed, error.code: ${error.code}, error.message: ${error.message}');
} else {
console.log('mission.missionId = ${mission.missionId}');
console.log('mission.runningState = ${mission.runningState}');
......@@ -392,7 +392,7 @@ Obtains information about all missions. This API uses an asynchronous callback t
try {
missionManager.getMissionInfos('', 10, (error, missions) => {
if (error) {
console.error('getMissionInfos failed, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}');
console.error('getMissionInfos failed, error.code: ${error.code}, error.message: ${error.message}');
} else {
console.log('size = ${missions.length}');
console.log('missions = ${JSON.stringify(missions)}');
......
......@@ -33,7 +33,7 @@ import StartOptions from '@ohos.app.ability.StartOptions';
try {
missionManager.getMissionInfos('', 10, (error, missions) => {
if (error.code) {
console.error('getMissionInfos failed, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}');
console.error('getMissionInfos failed, error.code: ${error.code}, error.message: ${error.message}');
return;
}
console.log('size = ${missions.length}');
......
......@@ -375,10 +375,10 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error
console.log('Caller call() called');
})
.catch((callErr) => {
console.log('Caller.call catch error, error.code: ${JSON.stringify(callErr.code)}, error.message: ${JSON.stringify(callErr.message)}');
console.log('Caller.call catch error, error.code: ${callErr.code}, error.message: ${callErr.message}');
});
}).catch((err) => {
console.log('Caller GetCaller error, error.code: ${JSON.stringify(err.code)}, error.message: ${JSON.stringify(err.message)}');
console.log('Caller GetCaller error, error.code: ${err.code}, error.message: ${err.message}');
});
}
}
......@@ -456,10 +456,10 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error
data.readParcelable(retmsg);
})
.catch((callErr) => {
console.log('Caller.callWithResult catch error, error.code: ${JSON.stringify(callErr.code)}, error.message: ${JSON.stringify(callErr.message)}');
console.log('Caller.callWithResult catch error, error.code: ${callErr.code}, error.message: ${callErr.message}');
});
}).catch((err) => {
console.log('Caller GetCaller error, error.code: ${JSON.stringify(err.code)}, error.message: ${JSON.stringify(err.message)}');
console.log('Caller GetCaller error, error.code: ${err.code}, error.message: ${err.message}');
});
}
}
......@@ -498,10 +498,10 @@ Releases the caller interface of the target ability.
try {
caller.release();
} catch (releaseErr) {
console.log('Caller.release catch error, error.code: ${JSON.stringify(releaseErr.code)}, error.message: ${JSON.stringify(releaseErr.message)}');
console.log('Caller.release catch error, error.code: ${releaseErr.code}, error.message: ${releaseErr.message}');
}
}).catch((err) => {
console.log('Caller GetCaller error, error.code: ${JSON.stringify(err.code)}, error.message: ${JSON.stringify(err.message)}');
console.log('Caller GetCaller error, error.code: ${err.code}, error.message: ${err.message}');
});
}
}
......@@ -538,10 +538,10 @@ Registers a callback that is invoked when the stub on the target ability is disc
console.log(' Caller OnRelease CallBack is called ${str}');
});
} catch (error) {
console.log('Caller.onRelease catch error, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}');
console.log('Caller.onRelease catch error, error.code: ${error.code}, error.message: ${error.message}');
}
}).catch((err) => {
console.log('Caller GetCaller error, error.code: ${JSON.stringify(err.code)}, error.message: ${JSON.stringify(err.message)}');
console.log('Caller GetCaller error, error.code: ${err.code}, error.message: ${err.message}');
});
}
}
......@@ -587,10 +587,10 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error
console.log(' Caller OnRelease CallBack is called ${str}');
});
} catch (error) {
console.log('Caller.on catch error, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}');
console.log('Caller.on catch error, error.code: ${error.code}, error.message: ${error.message}');
}
}).catch((err) => {
console.log('Caller GetCaller error, error.code: ${JSON.stringify(err.code)}, error.message: ${JSON.stringify(err.message)}');
console.log('Caller GetCaller error, error.code: ${err.code}, error.message: ${err.message}');
});
}
}
......@@ -637,10 +637,10 @@ For other IDs, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
caller.on('release', onReleaseCallBack);
caller.off('release', onReleaseCallBack);
} catch (error) {
console.log('Caller.on or Caller.off catch error, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}');
console.log('Caller.on or Caller.off catch error, error.code: ${error.code}, error.message: ${error.message}');
}
}).catch((err) => {
console.log('Caller GetCaller error, error.code: ${JSON.stringify(err.code)}, error.message: ${JSON.stringify(err.message)}');
console.log('Caller GetCaller error, error.code: ${err.code}, error.message: ${err.message}');
});
}
}
......@@ -686,10 +686,10 @@ For other IDs, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
caller.on('release', onReleaseCallBack);
caller.off('release');
} catch (error) {
console.error('Caller.on or Caller.off catch error, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}');
console.error('Caller.on or Caller.off catch error, error.code: ${error.code}, error.message: ${error.message}');
}
}).catch((err) => {
console.error('Caller GetCaller error, error.code: ${JSON.stringify(err.code)}, error.message: ${JSON.stringify(err.message)}');
console.error('Caller GetCaller error, error.code: ${err.code}, error.message: ${err.message}');
});
}
}
......@@ -759,7 +759,7 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error
try {
this.callee.on(method, funcCallBack);
} catch (error) {
console.log('Callee.on catch error, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}');
console.log('Callee.on catch error, error.code: ${error.code}, error.message: ${error.message}');
}
}
}
......@@ -798,7 +798,7 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error
try {
this.callee.off(method);
} catch (error) {
console.log('Callee.off catch error, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}');
console.log('Callee.off catch error, error.code: ${error.code}, error.message: ${error.message}');
}
}
}
......
......@@ -186,10 +186,10 @@ try {
WantAgent.getWantAgent(wantAgentInfo).then((data) => {
wantAgent = data;
}).catch((err) => {
console.error('getWantAgent failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('getWantAgent failed! ${err.code} ${err.message}');
});
} catch (err) {
console.error('getWantAgent failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('getWantAgent failed! ${err.code} ${err.message}');
}
```
......@@ -280,7 +280,7 @@ function getWantAgentCallback(err, data) {
// getBundleName callback
function getBundleNameCallback(err, data) {
if(err) {
console.error('getBundleName failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('getBundleName failed! ${err.code} ${err.message}');
} else {
console.info('getBundleName ok! ${JSON.stringify(data)}');
}
......@@ -288,13 +288,13 @@ function getWantAgentCallback(err, data) {
try {
WantAgent.getBundleName(wantAgent, getBundleNameCallback);
} catch(err) {
console.error('getBundleName failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('getBundleName failed! ${err.code} ${err.message}');
}
}
try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) {
console.error('getWantAgent failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('getWantAgent failed! ${err.code} ${err.message}');
}
```
......@@ -391,16 +391,16 @@ function getWantAgentCallback(err, data) {
WantAgent.getBundleName(wantAgent).then((data)=>{
console.info('getBundleName ok! ${JSON.stringify(data)}');
}).catch((err)=>{
console.error('getBundleName failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('getBundleName failed! ${err.code} ${err.message}');
});
} catch(err){
console.error('getBundleName failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('getBundleName failed! ${err.code} ${err.message}');
}
}
try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) {
console.error('getWantAgent failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('getWantAgent failed! ${err.code} ${err.message}');
}
```
......@@ -492,7 +492,7 @@ function getWantAgentCallback(err, data) {
// getUid callback
function getUidCallback(err, data) {
if(err) {
console.error('getUid failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('getUid failed! ${err.code} ${err.message}');
} else {
console.info('getUid ok! ${JSON.stringify(data)}');
}
......@@ -500,13 +500,13 @@ function getWantAgentCallback(err, data) {
try {
WantAgent.getUid(wantAgent, getUidCallback);
} catch(err) {
console.error('getUid failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('getUid failed! ${err.code} ${err.message}');
}
}
try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) {
console.error('getWantAgent failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('getWantAgent failed! ${err.code} ${err.message}');
}
```
......@@ -603,16 +603,16 @@ function getWantAgentCallback(err, data) {
WantAgent.getUid(wantAgent).then((data)=>{
console.info('getUid ok! ${JSON.stringify(data)}');
}).catch((err)=>{
console.error('getUid failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('getUid failed! ${err.code} ${err.message}');
});
} catch(err){
console.error('getUid failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('getUid failed! ${err.code} ${err.message}');
}
}
try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) {
console.error('getWantAgent failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('getWantAgent failed! ${err.code} ${err.message}');
}
```
......@@ -704,7 +704,7 @@ function getWantAgentCallback(err, data) {
// getWant callback
function getWantCallback(err, data) {
if(err) {
console.error('getWant failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('getWant failed! ${err.code} ${err.message}');
} else {
console.info('getWant ok! ${JSON.stringify(data)}');
}
......@@ -712,13 +712,13 @@ function getWantAgentCallback(err, data) {
try {
WantAgent.getWant(wantAgent, getWantCallback);
} catch(err) {
console.error('getWant failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('getWant failed! ${err.code} ${err.message}');
}
}
try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) {
console.error('getWantAgent failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('getWantAgent failed! ${err.code} ${err.message}');
}
```
......@@ -817,16 +817,16 @@ function getWantAgentCallback(err, data) {
WantAgent.getUid(wantAgent).then((data)=>{
console.info('getUid ok! ${JSON.stringify(data)}');
}).catch((err)=>{
console.error('getUid failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('getUid failed! ${err.code} ${err.message}');
});
} catch(err){
console.error('getUid failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('getUid failed! ${err.code} ${err.message}');
}
}
try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) {
console.error('getWantAgent failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('getWantAgent failed! ${err.code} ${err.message}');
}
```
......@@ -917,7 +917,7 @@ function getWantAgentCallback(err, data) {
// cancel callback
function cancelCallback(err, data) {
if(err) {
console.error('cancel failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('cancel failed! ${err.code} ${err.message}');
} else {
console.info('cancel ok!');
}
......@@ -925,13 +925,13 @@ function getWantAgentCallback(err, data) {
try {
WantAgent.cancel(wantAgent, cancelCallback);
} catch(err) {
console.error('cancel failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('cancel failed! ${err.code} ${err.message}');
}
}
try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) {
console.error('getWantAgent failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('getWantAgent failed! ${err.code} ${err.message}');
}
```
......@@ -1028,16 +1028,16 @@ function getWantAgentCallback(err, data) {
WantAgent.cancel(wantAgent).then((data)=>{
console.info('cancel ok!');
}).catch((err)=>{
console.error('cancel failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('cancel failed! ${err.code} ${err.message}');
});
} catch(err){
console.error('cancel failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('cancel failed! ${err.code} ${err.message}');
}
}
try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) {
console.error('getWantAgent failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('getWantAgent failed! ${err.code} ${err.message}');
}
```
......@@ -1131,7 +1131,7 @@ function getWantAgentCallback(err, data) {
// trigger callback
function triggerCallback(err, data) {
if(err) {
console.error('getUid failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('getUid failed! ${err.code} ${err.message}');
} else {
console.info('getUid ok! ${JSON.stringify(data)}');
}
......@@ -1139,13 +1139,13 @@ function getWantAgentCallback(err, data) {
try {
WantAgent.trigger(wantAgent, triggerInfo, triggerCallback);
} catch(err) {
console.error('getUid failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('getUid failed! ${err.code} ${err.message}');
}
}
try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) {
console.error('getWantAgent failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('getWantAgent failed! ${err.code} ${err.message}');
}
```
......@@ -1239,7 +1239,7 @@ function getWantAgentCallback(err, data) {
// equal callback
function equalCallback(err, data) {
if(err) {
console.error('equal failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('equal failed! ${err.code} ${err.message}');
} else {
console.info('equal ok! ${JSON.stringify(data)}');
}
......@@ -1247,13 +1247,13 @@ function getWantAgentCallback(err, data) {
try {
WantAgent.equal(wantAgent1,wantAgent2,equalCallback);
} catch(err) {
console.error('equal failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('equal failed! ${err.code} ${err.message}');
}
}
try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) {
console.error('getWantAgent failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('getWantAgent failed! ${err.code} ${err.message}');
}
```
......@@ -1353,16 +1353,16 @@ function getWantAgentCallback(err, data) {
WantAgent.equal(wantAgent1,wantAgent2).then((data)=>{
console.info('equal ok! ${JSON.stringify(data)}');
}).catch((err)=>{
console.error('equal failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('equal failed! ${err.code} ${err.message}');
})
} catch(err){
console.error('equal failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('equal failed! ${err.code} ${err.message}');
}
}
try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) {
console.error('getWantAgent failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('getWantAgent failed! ${err.code} ${err.message}');
}
```
......@@ -1451,7 +1451,7 @@ function getWantAgentCallback(err, data) {
// getOperationTypeCallback callback
function getOperationTypeCallback(err, data) {
if(err) {
console.error('getOperationType failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('getOperationType failed! ${err.code} ${err.message}');
} else {
console.info('getOperationType ok! ${JSON.stringify(data)}');
}
......@@ -1459,13 +1459,13 @@ function getWantAgentCallback(err, data) {
try {
WantAgent.getOperationTypeCallback(wantAgent, getOperationTypeCallback);
} catch(err) {
console.error('getOperationTypeCallback failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('getOperationTypeCallback failed! ${err.code} ${err.message}');
}
}
try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) {
console.error('getWantAgent failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('getWantAgent failed! ${err.code} ${err.message}');
}
```
......@@ -1560,16 +1560,16 @@ function getWantAgentCallback(err, data) {
WantAgent.getOperationType(wantAgent).then((data)=>{
console.info('getOperationType ok! ${JSON.stringify(data)}');
}).catch((err)=>{
console.error('getOperationType failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('getOperationType failed! ${err.code} ${err.message}');
});
} catch(err){
console.error('getOperationType failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('getOperationType failed! ${err.code} ${err.message}');
}
}
try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) {
console.error('getWantAgent failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}');
console.error('getWantAgent failed! ${err.code} ${err.message}');
}
```
......
......@@ -170,7 +170,7 @@ Obtains the information about a given mission. This API uses an asynchronous cal
let allMissions=missionManager.getMissionInfos('',10).catch(function(err){console.log(err);});
missionManager.getMissionInfo('', allMissions[0].missionId, (error, mission) => {
if (error.code) {
console.error('getMissionInfo failed, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}');
console.error('getMissionInfo failed, error.code: ${error.code}, error.message: ${error.message}');
return;
}
......@@ -247,7 +247,7 @@ Obtains information about all missions. This API uses an asynchronous callback t
missionManager.getMissionInfos('', 10, (error, missions) => {
if (error.code) {
console.error('getMissionInfos failed, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}');
console.error('getMissionInfos failed, error.code: ${error.code}, error.message: ${error.message}');
return;
}
console.log('size = ${missions.length}');
......@@ -319,7 +319,7 @@ Obtains the snapshot of a given mission. This API uses an asynchronous callback
missionManager.getMissionInfos('', 10, (error, missions) => {
if (error.code) {
console.error('getMissionInfos failed, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}');
console.error('getMissionInfos failed, error.code: ${error.code}, error.message: ${error.message}');
return;
}
console.log('size = ${missions.length}');
......@@ -328,7 +328,7 @@ Obtains the snapshot of a given mission. This API uses an asynchronous callback
missionManager.getMissionSnapShot('', id, (error, snapshot) => {
if (error.code) {
console.error('getMissionSnapShot failed, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}');
console.error('getMissionSnapShot failed, error.code: ${error.code}, error.message: ${error.message}');
return;
}
console.log('bundleName = ${snapshot.ability.bundleName}');
......@@ -408,7 +408,7 @@ Locks a given mission. This API uses an asynchronous callback to return the resu
missionManager.getMissionInfos('', 10, (error, missions) => {
if (error.code) {
console.error('getMissionInfos failed, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}');
console.error('getMissionInfos failed, error.code: ${error.code}, error.message: ${error.message}');
return;
}
console.log('size = ${missions.length}');
......@@ -492,7 +492,7 @@ Unlocks a given mission. This API uses an asynchronous callback to return the re
missionManager.getMissionInfos('', 10, (error, missions) => {
if (error.code) {
console.error('getMissionInfos failed, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}');
console.error('getMissionInfos failed, error.code: ${error.code}, error.message: ${error.message}');
return;
}
console.log('size = ${missions.length}');
......@@ -580,7 +580,7 @@ Clears a given mission, regardless of whether it is locked. This API uses an asy
missionManager.getMissionInfos('', 10, (error, missions) => {
if (error.code) {
console.error('getMissionInfos failed, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}');
console.error('getMissionInfos failed, error.code: ${error.code}, error.message: ${error.message}');
return;
}
console.log('size = ${missions.length}');
......@@ -716,7 +716,7 @@ Switches a given mission to the foreground. This API uses an asynchronous callba
missionManager.getMissionInfos('', 10, (error, missions) => {
if (error.code) {
console.error('getMissionInfos failed, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}');
console.error('getMissionInfos failed, error.code: ${error.code}, error.message: ${error.message}');
return;
}
console.log('size = ${missions.length}');
......@@ -757,7 +757,7 @@ Switches a given mission to the foreground, with the startup parameters for the
missionManager.getMissionInfos('', 10, (error, missions) => {
if (error.code) {
console.error('getMissionInfos failed, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}');
console.error('getMissionInfos failed, error.code: ${error.code}, error.message: ${error.message}');
return;
}
console.log('size = ${missions.length}');
......
......@@ -547,7 +547,7 @@ startBluetoothDiscovery(): void
Starts Bluetooth scan to discover remote devices.
**Rquired permissions**: ohos.permission.DISCOVER_BLUETOOTH and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION
**Required permissions**: ohos.permission.DISCOVER_BLUETOOTH and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION
**System capability**: SystemCapability.Communication.Bluetooth.Core
......@@ -652,6 +652,98 @@ try {
```
## bluetoothManager.setDevicePinCode<sup>10+</sup><a name="setDevicePinCode"></a>
setDevicePinCode(device: string, code: string, callback: AsyncCallback&lt;void&gt;): void
Sets the PIN for the device when [PinType](#pintype10) is **PIN_TYPE_ENTER_PIN_CODE** or **PIN_TYPE_PIN_16_DIGITS**.
**Required permissions**: ohos.permission.MANAGE_BLUETOOTH
**System capability**: SystemCapability.Communication.Bluetooth.Core
**Parameters**
| Name | Type | Mandatory | Description |
| ------ | ------- | ---- | -------------------------------- |
| device | string | Yes | MAC address of the remote device, for example, XX:XX:XX:XX:XX:XX.|
| code | string | Yes | PIN to set. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked to return the result. If the operation is successful, **err** is **undefined**. Otherwise, **err** is an error object. |
**Error codes**
For details about the error codes, see [Bluetooth Error Codes](../errorcodes/errorcode-bluetoothManager.md).
| ID| Error Message|
| -------- | ---------------------------- |
|2900001 | Service stopped. |
|2900003 | Bluetooth switch is off. |
|2900099 | Operation failed. |
**Example**
```js
//callback
try {
bluetoothManager.setDevicePinCode('11:22:33:44:55:66', '12345', (err, data) => {
console.info('setDevicePinCode,device name err:' + JSON.stringify(err) + ',device name:' + JSON.stringify(data));
});
} catch (err) {
console.error("errCode:" + err.code + ",errMessage:" + err.message);
}
```
## bluetoothManager.setDevicePinCode<sup>10+</sup><a name="setDevicePinCode"></a>
setDevicePinCode(device: string, code: string): Promise&lt;void&gt;
Sets the PIN for the device when [PinType](#pintype10) is **PIN_TYPE_ENTER_PIN_CODE** or **PIN_TYPE_PIN_16_DIGITS**. This API uses a promise to return the result.
**Required permissions**: ohos.permission.MANAGE_BLUETOOTH
**System capability**: SystemCapability.Communication.Bluetooth.Core
**Parameters**
| Name | Type | Mandatory | Description |
| ------ | ------- | ---- | -------------------------------- |
| device | string | Yes | MAC address of the remote device, for example, XX:XX:XX:XX:XX:XX.|
| code | string | Yes | PIN to set. |
**Return value**
| Type | Description |
| ------------------- | ------------- |
| Promise&lt;void&gt; | Promise used to return the result.|
**Error codes**
For details about the error codes, see [Bluetooth Error Codes](../errorcodes/errorcode-bluetoothManager.md).
| ID| Error Message|
| -------- | ---------------------------- |
|2900001 | Service stopped. |
|2900003 | Bluetooth switch is off. |
|2900099 | Operation failed. |
**Example**
```js
//promise
try {
bluetoothManager.setDevicePinCode('11:22:33:44:55:66', '12345').then(() => {
console.info('setDevicePinCode');
}, error => {
console.info('setDevicePinCode: errCode:' + error.code + ',errMessage' + error.message);
})
} catch (err) {
console.error("errCode:" + err.code + ",errMessage:" + err.message);
}
```
## bluetoothManager.on('bluetoothDeviceFind')
on(type: "bluetoothDeviceFind", callback: Callback&lt;Array&lt;string&gt;&gt;): void
......@@ -1385,7 +1477,7 @@ Creates a **GattServer** instance.
| Type | Description |
| ------------------------- | ------------------------------------ |
| [GattServer](#gattserver) | **GattServer** instance created. Before using an API of the server, you must create a **GattSever** instance.|
| [GattServer](#gattserver) | **GattServer** instance created. Before using an API of this class, you must create a **GattSever** instance.|
**Example**
......@@ -2333,17 +2425,6 @@ Obtains the network sharing status.
| --------------------- | --------------------------------- |
| boolean | Returns **true** if tethering is available over a Bluetooth PAN; return **false** otherwise.|
**Error codes**
For details about the error codes, see [Bluetooth Error Codes](../errorcodes/errorcode-bluetoothManager.md).
| ID| Error Message|
| -------- | ---------------------------- |
|2900001 | Service stopped. |
|2900003 | Bluetooth switch is off. |
|2900004 | Profile is not supported. |
|2900099 | Operation failed. |
**Example**
```js
......@@ -3258,7 +3339,7 @@ For details about the error codes, see [Bluetooth Error Codes](../errorcodes/err
| ID| Error Message|
| -------- | ---------------------------- |
|2900001 | Service stopped. |
|2901000 | Read forbidden. |
|2901000 | Read forbidden. |
|2900099 | Operation failed. |
**Example**
......@@ -3327,7 +3408,7 @@ For details about the error codes, see [Bluetooth Error Codes](../errorcodes/err
| ID| Error Message|
| -------- | ---------------------------- |
|2900001 | Service stopped. |
|2901000 | Read forbidden. |
|2901000 | Read forbidden. |
|2900099 | Operation failed. |
**Example**
......@@ -3382,7 +3463,7 @@ For details about the error codes, see [Bluetooth Error Codes](../errorcodes/err
| ID| Error Message|
| -------- | ---------------------------- |
|2900001 | Service stopped. |
|2901000 | Read forbidden. |
|2901000 | Read forbidden. |
|2900099 | Operation failed. |
**Example**
......@@ -3444,7 +3525,7 @@ For details about the error codes, see [Bluetooth Error Codes](../errorcodes/err
| ID| Error Message|
| -------- | ---------------------------- |
|2900001 | Service stopped. |
|2901000 | Read forbidden. |
|2901000 | Read forbidden. |
|2900099 | Operation failed. |
**Example**
......@@ -3491,7 +3572,7 @@ For details about the error codes, see [Bluetooth Error Codes](../errorcodes/err
| ID| Error Message|
| -------- | ---------------------------- |
|2900001 | Service stopped. |
|2901001 | Write forbidden. |
|2901001 | Write forbidden. |
|2900099 | Operation failed. |
**Example**
......@@ -3545,7 +3626,7 @@ For details about the error codes, see [Bluetooth Error Codes](../errorcodes/err
| ID| Error Message|
| -------- | ---------------------------- |
|2900001 | Service stopped. |
|2901001 | Write forbidden. |
|2901001 | Write forbidden. |
|2900099 | Operation failed. |
**Example**
......@@ -4016,17 +4097,18 @@ Defines the characteristic API parameters.
**System capability**: SystemCapability.Communication.Bluetooth.Core
| Name | Type | Readable | Writable | Description |
| Name | Type | Readable | Writable | Description |
| ------------------- | ---------------------------------------- | ---- | ---- | ---------------------------------------- |
| serviceUuid | string | Yes | Yes | UUID of the service, for example, **00001888-0000-1000-8000-00805f9b34fb**.|
| characteristicUuid | string | Yes | Yes | UUID of the characteristic, for example, **00002a11-0000-1000-8000-00805f9b34fb**.|
| characteristicValue | ArrayBuffer | Yes | Yes | Binary value of the characteristic. |
| descriptors | Array&lt;[BLEDescriptor](#bledescriptor)&gt; | Yes | Yes | List of descriptors of the characteristic. |
| characteristicValue | ArrayBuffer | Yes | Yes | Binary value of the characteristic. |
| descriptors | Array&lt;[BLEDescriptor](#bledescriptor)&gt; | Yes | Yes | List of descriptors of the characteristic. |
| properties<sup>10+</sup> | [GattProperties](#gattproperties10) | Yes | Yes | Properties of the characteristic. |
## BLEDescriptor
Defines the descriptor API parameters.
Defines the BLE descriptor.
**System capability**: SystemCapability.Communication.Bluetooth.Core
......@@ -4229,6 +4311,7 @@ Defines the scan result.
| deviceId | string | Yes | No | Address of the scanned device, for example, XX:XX:XX:XX:XX:XX.|
| rssi | number | Yes | No | RSSI of the device. |
| data | ArrayBuffer | Yes | No | Advertisement packets sent by the device. |
| deviceName<sup>10+</sup> | string | Yes | No | Name of the device detected. |
## BluetoothState
......@@ -4308,6 +4391,7 @@ Defines the pairing request parameters.
| -------- | ------ | ---- | ---- | ----------- |
| deviceId | string | Yes | No | ID of the device to pair.|
| pinCode | string | Yes | No | Key for the device pairing. |
| pinType<sup>10+</sup> | [PinType](#pintype10) | Yes | No | Type of the device to pair. |
## BondStateParam<a name="BondStateParam"></a>
......@@ -4334,6 +4418,21 @@ Defines the profile state change parameters.
| state | [ProfileConnectionState](#profileconnectionstate) | Yes | No | Profile connection state of the device.|
## GattProperties<sup>10+</sup><a name="GattProperties"></a>
Defines the properties of a GATT characteristic.
**System capability**: SystemCapability.Communication.Bluetooth.Core
| Name | Type | Read-only | Mandatory | Description |
| -------- | ------ | ---- | ---- | ----------- |
| write<sup>10+</sup> | boolean | Yes | Yes | Permits writes of the characteristic value (with a response).|
| writeNoResponse<sup>10+</sup> | boolean | Yes | Yes | Permits writes of the characteristic value (without a response).|
| read<sup>10+</sup> | boolean | Yes | Yes | Permits reads of the characteristic value.|
| notify<sup>10+</sup> | boolean | Yes | Yes | Permits notifications of the characteristic value.|
| indicate<sup>10+</sup> | boolean | Yes | Yes | Permits notifications of the characteristic value without acknowledgement.|
## DeviceClass<a name="DeviceClass"></a>
Defines the class of a Bluetooth device.
......@@ -4347,7 +4446,6 @@ Defines the class of a Bluetooth device.
| classOfDevice | number | Yes | No | Class of the device. |
## MajorClass<a name="MajorClass"></a>
Enumerates the major classes of Bluetooth devices.
......@@ -4489,3 +4587,21 @@ Enumerates the Bluetooth profiles. API version 9 is added with **PROFILE_HID_HOS
| PROFILE_HANDS_FREE_AUDIO_GATEWAY | 4 | HFP profile. |
| PROFILE_HID_HOST | 6 | Human Interface Device (HID) profile. |
| PROFILE_PAN_NETWORK | 7 | PAN profile. |
## PinType<sup>10+</sup><a name="PinType"></a>
Enumerates the Bluetooth pairing types.
**System capability**: SystemCapability.Communication.Bluetooth.Core
| Name | Value | Description |
| -------------------------------- | ------ | --------------- |
| PIN_TYPE_ENTER_PIN_CODE<sup>10+</sup> | 0 | The user needs to enter the PIN displayed on the peer device.|
| PIN_TYPE_ENTER_PASSKEY<sup>10+</sup> | 1 | The user needs to enter the PASSKEY displayed on the peer device. |
| PIN_TYPE_CONFIRM_PASSKEY<sup>10+</sup> | 2 | The user needs to confirm the PASSKEY displayed on the local device. |
| PIN_TYPE_NO_PASSKEY_CONSENT<sup>10+</sup> | 3 | There is no PASSKEY, and the user needs to accept or reject the pairing request. |
| PIN_TYPE_NOTIFY_PASSKEY<sup>10+</sup> | 4 | The user needs to enter the PASSKEY displayed on the local device on the peer device. |
| PIN_TYPE_DISPLAY_PIN_CODE<sup>10+</sup> | 5 | The user needs to enter the PIN displayed on the peer device for Bluetooth 2.0 devices. |
| PIN_TYPE_OOB_CONSENT<sup>10+</sup> | 6 | The user needs to accept or reject the out of band (OOB) pairing request. |
| PIN_TYPE_PIN_16_DIGITS<sup>10+</sup> | 7 | The user needs to enter the 16-digit PIN displayed on the peer device. |
......@@ -5,6 +5,8 @@ The **BundlePackInfo** module provides information in the **pack.info** file. Th
> **NOTE**
>
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>
> The APIs provided by this module are system APIs.
## BundlePackInfo
......@@ -63,10 +65,10 @@ The **BundlePackInfo** module provides information in the **pack.info** file. Th
| ------------------ | ------------------------------------------------- | ---- | ---- | ---------------------------------- |
| mainAbility | string | Yes| No| Name of the main ability.|
| apiVersion | [ApiVersion](#apiversion) | Yes | No | API version of the module. |
| deviceType | Array\<string> | Yes | No | Device types supported by the module. |
| deviceTypes | Array\<string> | Yes | No | Device types supported by the module. |
| distro | [ModuleDistroInfo](#moduledistroinfo) | Yes | No | Distribution information of the module. |
| abilities | Array\<[ModuleAbilityInfo](#moduleabilityinfo)> | Yes | No | Ability information of the module. |
| extensionAbilities | Array\<[ExtensionAbilities](#extensionability)> | Yes | No | ExtensionAbility information of the module.|
| extensionAbilities | Array\<[ExtensionAbility](#extensionability)> | Yes | No | ExtensionAbility information of the module.|
## ModuleDistroInfo
......@@ -123,7 +125,7 @@ The **BundlePackInfo** module provides information in the **pack.info** file. Th
## ApiVersion
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**System capability**: SystemCapability.BundleManager.BundleFrameWork.FreeInstall
......
......@@ -32,3 +32,4 @@ The **ApplicationInfo** module defines the application information. A system app
| appDistributionType | string | Yes | No | Distribution type of the application signing certificate. The options are **app_gallery**, **enterprise**, **os_integration**, and **crowdtesting**. |
| appProvisionType | string | Yes | No | Type of the application signing certificate file. The options are **debug** and **release**. |
| systemApp | boolean | Yes | No | Whether the application is a system application. |
| bundleType |[BundleType](js-apis-bundleManager.md#bundletype) | Yes | No | Bundle type, which can be **APP** (common application) or **ATOMIC_SERVICE** (atomic service). |
......@@ -26,3 +26,28 @@ The **HapModuleInfo** module defines the HAP module information. A system applic
| deviceTypes | Array\<string> | Yes | No | Types of devices where the module can run. |
| installationFree | boolean | Yes | No | Whether installation-free is supported. |
| hashValue | string | Yes | No | Hash value of the module. |
| moduleType | [ModuleType](js-apis-bundleManager.md#moduletype) | Yes | No | Type of the module. |
| preloads | Array\<[PreloadItem](#preloaditem)> | Yes | No | Preloaded modules in the atomic service.|
| dependencies | Array\<[Dependency](#dependency)> | Yes | No | Dynamic shared libraries on which the module depends. |
## PreloadItem
Describes the preloaded module information in the atomic service.
**System capability**: SystemCapability.BundleManager.BundleFramework.Core
| Name | Type | Readable| Writable| Description |
| --------- | -------------- | ---- | ---- | --------------------------- |
|moduleName | string | Yes | No | Name of the module automatically preloaded by the system.|
## Dependency
Describes the information about the dynamic shared library on which the module depends.
**System capability**: SystemCapability.BundleManager.BundleFramework.Core
| Name | Type | Readable| Writable| Description |
| ----------- | ------ | ---- | ---- | ---------------------- |
| bundleName | string | Yes | No | Name of the shared bundle on which the current module depends. |
| moduleName | string | Yes | No | Module name of the shared bundle on which the current module depends.|
| versionCode | number | Yes | No | Version number of the shared bundle. |
......@@ -49,7 +49,7 @@ Enumerates the application flags, which indicate the type of application informa
**System capability**: SystemCapability.BundleManager.BundleFramework.Core
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
| Name | Value | Description |
| ------------------------------------ | ---------- | ------------------------------------------------------------ |
......@@ -64,7 +64,7 @@ Enumerates the ability flags, which indicate the type of ability information to
**System capability**: SystemCapability.BundleManager.BundleFramework.Core
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
| Name | Value | Description |
| --------------------------------- | ---------- | ------------------------------------------------------------ |
......@@ -81,7 +81,7 @@ Enumerates the Extension ability flags, which indicate the type of Extension abi
**System capability**: SystemCapability.BundleManager.BundleFramework.Core
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
| Name | Value | Description |
| ------------------------------------------- | ---------- | ------------------------------------------------------------ |
......@@ -187,6 +187,39 @@ Enumerates the display orientations of the ability. This attribute applies only
| AUTO_ROTATION_PORTRAIT_RESTRICTED |11|Switched-determined auto rotation in the vertical direction.|
| LOCKED |12|Locked.|
### CompatiblePolicy
Defines the version compatibility type of the shared library.
**System capability**: SystemCapability.BundleManager.BundleFramework.Core
| Name | Value | Description |
| ---------------------- | ---- | -------------------------------- |
| BACKWARD_COMPATIBILITY | 1 | The shared library is backward compatible.|
### ModuleType
Enumerates the module types.
**System capability**: SystemCapability.BundleManager.BundleFramework.Core
| Name | Value | Description |
| ------- | ---- | -------------------- |
| ENTRY | 1 | Main module of the application. |
| FEATURE | 2 | Dynamic feature module of the application.|
| SHARED | 3 | Dynamic shared library module of the application. |
### BundleType
Enumerates the bundle types.
**System capability**: SystemCapability.BundleManager.BundleFramework.Core
| Name | Value | Description |
| -------------- | ---- | --------------- |
| APP | 0 | The bundle is a common application. |
| ATOMIC_SERVICE | 1 | The bundle is an atomic service.|
## APIs
### bundleManager.getBundleInfoForSelf
......@@ -1077,7 +1110,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ------------------------------------- |
| 17700001 | The specified bundleName is not found. |
| 17700003 | The specified extensionAbility is not found. |
| 17700003 | The specified ability is not found. |
| 17700004 | The specified userId is invalid. |
| 17700026 | The specified bundle is disabled. |
| 17700029 | The specified ability is disabled. |
......@@ -3036,47 +3069,3 @@ try {
hilog.error(0x0000, 'testTag', 'getAllSharedBundleInfo failed. Cause: %{public}s', err.message);
}
```
## CompatiblePolicy
Defines the version compatibility type of the shared library.
**System capability**: SystemCapability.BundleManager.BundleFramework.Core
| Name | Value | Description |
| ---------------------- | ---- | -------------------------------- |
| BACKWARD_COMPATIBILITY | 1 | The shared library is backward compatible.|
## ModuleType
Enumerates the module types.
**System capability**: SystemCapability.BundleManager.BundleFramework.Core
| Name | Value | Description |
| ------- | ---- | -------------------- |
| ENTRY | 1 | Main module of the application. |
| FEATURE | 2 | Dynamic feature module of the application.|
| SHARED | 3 | Dynamic shared library module of the application. |
## BundleType
Enumerates the bundle types.
**System capability**: SystemCapability.BundleManager.BundleFramework.Core
| Name | Value | Description |
| -------------- | ---- | --------------- |
| APP | 0 | The bundle is a common application. |
| ATOMIC_SERVICE | 1 | The bundle is an atomic service.|
## AtomicServiceModuleType
Enumerates the module types of an atomic service.
**System capability**: SystemCapability.BundleManager.BundleFramework.Core
| Name | Value | Description |
| ------ | ---- | --------------------------- |
| NORMAL | 0 | Page package in the atomic service. |
| MAIN | 1 | Landing page package in the atomic service.|
# @ohos.data.preferences (Preferences)
# @ohos.data.preferences (User Preferences)
The **Preferences** module provides APIs for processing data in the form of key-value (KV) pairs and supports persistence of the KV pairs when required.
The **user preferences** module provides APIs for processing data in the form of key-value (KV) pairs and supports persistence of the KV pairs when required.
The key is of the string type, and the value can be a number, a string, a Boolean value, or an array of numbers, strings, or Boolean values.
......@@ -176,12 +176,12 @@ The deleted **Preferences** instance cannot be used for data operations. Otherwi
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------- | ---- | ---------------------------------------------------- |
| context | Context | Yes | Application context.<br>For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).<br>For details about the application context of the stage model, see [Context](js-apis-inner-application-uiAbilityContext.md). |
| name | string | Yes | Name of the **Preferences** instance to delete. |
| name | string | Yes | Name of the **Preferences** instance to delete. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked to return the result. If the operation is successful, **err** is **undefined**. Otherwise, **err** is an error code.|
**Error codes**
For details about the following error codes, see [Preference Error Codes](../errorcodes/errorcode-preferences.md).
For details about the error codes, see [User Preference Error Codes](../errorcodes/errorcode-preferences.md).
| ID| Error Message |
| -------- | ------------------------------|
......@@ -213,6 +213,7 @@ Stage model:
```ts
import UIAbility from '@ohos.app.ability.UIAbility';
class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage) {
try {
......@@ -257,7 +258,7 @@ The deleted **Preferences** instance cannot be used for data operations. Otherwi
**Error codes**
For details about the following error codes, see [Preference Error Codes](../errorcodes/errorcode-preferences.md).
For details about the error codes, see [User Preference Error Codes](../errorcodes/errorcode-preferences.md).
| ID| Error Message |
| -------- | ------------------------------|
......@@ -288,6 +289,7 @@ Stage model:
```ts
import UIAbility from '@ohos.app.ability.UIAbility';
class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage) {
try{
......@@ -348,6 +350,7 @@ Stage model:
```ts
import UIAbility from '@ohos.app.ability.UIAbility';
class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage) {
try {
......@@ -500,7 +503,7 @@ try {
promise.then((data) => {
console.info("Got the value of 'startup'. Data: " + data);
}).catch((err) => {
console.info("Failed to get value of 'startup'. code =" + err.code + ", message =" + err.message);
console.info("Failed to obtain the value of 'startup'. code =" + err.code + ", message =" + err.message);
})
} catch(err) {
console.info("Failed to obtain the value of 'startup'. code =" + err.code + ", message =" + err.message);
......
......@@ -299,7 +299,7 @@ try {
getBundlePackInfo(bundleName: string, bundlePackFlag : BundlePackFlag): Promise\<BundlePackInfo>;
Obtains **bundlePackInfo** based on **bundleName** and **bundleFlag**. This API uses a promise to return the result.
Obtains **bundlePackInfo** based on **bundleName** and **BundlePackFlag**. This API uses a promise to return the result.
**System API**: This is a system API.
......
......@@ -20,7 +20,7 @@ import appManager from '@ohos.app.ability.appManager';
function getForegroundAppInfos() {
appManager.getForegroundApplications((error, data) => {
if (error && error.code) {
console.log('getForegroundApplications failed, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}');
console.log('getForegroundApplications failed, error.code: ${error.code}, error.message: ${error.message}');
return;
}
for (let i = 0; i < data.length; i++) {
......
......@@ -62,7 +62,7 @@ let bundleContext;
try {
bundleContext = this.context.createBundleContext('com.example.test');
} catch (error) {
console.error('createBundleContext failed, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}');
console.error('createBundleContext failed, error.code: ${error.code}, error.message: ${error.message}');
}
```
......@@ -101,7 +101,7 @@ let moduleContext;
try {
moduleContext = this.context.createModuleContext('entry');
} catch (error) {
console.error('createModuleContext failed, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}');
console.error('createModuleContext failed, error.code: ${error.code}, error.message: ${error.message}');
}
```
......@@ -141,7 +141,7 @@ let moduleContext;
try {
moduleContext = this.context.createModuleContext('com.example.test', 'entry');
} catch (error) {
console.error('createModuleContext failed, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}');
console.error('createModuleContext failed, error.code: ${error.code}, error.message: ${error.message}');
}
```
......@@ -166,6 +166,6 @@ let applicationContext;
try {
applicationContext = this.context.getApplicationContext();
} catch (error) {
console.error('getApplicationContext failed, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}');
console.error('getApplicationContext failed, error.code: ${error.code}, error.message: ${error.message}');
}
```
......@@ -38,7 +38,7 @@ Called when the mission continuation is complete.
distributedMissionManager.continueMission(continueDeviceInfo, continueCallback, (error) => {
if (error && error.code) {
console.error('continueMission failed, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}');
console.error('continueMission failed, error.code: ${error.code}, error.message: ${error.message}');
}
console.log('continueMission finished');
});
......
......@@ -33,7 +33,7 @@ The **ContinueDeviceInfo** module defines the parameters required for initiating
distributedMissionManager.continueMission(continueDeviceInfo, continueCallback, (error) => {
if (error && error.code) {
console.error('continueMission failed, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}');
console.error('continueMission failed, error.code: ${error.code}, error.message: ${error.message}');
}
console.log('continueMission finished');
});
......
......@@ -30,6 +30,6 @@ let observer = {
try {
errorManager.on('error', observer);
} catch (error) {
console.error('registerErrorObserver failed, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}');
console.error('registerErrorObserver failed, error.code: ${error.code}, error.message: ${error.message}');
}
```
......@@ -33,7 +33,7 @@ let upperLimit = 1;
function getExtensionInfos() {
abilityManager.getExtensionRunningInfos(upperLimit, (error, data) => {
if (error && error.code) {
console.error('getForegroundApplications failed, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}');
console.error('getForegroundApplications failed, error.code: ${error.code}, error.message: ${error.message}');
return;
}
......
......@@ -25,7 +25,7 @@ try {
missionManager.getMissionInfo('', 1, (error, data) => {
if (error.code) {
// Process service logic errors.
console.error('getMissionInfo failed, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}');
console.error('getMissionInfo failed, error.code: ${error.code}, error.message: ${error.message}');
return;
}
......
......@@ -27,7 +27,7 @@ The mission snapshot information can be obtained by using **getMissionSnapShot**
try {
missionManager.getMissionInfos('', 10, (error, missions) => {
if (error.code) {
console.error('getMissionInfos failed, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}');
console.error('getMissionInfos failed, error.code: ${error.code}, error.message: ${error.message}');
return;
}
console.log('size = ${missions.length}');
......@@ -36,7 +36,7 @@ The mission snapshot information can be obtained by using **getMissionSnapShot**
missionManager.getMissionSnapShot('', id, (err, snapshot) => {
if (err.code) {
console.error('getMissionInfos failed, err.code: ${JSON.stringify(err.code)}, err.message: ${JSON.stringify(err.message)}');
console.error('getMissionInfos failed, err.code: ${err.code}, err.message: ${err.message}');
return;
}
......
......@@ -54,6 +54,7 @@ Observe the following when using this API:
| 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. |
| 16000017 | The previous ability is starting, wait start later. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
......@@ -117,6 +118,7 @@ Observe the following when using this API:
| 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. |
| 16000017 | The previous ability is starting, wait start later. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
......@@ -189,6 +191,7 @@ Observe the following when using this API:
| 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. |
| 16000017 | The previous ability is starting, wait start later. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
......@@ -257,6 +260,7 @@ Observe the following when using this API:
| 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. |
| 16000017 | The previous ability is starting, wait start later. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
......@@ -324,6 +328,7 @@ Observe the following when using this API:
| 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. |
| 16000017 | The previous ability is starting, wait start later. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
......@@ -401,6 +406,7 @@ Observe the following when using this API:
| 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. |
| 16000017 | The previous ability is starting, wait start later. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
......@@ -471,6 +477,7 @@ Observe the following when using this API:
| 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. |
| 16000017 | The previous ability is starting, wait start later. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
......@@ -542,6 +549,7 @@ Observe the following when using this API:
| 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. |
| 16000017 | The previous ability is starting, wait start later. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
......@@ -621,6 +629,7 @@ Observe the following when using this API:
| 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. |
| 16000017 | The previous ability is starting, wait start later. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
......@@ -1349,6 +1358,7 @@ let want = {
};
let options = {
onConnect(elementName, remote) {
commRemote = remote;
console.info('onConnect...')
},
onDisconnect(elementName) {
......@@ -1415,6 +1425,7 @@ let want = {
let accountId = 100;
let options = {
onConnect(elementName, remote) {
commRemote = remote;
console.info('onConnect...')
},
onDisconnect(elementName) {
......@@ -1438,7 +1449,7 @@ try {
disconnectServiceExtensionAbility(connection: number): Promise\<void>;
Disconnects from a ServiceExtensionAbility. This API uses a promise to return the result.
Disconnects this ability from a ServiceExtensionAbility and after the successful disconnection, sets the remote object returned upon the connection to void. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
......@@ -1471,6 +1482,7 @@ let connection = 1;
try {
this.context.disconnectServiceExtensionAbility(connection, (err) => {
commRemote = null;
if (err.code) {
// Process service logic errors.
console.error(`disconnectServiceExtensionAbility failed, code is ${err.code}, message is ${err.message}`);
......@@ -1480,6 +1492,7 @@ try {
console.info('disconnectServiceExtensionAbility succeed');
});
} catch (err) {
commRemote = null;
// Process input parameter errors.
console.error(`disconnectServiceExtensionAbility failed, code is ${err.code}, message is ${err.message}`);
}
......@@ -1489,7 +1502,7 @@ try {
disconnectServiceExtensionAbility(connection: number, callback:AsyncCallback\<void>): void;
Disconnects from a ServiceExtensionAbility. This API uses an asynchronous callback to return the result.
Disconnects this ability from a ServiceExtensionAbility and after the successful disconnection, sets the remote object returned upon the connection to void. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
......@@ -1517,6 +1530,7 @@ let connection = 1;
try {
this.context.disconnectServiceExtensionAbility(connection, (err) => {
commRemote = null;
if (err.code) {
// Process service logic errors.
console.error(`disconnectServiceExtensionAbility failed, code is ${err.code}, message is ${err.message}`);
......@@ -1526,6 +1540,7 @@ try {
console.info('disconnectServiceExtensionAbility succeed');
});
} catch (err) {
commRemote = null;
// Process input parameter errors.
console.error(`disconnectServiceExtensionAbility failed, code is ${err.code}, message is ${err.message}`);
}
......@@ -1569,6 +1584,7 @@ Observe the following when using this API:
| 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. |
| 16000017 | The previous ability is starting, wait start later. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
......@@ -1675,6 +1691,7 @@ Observe the following when using this API:
| 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. |
| 16000017 | The previous ability is starting, wait start later. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
......@@ -1746,6 +1763,7 @@ Observe the following when using this API:
| 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. |
| 16000017 | The previous ability is starting, wait start later. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
......@@ -1819,6 +1837,7 @@ Observe the following when using this API:
| 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. |
| 16000017 | The previous ability is starting, wait start later. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
......
......@@ -58,7 +58,7 @@ Starts an ability. This API uses an asynchronous callback to return the result.
this.context.startAbility(want, options, (error) => {
if (error.code) {
// Process service logic errors.
console.error('startAbility failed, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}');
console.error('startAbility failed, error.code: ${error.code}, error.message: ${error.message}');
return;
}
// Carry out normal service processing.
......@@ -66,7 +66,7 @@ Starts an ability. This API uses an asynchronous callback to return the result.
});
} catch (paramError) {
// Process input parameter errors.
console.error('error.code: ${JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)}');
console.error('error.code: ${paramError.code}, error.message: ${paramError.message}');
}
```
......@@ -110,10 +110,10 @@ Starts an ability. This API uses a promise to return the result.
})
.catch((error) => {
// Process service logic errors.
console.error('startAbility failed, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}');
console.error('startAbility failed, error.code: ${error.code}, error.message: ${error.message}');
});
} catch (paramError) {
// Process input parameter errors.
console.error('error.code: ${JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)}');
console.error('error.code: ${paramError.code}, error.message: ${paramError.message}');
}
```
......@@ -31,7 +31,7 @@ try {
inputDevice.getDeviceIds((error, ids) => {
if (error) {
console.log(`Failed to get device list.
error code=${JSON.stringify(err.code)} msg=${JSON.stringify(err.message)}`);
error code=${err.code} msg=${err.message}`);
return;
}
this.data = ids;
......@@ -91,7 +91,7 @@ try {
inputDevice.getDeviceInfo(1, (error, inputDevice) => {
if (error) {
console.log(`Failed to get device information.
error code=${JSON.stringify(err.code)} msg=${JSON.stringify(err.message)}`);
error code=${err.code} msg=${err.message}`);
return;
}
console.log("The device name is: " + inputDevice.name);
......@@ -421,7 +421,7 @@ try {
inputDevice.getKeyboardType(1, (error, number) => {
if (error) {
console.log(`Failed to get keyboardtype.
error code=${JSON.stringify(err.code)} msg=${JSON.stringify(err.message)}`);
error code=${err.code} msg=${err.message}`);
return;
}
console.log("The keyboard type of the device is: " + number);
......
......@@ -26,7 +26,7 @@ getBundleInstaller(callback: AsyncCallback\<BundleInstaller>): void;
Obtains a **BundleInstaller** object. This API uses an asynchronous callback to return the result.
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**System capability**: SystemCapability.BundleManager.BundleFramework.Core
......@@ -60,7 +60,7 @@ getBundleInstaller(): Promise\<BundleInstaller>;
Obtains a **BundleInstaller** object. This API uses an asynchronous callback to return the result.
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**System capability**: SystemCapability.BundleManager.BundleFramework.Core
......@@ -90,7 +90,7 @@ install(hapFilePaths: Array&lt;string&gt;, installParam: InstallParam, callback:
Installs a bundle. This API uses an asynchronous callback to return the result.
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**Required permissions**: ohos.permission.INSTALL_BUNDLE
......@@ -119,7 +119,9 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| 17700017 | Failed to install the HAP since the version of the HAP to install is too early. |
| 17700018 | Failed to install because the dependent module does not exist. |
| 17700031 | Failed to install the HAP because the overlay check of the HAP is failed. |
| 17700036 | Failed to install because without allow app shared bundle permission. |
| 17700036 | Failed to install the HSP because lacks appropriate permissions. |
| 17700039 | Failed to install because disallow install a shared bundle by hapFilePaths. |
| 17700041 | Failed to install because enterprise device management disallow install. |
**Example**
......@@ -149,13 +151,84 @@ try {
}
```
## BundleInstaller.install
install(hapFilePaths: Array\<string\>, installParam?: InstallParam) : Promise\<void\>;
Installs a bundle. This API uses a promise to return the result.
**System API**: This is a system API.
**Required permissions**: ohos.permission.INSTALL_BUNDLE
**System capability**: SystemCapability.BundleManager.BundleFramework.Core
**Parameters**
| Name | Type | Mandatory| Description |
| ------------ | ----------------------------- | ---- | ------------------------------------------------------------ |
| hapFilePaths | Array\<string\> | Yes | Paths where the HAP files of the bundle are stored, which are the data directories. If only one directory is passed, the HAP files in the directory must belong to the same bundle and have the same signature.|
| installParam | [InstallParam](#installparam) | No | Parameters required for the installation. |
**Return value**
| Type | Description |
| --------------- | -------------------------------------- |
| Promise\<void\> | Promise that returns no value.|
**Error codes**
For details about the error codes, see [Bundle Error Codes](../errorcodes/errorcode-bundle.md).
| ID| Error Message |
| -------- | ------------------------------------------------------------ |
| 17700004 | The specified user ID is not found. |
| 17700010 | Failed to install the HAP because the HAP fails to be parsed. |
| 17700011 | Failed to install the HAP because the HAP signature fails to be verified. |
| 17700012 | Failed to install the HAP because the HAP path is invalid or the HAP is too large. |
| 17700015 | Failed to install the HAPs because they have different configuration information. |
| 17700016 | Failed to install the HAP because of insufficient system disk space. |
| 17700017 | Failed to install the HAP since the version of the HAP to install is too early. |
| 17700018 | Failed to install because the dependent module does not exist. |
| 17700031 | Failed to install the HAP because the overlay check of the HAP is failed. |
| 17700036 | Failed to install the HSP because lacks appropriate permissions. |
| 17700039 | Failed to install because disallow install a shared bundle by hapFilePaths. |
| 17700041 | Failed to install because enterprise device management disallow install. |
**Example**
```ts
import installer from '@ohos.bundle.installer';
let hapFilePaths = ['/data/storage/el2/base/haps/entry/files/'];
let installParam = {
userId: 100,
isKeepData: false,
installFlag: 1,
};
try {
installer.getBundleInstaller().then(data => {
data.install(hapFilePaths, installParam)
.then((data) => {
console.info('install success: ' + JSON.stringify(data));
}).catch((error) => {
console.error('install failed:' + err.message);
});
}).catch(error => {
console.error('getBundleInstaller failed. Cause: ' + error.message);
});
} catch (error) {
console.error('getBundleInstaller failed. Cause: ' + error.message);
}
```
## BundleInstaller.uninstall
uninstall(bundleName: string, installParam: InstallParam, callback: AsyncCallback&lt;void&gt;): void;
Uninstalls a bundle. This API uses an asynchronous callback to return the result.
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**Required permissions**: ohos.permission.INSTALL_BUNDLE
......@@ -177,6 +250,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| -------- | ------------------------------------------------------------ |
| 17700004 | The specified user ID is not found. |
| 17700020 | The specified bundle is pre-installed bundle which cannot be uninstalled. |
| 17700040 | The specified bundle is a shared bundle which cannot be uninstalled. |
**Example**
......@@ -212,7 +286,7 @@ uninstall(uninstallParam: UninstallParam, callback : AsyncCallback\<void>) : voi
Uninstalls a shared bundle. This API uses an asynchronous callback to return the result.
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**Required permissions**: ohos.permission.INSTALL_BUNDLE
......@@ -266,7 +340,7 @@ uninstall(uninstallParam: UninstallParam) : Promise\<void>;
Uninstalls a shared bundle. This API uses a promise to return the result.
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**Required permissions**: ohos.permission.INSTALL_BUNDLE
......@@ -325,7 +399,7 @@ recover(bundleName: string, installParam: InstallParam, callback: AsyncCallback&
Recovers a bundle. This API uses an asynchronous callback to return the result.
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**Required permissions**: ohos.permission.INSTALL_BUNDLE
......@@ -381,7 +455,7 @@ Defines the hash parameters for bundle installation and uninstall.
**System capability**: SystemCapability.BundleManager.BundleFramework.Core
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
| Name | Type | Mandatory| Description |
| ---------- | ------ | ---------------- | ---------------- |
......@@ -394,15 +468,15 @@ Defines the parameters that need to be specified for bundle installation, uninst
**System capability**: SystemCapability.BundleManager.BundleFramework.Core
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
| Name | Type | Mandatory | Description |
| ------------------------------ | ------------------------------ | ------------------ | ------------------ |
| userId | number | Yes | User ID. You can use [queryOsAccountLocalIdFromProcess](js-apis-osAccount.md#getOsAccountLocalId) to obtain the user of the current process.|
| installFlag | number | Yes | Installation flag. The value **0** means initial installation and **1** means overwrite installation.|
| isKeepData | boolean | Yes | Whether to retain the data directory during bundle uninstall.|
| hashParams | Array<[HashParam](#hashparam)> | Yes| Hash parameters. |
| crowdtestDeadline| number | Yes |End date of crowdtesting.|
| userId | number | No | User ID. You can use [queryOsAccountLocalIdFromProcess](js-apis-osAccount.md#getOsAccountLocalId) to obtain the user of the current process.|
| installFlag | number | No | Installation flag. The value **0** means initial installation and **1** means overwrite installation.|
| isKeepData | boolean | No | Whether to retain the data directory during bundle uninstall.|
| hashParams | Array<[HashParam](#hashparam)> | No| Hash parameters. |
| crowdtestDeadline| number | No |End date of crowdtesting.|
| sharedBundleDirPaths | Array\<String> | No|Paths of the shared bundle files.|
## UninstallParam<sup>10+</sup>
......@@ -411,7 +485,7 @@ Defines the parameters required for the uninstallation of a shared bundle.
**System capability**: SystemCapability.BundleManager.BundleFramework.Core
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
| Name | Type | Mandatory| Description |
| ----------- | ------ | ---- | ------------------------------------------------------------ |
......
......@@ -5,8 +5,6 @@ The **overlay** module provides APIs for installing a [module with the overlay f
> **NOTE**
>
> The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>
> The APIs provided by this module are system APIs.
## Modules to Import
......@@ -41,8 +39,8 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| ------ | -------------------------------------- |
| 17700002 | The specified moduleName is not existed. |
| 17700033 | The specified moduleName is not overlay module. |
| 17700002 | The specified module name is not found. |
| 17700033 | The specified module is not an overlay module. |
**Example**
......@@ -84,8 +82,8 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| ------ | -------------------------------------- |
| 17700002 | The specified moduleName is not existed. |
| 17700033 | The specified moduleName is not overlay module. |
| 17700002 | The specified module name is not found. |
| 17700033 | The specified module is not an overlay module. |
**Example**
......@@ -116,7 +114,7 @@ Enables or disables a module with the overlay feature in another application. Th
**System capability**: SystemCapability.BundleManager.BundleFramework.Overlay
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**Parameters**
......@@ -138,10 +136,10 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| ------ | -------------------------------------- |
| 17700001 | The specified bundleName is not found. |
| 17700002 | The specified moduleName is not existed. |
| 17700032 | The specified bundleName does not contain any overlay module. |
| 17700033 | The specified moduleName is not overlay module. |
| 17700001 | The specified bundleName is not found. |
| 17700002 | The specified module name is not found. |
| 17700032 | The specified bundle does not contain any overlay module. |
| 17700033 | The specified module is not an overlay module. |
**Example**
......@@ -172,7 +170,7 @@ Enables or disables a module with the overlay feature in another application. Th
**System capability**: SystemCapability.BundleManager.BundleFramework.Overlay
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**Parameters**
......@@ -181,7 +179,7 @@ Enables or disables a module with the overlay feature in another application. Th
| bundleName | string | Yes | Bundle name of the application. |
| moduleName | string | Yes | HAP name of the module with the overlay feature. |
| isEnabled | boolean | Yes | Whether to enable the module with the overlay feature. The value **true** means to enable the module, and **false** means to disable the module.|
| callback | AsyncCallback\<Want> | Yes | Callback used to return the result. If the operation is successful, **err** is **undefined** and **data** is the processing result obtained; otherwise, **err** is an error object. |
| callback | AsyncCallback\<void> | Yes | Callback used to return the result. If the operation is successful, **err** is **undefined** and data is the processing result obtained; otherwise, **err** is an error object. |
**Error codes**
......@@ -189,10 +187,10 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| ------ | -------------------------------------- |
| 17700001 | The specified bundleName is not found. |
| 17700002 | The specified moduleName is not existed. |
| 17700032 | The specified bundleName does not contain any overlay module. |
| 17700033 | The specified moduleName is not overlay module. |
| 17700001 | The specified bundleName is not found. |
| 17700002 | The specified module name is not found. |
| 17700032 | The specified bundle does not contain any overlay module. |
| 17700033 | The specified module is not an overlay module. |
**Example**
......@@ -240,8 +238,9 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| ------ | -------------------------------------- |
| 17700002 | The specified moduleName is not existed. |
| 17700033 | The specified moduleName is not overlay module. |
| 17700002 | The specified module name is not found. |
| 17700032 | he specified bundle does not contain any overlay module. |
| 17700033 | The specified module is not an overlay module. |
**Example**
......@@ -271,7 +270,7 @@ Obtains the information about a module with the overlay feature in the current a
| Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | --------------------------------------- |
| moduleName | string | Yes | HAP name of the module with the overlay feature. |
| callback | AsyncCallback\<OverlayModuleInfo> | Yes | Callback used to return the result, which is an **OverlayModuleInfo** object. If the operation is successful, **err** is **undefined**; otherwise, **err** is an error object. |
| callback | AsyncCallback\<OverlayModuleInfo> | Yes | Callback used to return the result. If the operation is successful, **err** is **undefined**; otherwise, **err** is an error object. |
**Error codes**
......@@ -279,8 +278,9 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| ------ | -------------------------------------- |
| 17700002 | The specified moduleName is not existed. |
| 17700033 | The specified moduleName is not overlay module. |
| 17700002 | The specified module name is not found. |
| 17700032 | he specified bundle does not contain any overlay module. |
| 17700033 | The specified module is not an overlay module. |
**Example**
......@@ -325,8 +325,8 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| ------ | -------------------------------------- |
| 17700002 | The specified moduleName is not existed. |
| 17700034 | The specified moduleName is overlay module. |
| 17700002 | The specified module name is not found. |
| 17700034 | The specified module is an overlay module. |
**Example**
......@@ -356,7 +356,7 @@ Obtains the information about modules with the overlay feature in the current ap
| Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | --------------------------------------- |
| targetModuleName | string | Yes | HAP name of the target module specified by modules with the overlay feature. |
| callback | AsyncCallback\<Array\<OverlayModuleInfo>> | Yes | Callback used to return the result, which is an array of **OverlayModuleInfo** objects. If the operation is successful, **err** is **undefined**; otherwise, **err** is an error object. |
| callback | AsyncCallback\<Array\<OverlayModuleInfo>> | Yes | Callback used to return the result. If the operation is successful, **err** is **undefined**; otherwise, **err** is an error object. |
**Error codes**
......@@ -364,8 +364,8 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| ------ | -------------------------------------- |
| 17700002 | The specified moduleName is not existed. |
| 17700034 | The specified moduleName is overlay module. |
| 17700002 | The specified module name is not found. |
| 17700034 | The specified module is an overlay module. |
**Example**
......@@ -394,7 +394,7 @@ Obtains the information about a module with the overlay feature in another appli
**System capability**: SystemCapability.BundleManager.BundleFramework.Overlay
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**Parameters**
......@@ -416,9 +416,9 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| ------ | -------------------------------------- |
| 17700001 | The specified bundleName is not found |
| 17700002 | The specified moduleName is not existed. |
| 17700032 | The specified bundleName does not contain any overlay module. |
| 17700033 | The specified moduleName is not overlay module. |
| 17700002 | The specified module name is not found. |
| 17700032 | The specified bundle does not contain any overlay module. |
| 17700033 | The specified module is not an overlay module. |
**Example**
......@@ -446,7 +446,7 @@ Obtains the information about a module with the overlay feature in another appli
**System capability**: SystemCapability.BundleManager.BundleFramework.Overlay
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**Parameters**
......@@ -454,7 +454,7 @@ Obtains the information about a module with the overlay feature in another appli
| ----------- | ------ | ---- | --------------------------------------- |
| bundleName | string | Yes | Bundle name of the application. |
| moduleName | string | Yes | HAP name of the module with the overlay feature. If this parameter is not specified, the API obtains the information of all modules with the overlay feature in that application. |
| callback | AsyncCallback\<Array\<OverlayModuleInfo>> | Yes | Callback used to return the result, which is an array of **OverlayModuleInfo** objects. If the operation is successful, **err** is **undefined**; otherwise, **err** is an error object. |
| callback | AsyncCallback\<Array\<OverlayModuleInfo>> | Yes | Callback used to return the result. If the operation is successful, **err** is **undefined**; otherwise, **err** is an error object. |
**Error codes**
......@@ -463,9 +463,9 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| ------ | -------------------------------------- |
| 17700001 | The specified bundleName is not found |
| 17700002 | The specified moduleName is not existed. |
| 17700032 | The specified bundleName does not contain any overlay module. |
| 17700033 | The specified moduleName is not overlay module. |
| 17700002 | The specified module name is not found. |
| 17700032 | The specified bundle does not contain any overlay module. |
| 17700033 | The specified module is not an overlay module. |
**Example**
......@@ -496,14 +496,14 @@ Obtains the information about all modules with the overlay feature in another ap
**System capability**: SystemCapability.BundleManager.BundleFramework.Overlay
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**Parameters**
| Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | --------------------------------------- |
| bundleName | string | Yes | Bundle name of the application. |
| callback | AsyncCallback\<Array\<OverlayModuleInfo>> | Yes | Callback used to return the result, which is an array of **OverlayModuleInfo** objects. If the operation is successful, **err** is **undefined**; otherwise, **err** is an error object. |
| callback | AsyncCallback\<Array\<OverlayModuleInfo>> | Yes | Callback used to return the result. If the operation is successful, **err** is **undefined**; otherwise, **err** is an error object. |
**Error codes**
......@@ -512,9 +512,9 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| ------ | -------------------------------------- |
| 17700001 | The specified bundleName is not found |
| 17700002 | The specified moduleName is not existed. |
| 17700032 | The specified bundleName does not contain any overlay module. |
| 17700033 | The specified moduleName is not overlay module. |
| 17700002 | The specified module name is not found. |
| 17700032 | The specified bundle does not contain any overlay module. |
| 17700033 | The specified module is not an overlay module. |
**Example**
......@@ -544,7 +544,7 @@ Obtains the information about modules with the overlay feature in another applic
**System capability**: SystemCapability.BundleManager.BundleFramework.Overlay
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**Parameters**
......@@ -557,7 +557,7 @@ Obtains the information about modules with the overlay feature in another applic
| Type | Description |
| ------------------------- | ------------------ |
| Promise\<Array\<OverlayModuleInfo>> | Promise used to return the result, which is an array of **OverlayModuleInfo** objects.|
| Promise\<Array\<OverlayModuleInfo>> | Promise used to return the array of overlay module information obtained.|
**Error codes**
......@@ -566,9 +566,9 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| ------ | -------------------------------------- |
| 17700001 | The specified bundleName is not found |
| 17700002 | The specified moduleName is not existed. |
| 17700034 | The specified moduleName is overlay module. |
| 17700035 | The specified bundleName is overlay bundle. |
| 17700002 | The specified module name is not found. |
| 17700034 | The specified module is an overlay module. |
| 17700035 | The specified bundle is an overlay bundle. |
**Example**
......@@ -596,15 +596,15 @@ Obtains the information about modules with the overlay feature in another applic
**System capability**: SystemCapability.BundleManager.BundleFramework.Overlay
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**Parameters**
| Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | --------------------------------------- |
| targetBundleName | string | Yes | Bundle name of the application. |
| moduleName | string | No | HAP name of the target module, which is **targetModuleName** specified by modules with the overlay feature. If this parameter is not specified, the API obtains the information associated with all modules in that application. |
| callback | AsyncCallback\<Array\<OverlayModuleInfo>> | Yes | Callback used to return the result, which is an array of **OverlayModuleInfo** objects. If the operation is successful, **err** is **undefined**; otherwise, **err** is an error object. |
| moduleName | string | Yes | HAP name of the target module, which is **targetModuleName** specified by modules with the overlay feature. If this parameter is not specified, the API obtains the information associated with all modules in that application. |
| callback | AsyncCallback\<Array\<OverlayModuleInfo>> | Yes | Callback used to return the result. If the operation is successful, **err** is **undefined**; otherwise, **err** is an error object. |
**Error codes**
......@@ -613,9 +613,9 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| ------ | -------------------------------------- |
| 17700001 | The specified bundleName is not found |
| 17700002 | The specified moduleName is not existed. |
| 17700034 | The specified moduleName is overlay module. |
| 17700035 | The specified bundleName is overlay bundle. |
| 17700002 | The specified module name is not found. |
| 17700034 | The specified module is an overlay module. |
| 17700035 | The specified bundle is an overlay bundle. |
**Example**
......@@ -646,14 +646,14 @@ Obtains the information about all modules with the overlay feature in another ap
**System capability**: SystemCapability.BundleManager.BundleFramework.Overlay
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**Parameters**
| Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | --------------------------------------- |
| targetBundleName | string | Yes | Bundle name of the application. |
| callback | AsyncCallback\<Array\<OverlayModuleInfo>> | Yes | Callback used to return the result, which is an array of **OverlayModuleInfo** objects. If the operation is successful, **err** is **undefined**; otherwise, **err** is an error object. |
| callback | AsyncCallback\<Array\<OverlayModuleInfo>> | Yes | Callback used to return the result. If the operation is successful, **err** is **undefined**; otherwise, **err** is an error object. |
**Error codes**
......@@ -662,9 +662,9 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| ------ | -------------------------------------- |
| 17700001 | The specified bundleName is not found |
| 17700002 | The specified moduleName is not existed. |
| 17700034 | The specified moduleName is overlay module. |
| 17700035 | The specified bundleName is overlay bundle. |
| 17700002 | The specified module name is not found. |
| 17700034 | The specified module is an overlay module. |
| 17700035 | The specified bundle is an overlay bundle. |
**Example**
......
......@@ -13,7 +13,7 @@ The **TaskPool** APIs return error codes in numeric format. For details about th
## Modules to Import
```js
```ts
import taskpool from '@ohos.taskpool';
```
......@@ -58,9 +58,9 @@ For details about the error codes, see [Utils Error Codes](../errorcodes/errorco
**Example**
```js
```ts
@Concurrent
function func(args) {
"use concurrent"
console.log("func: " + args);
return args;
}
......@@ -110,9 +110,9 @@ For details about the error codes, see [Utils Error Codes](../errorcodes/errorco
**Example**
```js
```ts
@Concurrent
function func(args) {
"use concurrent"
console.log("func: " + args);
return args;
}
......@@ -158,9 +158,9 @@ For details about the error codes, see [Utils Error Codes](../errorcodes/errorco
**Example**
```js
```ts
@Concurrent
function func(args) {
"use concurrent"
console.log("func: " + args);
return args;
}
......@@ -199,9 +199,9 @@ For details about the error codes, see [Utils Error Codes](../errorcodes/errorco
**Example**
```js
```ts
@Concurrent
function func(args) {
"use concurrent"
console.log("func: " + args);
return args;
}
......@@ -209,7 +209,11 @@ function func(args) {
async function taskpoolTest() {
let task = new taskpool.Task(func, 100);
let value = await taskpool.execute(task);
taskpool.cancel(task);
try {
taskpool.cancel(task);
} catch (e) {
console.log("taskpool.cancel occur error:" + e);
}
}
taskpoolTest();
......@@ -221,12 +225,19 @@ taskpoolTest();
The following sequenceable data types are supported: All Primitive Type (excluding symbol), Date, String, RegExp, Array, Map, Set, Object, ArrayBuffer, and TypedArray.
### Precautions
A task in the task pool can reference only variables passed in by input parameters or imported variables. It does not support closure variables.
- The task pool APIs can be used only in the module with **compileMode** set to **esmodule** in the stage model. To check the **compileMode** setting of a module, open the **build-profile.json5** file of the module and check for **"compileMode": "esmodule"** under **buildOption**.
- A task in the task pool can reference only variables passed in by input parameters or imported variables, rather than closure variables. The decorator **@Concurrent** is used to intercept unsupported variables.
- A task in the task pool supports only common functions or async functions, rather than class member functions or anonymous functions. The decorator **@Concurrent** is used to intercept unsupported functions.
- The decorator **@Concurrent** can be used only in the .ets file. To create a task in the task pool in the .ts file, use the statement **use concurrent**.
```js
// 1. Reference a variable passed in by the input parameter.
### Using the Task Pool in Simple Mode
**Example 1**
```ts
// Common functions are supported, and variables passed in by input parameters are also supported.
@Concurrent
function func(args) {
"use concurrent"
console.log("func: " + args);
return args;
}
......@@ -245,17 +256,19 @@ async function taskpoolTest() {
taskpoolTest();
```
```js
// 2. Reference an imported variable.
**Example 2**
// b.ts
```ts
// b.ets
export var c = 2000;
```
```ts
// Reference an imported variable.
// a.ets (in the same directory as b.ets)
import { c } from "./b";
// a.ts (in the same directory as b.ts)
import { c } from './b'
@Concurrent
function test(a) {
"use concurrent"
console.log(a);
console.log(c);
return a;
......@@ -274,3 +287,63 @@ async function taskpoolTest() {
taskpoolTest();
```
**Example 3**
```ts
// The async functions are supported.
@Concurrent
async function task() {
let ret = await Promise.all([
new Promise(resolve => setTimeout(resolve, 1000, "resolved"))
]);
return ret;
}
async function taskpoolTest() {
taskpool.execute(task).then((result) => {
console.log("TaskPoolTest task result: " + result);
});
}
taskpoolTest();
```
**Example 4**
```ts
// Use use concurrent to create a task in the task pool in the .ts file.
// c.ts
function test1(n) {
"use concurrent"
return n;
}
export async function taskpoolTest1() {
console.log("taskpoolTest1 start");
var task = new taskpool.Task(test1, 100);
var result = await taskpool.execute(task);
console.log("taskpoolTest1 result:" + result);
}
async function test2() {
"use concurrent"
var ret = await Promise.all([
new Promise(resolve => setTimeout(resolve, 1000, "resolved"))
]);
return ret;
}
export async function taskpoolTest2() {
console.log("taskpoolTest2 start");
taskpool.execute(test2).then((result) => {
console.log("TaskPoolTest2 result: " + result);
});
}
```
```ts
/ / a.ets (in the same directory as c.ts)
import { taskpoolTest1, taskpoolTest2 } from "./c";
taskpoolTest1();
taskpoolTest2();
```
# UI Appearance
The **uiAppearance** module provides basic capabilities for managing the system appearance. It allows for color mode configuration currently, and will introduce more features over time.
> **NOTE**
>
> The APIs of this module are supported since API version 9. Updates will be marked with a superscript to indicate their earliest API version.
>
> The APIs provided by this module are system APIs.
## Modules to Import
```ts
import uiAppearance from '@ohos.uiAppearance'
```
## DarkMode
Enumerates the color modes.
**System capability**: SystemCapability.ArkUI.UiAppearance
| Name| Value| Description|
| -- | -- | -- |
| ALWAYS_DARK | 0 | The system is always in dark mode. |
| ALWAYS_LIGHT | 1 | The system is always in light mode.|
## uiAppearance.setDarkMode
setDarkMode(mode: DarkMode, callback: AsyncCallback\<void>): void
Sets the system color mode. This API uses an asynchronous callback to return the result.
**Permission required**: ohos.permission.UPDATE_CONFIGURATION
**System capability**: SystemCapability.ArkUI.UiAppearance
**Parameters**
| Name| Type| Mandatory| Description|
| -- | -- | -- | -- |
| mode | [DarkMode](#darkmode) | Yes| Color mode to set.|
| callback | AsyncCallback\<void>| Yes| Callback used to return the result.|
**Example**
```ts
uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_DARK, (err) => {
console.info(`${err}`);
})
```
## uiAppearance.setDarkMode
setDarkMode(mode: DarkMode): Promise\<void>;
Sets the system color mode. This API uses a promise to return the result.
**Permission required**: ohos.permission.UPDATE_CONFIGURATION
**System capability**: SystemCapability.ArkUI.UiAppearance
**Parameters**
| Name| Type| Mandatory| Description|
| -- | -- | -- | -- |
| mode | [DarkMode](#darkmode) | Yes| Color mode to set.|
**Return value**
| Type | Description |
| ------ | ------------------------------ |
| Promise\<void> | Promise that returns no value.|
**Example**
```ts
uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_DARK).then(() => {
console.log('Set dark-mode successfully.');
}).catch((err) => {
console.log(`Set dark-mode failed, ${err}`);
});
```
## uiAppearance.getDarkMode
getDarkMode(): DarkMode;
Obtains the system color mode.
**Permission required**: ohos.permission.UPDATE_CONFIGURATION
**System capability**: SystemCapability.ArkUI.UiAppearance
**Return value**
| Type| Description|
| -- | -- |
|[DarkMode](#darkmode) | Color mode obtained.|
**Example**
```ts
let darkMode = uiAppearance.getDarkMode();
console.log(`Get dark-mode ${darkMode}`);
```
......@@ -43,7 +43,7 @@
- [DataShare Error Codes](errorcode-datashare.md)
- [Distributed Data Object Error Codes](errorcode-distributed-dataObject.md)
- [Distributed KV Store Error Codes](errorcode-distributedKVStore.md)
- [Preferences Error Codes](errorcode-preferences.md)
- [User Preference Error Codes](errorcode-preferences.md)
- File Management
- [File Management Error Codes](errorcode-filemanagement.md)
- Telephony Service
......
# Event Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 1500001 Want Action Is Null
**Error Message**
......
# DeviceUsageStatistics Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 10000001 Memory Operation Failure
**Error Message**
......
# DistributedNotificationService Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 1600001 Internal Error
**Error Message**
......
# Distributed Scheduler Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 16600001 The system ability works abnormally.
**Error Message**
......
# Ability Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 16000001 Ability Name Does Not Exist
**Error Message**
......@@ -182,6 +186,24 @@ The context passed in the API does not exist.
Use the correct context.
## 16000017 Waiting for the Previous Abilities to Finish Startup
**Error Message**
The previous ability is starting, wait start later.
**Description**
Too many abilities need to be started. Due to the limited processing capability of the system, the requests are cached in the queue and processed in sequence.
**Possible Causes**
The system has a large number of concurrent requests.
**Solution**
No action is required. Wait for the previous abilities to finish startup.
## 100001 Internal Error
**Error Message**
......
# Application Access Control Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 12100001 Invalid Parameters
**Error Message**
......
# Accessibility Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 9300001 Invalid Bundle Name or Ability Name
**Error Message**
......
# Account Management Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
The following includes the error codes for OS accounts, distributed accounts, and app accounts.
## 12300001 System Service Abnormal
......
# Animator Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 100001 Internal Error
**Error Message**
......
# Audio Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 6800101 Invalid Parameter
**Error Message**
......
# AVSession Management Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 6600101 Session Service Exception
**Error Message**
......
# backgroundTaskManager Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 9800001 Memory Operation Failure
**Error Message**
......
# Power Consumption Statistics Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 4600101 Service Connection Failure
**Error Message**
......
# Brightness Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 4700101 Service Connection Failure
**Error Message**
......
# Bundle Error Codes
# Bundle Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 17700001 Bundle Name Does Not Exist
......@@ -506,7 +510,7 @@ Check whether the application contains a module with the overlay feature.
**Error Message**
The specified module is not overlay module.
The specified module is not an overlay module.
**Description**
......@@ -524,7 +528,7 @@ Check whether the module is configured with the overlay feature.
**Error Message**
The specified module is overlay module.
The specified module is an overlay module.
**Description**
......@@ -542,7 +546,7 @@ Check whether the specified module is configured with the overlay feature.
**Error Message**
The specified bundle is overlay bundle.
The specified bundle is an overlay bundle.
**Description**
......@@ -560,7 +564,7 @@ Check whether the application contains only modules with the overlay feature.
**Error Message**
Failed to install because without allow app shared bundle permission.
Failed to install the HSP because lacks appropriate permissions.
**Description**
......@@ -609,3 +613,39 @@ The shared library to uninstall does not exist.
**Solution**
1. Check whether the shared library exists.
2. Check whether the version of the shared library is the same as that installed.
## 17700039 Failure in Installing an Inter-Application Shared Library
**Error Message**
Failed to install because disallow install a shared bundle by hapFilePaths.
**Description**
During application installation, the installation package passed in is of the inter-application shared library type.
**Possible Causes**
1. When the Bundle Manager tool is used to install an application, the **-p** parameter is set to the installation package path of an inter-application shared library.
2. When the **install** API is called to install an application, the **hapFilePaths** parameter is set to the installation package path of an inter-application shared library.
**Solution**
1. Use the **-s** parameter to specify the installation package path of an inter-application shared library.
2. Use the **sharedBundleDirPaths** parameter in **installParam** to specify the installation package path of an inter-application shared library.
## 17700040 Failure in Uninstalling an Inter-Application Shared Library
**Error Message**
The specified bundle is a shared bundle which cannot be uninstalled.
**Description**
During application uninstall, the bundle name of an inter-application shared library is passed in.
**Possible Causes**
1. When the Bundle Manager tool is used to uninstall an application, the **-n** parameter is set to the bundle name of an inter-application shared library.
2. When the **install** API is called to uninstall an application, the **bundleName** parameter is set to the bundle name of an inter-application shared library.
**Solution**
1. Use the **-s** parameter to specify the application to be uninstalled as a shared library application.
2. Use the **bundleName** and **versionCode** parameters in **UninstallParam** to specify the bundle name and version of the shared library to be uninstalled.
# Certificate Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 19020001 Memory Error
**Error Message**
......
# colorSpaceManager Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 18600001 Abnormal Parameter Value
**Error Message**
......
# Crypto Framework Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 17620001 Memory Error
**Error Message**
......
# RDB Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 14800010 Invalid RDB Name
**Error Message**
......
# DataShare Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 15700010 Failed to Create a DataShareHelper
**Error Message**
......
# Device Management Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 11600101 Service Invoking Exception
**Error Message**
......
# Display Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 1400001 Invalid Display or Screen
**Error Message**
......
# Distributed Data Object Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 15400001 Failed to Create the In-Memory Database
**Error Message**
......
# Distributed KV Store Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 15100001 Subscription Count Reaches the Limit
**Error Message**
......
# Enterprise Device Management Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 9200001 Application Not a Device Administrator
**Error Message**
......
# FaultLogger Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 10600001 Service Faulty or Not Started
**Error Message**
......
# File Management Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
The error codes of the file management subsystem consist of the following:<br>- Basic file I/O error codes<br>- User data management error codes<br>- User file access error codes<br>- Spatial statistics error codes
## Basic File I/O Error Codes
......@@ -6,121 +11,153 @@ The error codes of the file management subsystem consist of the following:<br>-
### 13900001 Operation Not Permitted
**Error Message**
Operation not permitted
**Possible Causes**
The current operation on the file is not allowed.
**Solution**
Check the permission for the file.
### 13900002 File or Directory Not Exist
**Error Message**
No such file or directory
**Possible Causes**
The file or directory does not exist.
**Solution**
Check whether the file directory exists.
### 13900003 Process Not Exist
**Error Message**
No such process
**Possible Causes**
The process does not exist.
**Solution**
1. Check whether the process is killed unexpectedly.
2. Check whether the service related to the process has started.
### 13900004 System Call Interrupted
**Error Message**
Interrupted system call
**Possible Causes**
The system call is interrupted by another thread.
**Solution**
1. Check the multi-thread code logic.
2. Invoke the system call again.
### 13900005 I/O Error
**Error Message**
I/O error
**Possible Causes**
The I/O request is invalid.
**Solution**
Initiate the I/O request again.
### 13900006 Device or Address Not Exist
**Error Message**
No such device or address
**Possible Causes**
The device information or address is incorrect.
**Solution**
Check that the device information or address is correct.
### 13900007 Long Parameter List
**Error Message**
Arg list too long
**Possible Causes**
The parameter list is too long.
**Solution**
Reduce the number of parameters.
### 13900008 Invalid File Descriptor
**Error Message**
Bad file descriptor
**Possible Causes**
This file descriptor is closed.
**Solution**
Check whether the file descriptor is closed.
### 13900009 Child Process Not Exist
**Error Message**
No child processes
**Possible Causes**
The child process cannot be created.
**Solution**
Check the maximum number of processes in the system.
### 13900010 Resource Unavailable
**Error Message**
Try again
**Possible Causes**
The resources are blocked.
**Solution**
Request resources.
### 13900011 Memory Overflow
**Error Message**
Out of memory
**Possible Causes**
A memory overflow occurs.
**Solution**
......@@ -130,9 +167,13 @@ A memory overflow occurs.
### 13900012 Permission Denied
**Error Message**
Permission denied
**Possible Causes**
1. You do not have the permission to operate the file.
2. The file sandbox path is incorrect.
......@@ -143,329 +184,418 @@ Permission denied
### 13900013 Incorrect Address
**Error Message**
Bad address
**Possible Causes**
The address is incorrect.
**Solution**
Check that the address is correct.
### 13900014 Device or Resource Not Available
**Error Message**
Device or resource busy
**Possible Causes**
The requested resource is unavailable.
**Solution**
Request the resource again.
### 13900015 File Already Exists
**Error Message**
File exists
**Possible Causes**
The file to be created already exists.
**Solution**
Check whether the file path is correct.
### 13900016 Invalid Cross-Device Link
**Error Message**
Cross-device link
**Possible Causes**
The link between devices is incorrect.
**Solution**
Check the devices and create the link correctly.
### 13900017 Device Not Exist
**Error Message**
No such device
**Possible Causes**
The device is not identified.
**Solution**
Check the connection to the target device.
### 13900018 Invalid Directory
**Error Message**
Not a directory
**Possible Causes**
The specified directory is invalid.
**Solution**
Check that the directory is correct.
### 13900019 The Specified Object Is a Directory
**Error Message**
Is a directory
**Possible Causes**
The specified object is a directory.
**Solution**
Check that the specified data is correct.
### 13900020 Invalid Parameter
**Error Message**
Invalid argument
**Possible Causes**
Invalid input parameter is detected.
**Solution**
Check that the input parameters are valid.
### 13900021 Too Many File Descriptors Opened
**Error Message**
File table overflow
**Possible Causes**
The number of file descriptors opened has reached the limit.
**Solution**
Close the file descriptors that are no longer required.
### 13900022 Too Many Files Opened
**Error Message**
Too many open files
**Possible Causes**
The number of files opened has reached the limit.
**Solution**
Close the files that are not required.
### 13900023 Text File Not Respond
**Error Message**
Text file busy
**Possible Causes**
The executable file of the program is in use.
**Solution**
Close the program that is being debugged.
### 13900024 File Oversized
**Error Message**
File too large
**Possible Causes**
The file size exceeds the limit.
**Solution**
Check whether the file size exceeds the limit.
### 13900025 Insufficient Space on the Device
**Error Message**
No space left on device
**Possible Causes**
The device storage space is insufficient.
**Solution**
Clear the space of the device.
### 13900026 Invalid Shift
**Error Message**
Illegal seek
**Possible Causes**
Seek is used in pipe or FIFO.
**Solution**
Check the use of seek.
### 13900027 Read-Only File System
**Error Message**
Read-only file system
**Possible Causes**
The file system allows read operations only.
**Solution**
Check whether the file is read-only.
### 13900028 Links Reach the Limit
**Error Message**
Too many links
**Possible Causes**
The number of links to the file has reached the limit.
**Solution**
Delete the links that are no longer required.
### 13900029 Resource Deadlock
**Error Message**
Resource deadlock would occur
**Possible Causes**
Resource deadlock occurs.
**Solution**
Terminate the deadlock process.
### 13900030 Long File Name
**Error Message**
Filename too Long
**Possible Causes**
The length of the path or file name exceeds the limit.
**Solution**
Modify the path or file name.
### 13900031 Function Not Implemented
**Error Message**
Function not implemented
**Possible Causes**
The function is not supported by the system.
**Solution**
Check the system version and update the system if required.
### 13900032 Directory Not Empty
**Error Message**
Directory not empty
**Possible Causes**
The specified directory is not empty.
**Solution**
1. Check the directory.
2. Ensure that the directory is empty.
### 13900033 Too Many Symbol Links
**Error Message**
Too many symbolic links
**Possible Causes**
There are too many symbolic links.
**Solution**
Delete unnecessary symbol links.
### 13900034 Operation Blocked
**Error Message**
Operation would block
**Possible Causes**
The operation is blocked.
**Solution**
Perform the operation again.
### 13900035 Invalid File Descriptor
**Error Message**
Invalid request desecriptor
Invalid request descriptor
**Possible Causes**
The requested file descriptor is invalid.
**Solution**
Check that the file descriptor is valid.
### 13900036 Target Is Not a Character Stream Device
**Error Message**
Device not a stream
**Possible Causes**
The device pointed to by the file descriptor is not a character stream device.
**Solution**
Check whether the file descriptor points to a stream device.
### 13900037 No Data Available
**Error Message**
No data available
**Possible Causes**
The required data is not available.
**Solution**
Request the data again.
### 13900038 Value Mismatches the Data Type
**Error Message**
Value too large for defined data type
**Possible Causes**
The specified value is out of the range defined for the data type.
**Solution**
Modify the data type.
### 13900039 File Descriptor Corrupted
**Error Message**
File descriptor in bad state
**Possible Causes**
The file descriptor is corrupted.
**Solution**
Check that the file descriptor is valid.
### 13900040 System Call Interrupted
**Error Message**
Interrupted systen call should be restarted
Interrupted system call should be restarted
**Possible Causes**
The system call is interrupted.
**Solution**
Invoke the system call again.
### 13900041 Disk Quota Exceeded
**Error Message**
Quota exceeded
**Possible Causes**
The disk space is insufficient.
**Solution**
Clear disk space.
### 13900042 Unknown Error
**Error Message**
Unknown error
**Possible Causes**
The error is unidentified.
**Solution**
......@@ -477,45 +607,57 @@ The error is unidentified.
### 14000001 Invalid File Name
**Error Message**
Invalid display name
**Possible Causes**
The file name contains invalid characters.
**Solution**
Modify the file name.
### 14000002 Invalid URI
**Error Message**
Invalid uri
**Possible Causes**
The URI is invalid.
**Solution**
Use the obtained URI.
### 14000003 Invalid File Name Extension
**Error Message**
Invalid file extension
**Possible Causes**
The file name extension is incorrect.
**Solution**
Modify the file name extension.
### 14000004 File in Recycle Bin
**Error Message**
File has been put into trash bin
**Possible Causes**
The file is moved to the Recycle Bin.
**Solution**
Check whether the file is in the Recycle Bin.
## Spatial Statistics Error Codes
......@@ -523,83 +665,105 @@ Check whether the file is in the Recycle Bin.
### 13600001 IPC Failed
**Error Message**
IPC error
**Possible Causes**
The called service does not exist.
**Solution**
Check whether the service is started.
### 13600002 File System Not Supported
**Error Message**
Not supported filesystem
Not supported file system
**Possible Causes**
The file system is not supported.
**Solution**
Use a supported file system.
### 13600003 Mount Failed
**Error Message**
Failed to mount
**Possible Causes**
The **mount** command fails.
**Solution**
Remove the card and run the **mount** command again.
### 13600004 Unmount Failed
**Error Message**
Failed to unmount
**Possible Causes**
The device does not respond.
**Solution**
Check whether the file is being used. If yes, kill the thread that uses the file.
### 13600005 Incorrect Volume State
**Error Message**
Incorrect volume state
**Possible Causes**
The volume state is incorrect.
**Solution**
Check whether the current volume state is correct.
### 13600006 Failed to Create a Directory or Node
**Error Message**
Prepare directory or node error
**Possible Causes**
The directory or node to be created already exists.
**Solution**
Check whether the directory or node to be created already exists.
### 13600007 Failed to Delete a Directory or Node
**Error Message**
Delete directory or node error
**Possible Causes**
The specified directory or node has been deleted.
**Solution**
Check whether the specified directory or node exists.
### 13600008 Object Not Exist
**Error Message**
No such object
**Possible Causes**
......@@ -613,12 +777,15 @@ No such object
### 13600009 Invalid User ID
**Error Message**
User id out of range
**Possible Causes**
The specified user ID is incorrect.
**Solution**
Check that the user ID is correct.
## User File Access Error Codes
......@@ -626,51 +793,64 @@ Check that the user ID is correct.
### 14300001 IPC Failed
**Error Message**
IPC error
**Possible Causes**
1. The server service does not exist.
2. The extension mechanism is abnormal.
**Solution**
Check that the server service exists.
### 14300002 Incorrect URI Format
**Error Message**
Invalid uri
**Possible Causes**
The URI is invalid.
**Solution**
Check that the URI is in correct format.
### 14300003 Failed to Obtain the Server Ability Information
**Error Message**
Fail to get fileextension info
**Possible Causes**
The BMS interface is abnormal.
**Solution**
Check for basic system capability errors.
### 14300004 Incorrect Result Returned by js-server
**Error Message**
Get wrong result
**Possible Causes**
The data returned by the server is incorrect.
**Solution**
Check the data returned by the server.
### 14300005 Failed to Register Notify
**Error Message**
Fail to register notification
**Possible Causes**
......@@ -678,11 +858,13 @@ Fail to register notification
2. The extension mechanism is abnormal.
**Solution**
Check that the server service exists.
### 14300006 Failed to Unregister Notify
**Error Message**
Fail to remove notification
**Possible Causes**
......@@ -690,22 +872,27 @@ Fail to remove notification
2. The extension mechanism is abnormal.
**Solution**
Check that the server service exists.
### 14300007 Failed to Initialize the Notify Agent
**Error Message**
Fail to init notification agent
**Possible Causes**
The specified Notify agent has not been registered.
**Solution**
Check whether the specified Notify agent is registered.
### 14300008 Failed to Notify the Agent
**Error Message**
Fail to notify agent
**Possible Causes**
......@@ -713,6 +900,7 @@ Fail to notify agent
2. The extension mechanism is abnormal.
**Solution**
Check whether the client is normal.
## Error Code Adaptation
......
# Form Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 16500001 Internal Error
**Error Message**
......
# Location Subsystem Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 3301000 Location Service Unavailable
**Error Message**
......
# Application Event Logging Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 11100001 Application Event Logging Disabled
**Error Message**
......
# HiSysEvent Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 1120001 Invalid Event Domain
**Error Message**
......
# HiDebug Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 11400101 Failed to Obtain the System Service
......
# HUKS Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 12000001 Feature Not Supported
**Error Message**
......
# i18n Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 890001 Incorrect Parameter Type
**Error Message**
......
# Input Method Framework Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 12800001 Package Manager Error
**Error Message**
......
# Media Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 5400101 Memory Allocation Failed
**Error Message**
......
# Screen Hopping Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 4400001 Incorrect Target Device Descriptor
**Error Message**
......
# Network Connection Management Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 2100001 Invalid Parameter Value
**Error Message**
......
# Ethernet Connection Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 2200001 Invalid Parameter Value
**Error Message**
......
# HTTP Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 2300001 Protocol Not Supported
**Error Message**
......
# Policy Management Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 2100001 Invalid Parameter Value
**Error Message**
......
# Network Sharing Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 2200001 Invalid Parameter Value
**Error Message**
......
# NFC Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 3100101
**Error Message**
......
# Notification Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 1600001 Internal Error
**Error Message**
......
# Pasteboard Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 12900001 Index Out of Range
**Error Message**
......
# Power Manager Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 4900101 Service Connection Failure
**Error Message**
......
# Preferences Error Codes
# User Preference Error Codes
## 15500010 Failed to Delete Preferences
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 15500010 Failed to Delete the User Preference Persistence File
**Error Message**
Failed to delete preferences.
**Description**
Failed to delete the preference.
The operation of deleting the user preference persistence file failed.
**Possible Causes**
......
# promptAction Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 100001 Internal Error
**Error Message**
......
# reminderAgentManager Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 1700001 Notification Disabled
**Error Message**
......
# Upload and Download Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 13400001 File Operation Error
**Error Message**
......
# Resource Manager Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 9001001 Invalid Resource ID
**Error Message**
......
# Router Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 100001 Internal Error
**Error Message**
......
# RPC Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
The APIs of the **rpc** module return exceptions since API version 9.
## 1900001 Failed to Call mmap
......
# Running Lock Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 4900101 Service Connection Failure
**Error Message**
......
# Screen Lock Management Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 13200002 Screen Lock Management Service Is Abnormal
**Error Message**
......
# Sensor Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 14500101 Service Exception
**Error Message**
......
# System Parameter Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 14700101 Failure to Query the System Parameter
**Error Message**
......
# Telephony Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 8300001 Input Parameter Value Out of Range
**Error Message**
......
# Thermal Manager Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 4800101 Service Connection Failure
**Error Message**
......
# Time and Time Zone Service Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## -1 Screen Unlock Error
**Error Message**
......
# UiTest Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 17000001 Initialization Failure
**Error Message**
......
# Update Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 11500104 IPC Error
**Error Message**
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册