提交 6850d15c 编写于 作者: G Gloria

Update docs against 15328+14949+15114

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 930e2a61
# Readme
- [Ability framework](changelogs-ability.md)
- [Account subsystem](changelogs-account_os_account.md)
- [ArkUI development framework](changelogs-arkui.md)
- [Multimedia subsystem - camera](changelogs-camera.md)
- [Device management subsystem](changelogs-device-manager.md)
- [USB](changelogs-device-usb.md)
- [Distributed scheduler subsystem](changelogs-dmsfwk.md)
- [DSoftBus](changelogs-dsoftbus.md)
- [Customization subsystem](changelogs-enterprise_device_management.md)
- [File management subsystem](changelogs-filemanagement.md)
- [Location subsystem](changelogs-geolocation.md)
- [Globalization subsystem](changelogs-global.md)
- [Input method framework](changelogs-inputmethod-framworks.md)
- [Multimedia subsystem](changelogs-multimedia.md)
- [Multimodal input subsystem](changelogs-multimodalinput.md)
- [Common event and notification subsystem](changelogs-notification.md)
- [Power management subsystem](changelogs-power.md)
- [Upload and download](changelogs-request.md)
- [Resource manager subsystem](changelogs-resource-manager.md)
- [Resource scheduler subsystem](changelogs-resourceschedule.md)
- [Telephony subsystem](changelogs-telephony.md)
- [Test subsystem](changelogs-testfwk_arkxtest.md)
- [Theme](changelogs-theme.md)
- [User IAM subsystem](changelogs-useriam.md)
- [Ability framework - WantAgent](changelogs-wantAgent.md)
- [Web subsystem](changelogs-web.md)
- [Communication subsystem - WiFi](changelogs-wifi.md)
# Readme
- [Account](changelogs-account_os_account.md)
- [Distributed Scheduler](changelogs-dmsfwk.md)
- [DSoftBus](changelogs-dsoftbus.md)
- [File Management](changelogs-filemanagement.md)
- [User IAM](changelogs-useriam.md)
- [Wi-Fi](changelogs-wifi.md)
# *Example* Subsystem Changelog
Changes that affect contract compatibility of the last version should be described in the changelog. The changes include but are not limited to those related to API names, parameters, return values, required permissions, call sequence, enumerated values, configuration parameters, and paths. The last version can be an LTS, release, beta, or monthly version, or the like. Contract compatibility, also called semantic compatibility, means that the original program behavior should remain consistent over versions.
## cl.subsystemname.x xxx Function Change (Example: DeviceType Attribute Change or Camera Permission Change. Use a short description.)
Add the number **cl.*subsystemname*.*x*** before each change title, where **cl** is the abbreviation of changelog, *subsystemname* is the standard English name of the subsystem, and *x* indicates the change sequence number (starting from 1 in ascending order).
Describe the changes in terms of functions. Example: *n* and *m* of the *a* function are changed. Developers need to adapt their applications based on the change description.
If there is a requirement or design document corresponding to the change, attach the requirement number or design document number in the description.
**Change Impact**
Describe whether released APIs (JS or native APIs) are affected or API behavior is changed.
Describe whether available applications are affected, that is, whether an adaptation is required for building the application code in the SDK environment of the new version.
**Key API/Component Changes**
List the API/component changes involved in the function change.
**Adaptation Guide**
Provide guidance for developers on how to adapt their application to the changes to be compatible with the new version.
Example:
Change parameter *n* to *m* in the *a* file.
```
sample code
```
# Multimedia Subsystem Changelog
## cl.multimedia.audio.001 Call Mode Change of getRoutingManager()
**getRoutingManager()** is changed from asynchronous to synchronous.
**Change Impact**
If the new mode is not used, an error will be reported during compilation.
**Key API/Component Changes**
Before change:
```js
getRoutingManager(callback: AsyncCallback<AudioRoutingManager>): void;
getRoutingManager(): Promise<AudioRoutingManager>;
```
After change:
```js
getRoutingManager(): AudioRoutingManager;
```
## cl.multimedia.audio.002 Call Mode Change of getStreamManager()
**getStreamManager()** is changed from asynchronous to synchronous.
**Change Impact**
If the new mode is not used, an error will be reported during compilation.
**Key API/Component Changes**
Before change:
```js
getStreamManager(callback: AsyncCallback<AudioStreamManager>): void;
getStreamManager(): Promise<AudioStreamManager>;
```
After change:
```js
getStreamManager(): AudioStreamManager;
```
## cl.multimedia.audio.003 Registration Mode Change of micStateChange
In the original **AudioRoutingManager**, the registration mode of the **micStateChange** listener of the **on()** function is changed.
**Change Impact**
If the new mode is not used, an error will be reported during compilation.
**Key API/Component Changes**
Before change:
```js
interface AudioRoutingManager {
on(type: 'micStateChange', callback: Callback<MicStateChangeEvent>): void;
}
```
After change:
```js
interface AudioVolumeGroupManager {
on(type: 'micStateChange', callback: Callback<MicStateChangeEvent>): void;
}
```
## cl.multimedia.audio.004 Call Mode Change of getVolumeGroups()
The call mode of **getVolumeGroups()** is changed.
**Change Impact**
If the new mode is not used, an error will be reported during compilation.
**Key API/Component Changes**
Before change:
```js
getVolumeGroups(networkId: string, callback:AsyncCallback<VolumeGroupInfos>): void;
getVolumeGroups(networkId: string): Promise<VolumeGroupInfos>;
```
After change:
```js
getVolumeManager(): AudioVolumeManager;
interface AudioVolumeManager{
getVolumeGroupInfos(networkId: string, callback: AsyncCallback<VolumeGroupInfos>): void;
getVolumeGroupInfos(networkId: string): Promise<VolumeGroupInfos>;
}
```
## cl.multimedia.audio.005 Call Mode Change of getGroupManager()
The call mode of **getGroupManager()** is changed.
**Change Impact**
If the new mode is not used, an error will be reported during compilation.
**Key API/Component Changes**
Before change:
```js
getGroupManager(groupId: number, callback: AsyncCallback<AudioGroupManager>): void;
getGroupManager(groupId: number): Promise<AudioGroupManager>;
```
After change:
```js
getVolumeManager(): AudioVolumeManager;
interface AudioVolumeManager{
getVolumeGroupManager(groupId: number, callback: AsyncCallback<AudioVolumeGroupManager>): void;
getVolumeGroupManager(groupId: number): Promise<AudioVolumeGroupManager>;
}
```
## cl.multimedia.audio.006 FocusType Member Name Change
**FOCUS_TYPE_RECORDING** of **FocusType** is renamed as **FOCUS_TYPE_DEFAULT**.
**Change Impact**
If the new mode is not used, an error will be reported during compilation.
**Key API/Component Changes**
Before change:
```js
enum FocusType {
FOCUS_TYPE_RECORDING = 0,
}
```
After change:
```js
enum InterruptRequestType {
INTERRUPT_REQUEST_TYPE_DEFAULT = 0,
}
```
## cl.multimedia.audio.007 Listener Registration Name Change of interrupt
The listener registration name of **interrupt** of the **on()** function in **AudioRenderer** is changed.
**Change Impact**
If the new mode is not used, an error will be reported during compilation.
**Key API/Component Changes**
Before change:
```js
interface AudioRenderer {
on(type: 'interrupt', callback: Callback<InterruptEvent>): void;
}
```
After change:
```js
interface AudioRenderer {
on(type: 'audioInterrupt', callback: Callback<InterruptEvent>): void;
}
```
## cl.multimedia.media.001 Change of VideoRecorder APIs to System APIs
In the MR version, the formal **AVRecorder** APIs (integrating audio and video) will be provided for external use.
**VideoRecorder** APIs in API version 9 are changed to system APIs, which are available only to system users. In the future, **VideoRecorder** APIs will be deprecated after system users switch to **AVRecorder**.
**Change Impact**
If the **VideoRecorder** caller is not a system user, the call will fail.
Involved APIs and enums:
function createVideoRecorder(callback: AsyncCallback<VideoRecorder>): void;
function createVideoRecorder(): Promise<VideoRecorder>;
type VideoRecordState = 'idle' | 'prepared' | 'playing' | 'paused' | 'stopped' | 'error';
interface VideoRecorder{
prepare(config: VideoRecorderConfig, callback: AsyncCallback<void>): void;
prepare(config: VideoRecorderConfig): Promise<void>;
getInputSurface(callback: AsyncCallback<string>): void;
getInputSurface(): Promise<string>;
start(callback: AsyncCallback<void>): void;
start(): Promise<void>;
pause(callback: AsyncCallback<void>): void;
pause(): Promise<void>;
resume(callback: AsyncCallback<void>): void;
resume(): Promise<void>;
stop(callback: AsyncCallback<void>): void;
stop(): Promise<void>;
release(callback: AsyncCallback<void>): void;
release(): Promise<void>;
reset(callback: AsyncCallback<void>): void;
reset(): Promise<void>;
on(type: 'error', callback: ErrorCallback): void;
readonly state: VideoRecordState;
}
interface VideoRecorderProfile {
readonly audioBitrate: number;
readonly audioChannels: number;
readonly audioCodec: CodecMimeType;
readonly audioSampleRate: number;
readonly fileFormat: ContainerFormatType;
readonly videoBitrate: number;
readonly videoCodec: CodecMimeType;
readonly videoFrameWidth: number;
readonly videoFrameHeight: number;
readonly videoFrameRate: number;
}
enum AudioSourceType {
AUDIO_SOURCE_TYPE_DEFAULT = 0,
AUDIO_SOURCE_TYPE_MIC = 1,
}
enum VideoSourceType {
VIDEO_SOURCE_TYPE_SURFACE_YUV = 0,
VIDEO_SOURCE_TYPE_SURFACE_ES = 1,
}
enum VideoRecorderConfig {
audioSourceType?: AudioSourceType;
videoSourceType: VideoSourceType;
profile: VideoRecorderProfile;
url: string;
rotation?: number;
location?: Location;
}
## cl.multimedia.media.002 No Externally Provided Bit Rate Selection API in VideoPlayer
In API version 9, **VideoPlayer** does not externally provide the bit rate selection API. Such an API will be provided by **AVPlayer** in the MR version.
**Change Impact**
Bit rate selection cannot be performed in the multi-bit rate scenario of **VideoPlayer**. Relevant functions will be provided by **AVPlayer**.
**Key API/Component Changes**
Deleted APIs:
interface VideoPlayer {
selectBitrate(bitrate: number): Promise<number>;
selectBitrate(bitrate: number, callback: AsyncCallback<number>): void;
on(type: 'availableBitratesCollect', callback: (bitrates: Array<number>) => void): void;
}
## cl.multimedia.media.003 Error Information Change of VideoRecorder
Original error codes of **VideoRecorder** are changed because they do not comply with the error code specifications.
**Change Impact**
Error codes returned from **VideoRecorder** are changed.
**Key API/Component Changes**
**VideoRecorder** APIs remain unchanged, but the returned error codes are changed.
**Adaptation Guide**
For details about exception handling, see the following documents:
https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-media.md
https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/errorcodes/errorcode-media.md
# Resource Manager Changelog
## cl.resourceManager.1 Name Change of Some Multi-Project APIs in API Version 9 of Resource Manager
The resource manager can return error codes and error information for APIs in API version 9 and later. Some multi-project APIs in API version 9 need to be adapted. The following changes are made in API version 9:
Some multi-project APIs of the resource manager need to be replaced with new APIs, and the parameters remain unchanged.
**Change Impact**
For applications developed based on earlier versions, relevant JavaScript multi-project APIs need to be replaced with new APIs.
**Key API/Component Changes**
| **Original API** | **New API**|
| ---------------- | ------------ |
| getString(resource: Resource, <br>callback: AsyncCallback\<string>): void; | getStringValue(resource: Resource, <br>callback: AsyncCallback\<string>): void; |
| getString(resource: Resource): Promise\<string>; | getStringValue(resource: Resource): Promise\<string>; |
| getStringArray(resource: Resource, <br>callback: AsyncCallback\<Array\<string>>): void; | getStringArrayValue(resource: Resource, <br>callback: AsyncCallback\<Array\<string>>): void; |
| getStringArray(resource: Resource): Promise\<Array\<string>>; | getStringArrayValue(resource: Resource): Promise\<Array\<string>>; |
| getMedia(resource: Resource, <br>callback: AsyncCallback\<Uint8Array>): void; | getMediaContent(resource: Resource, <br>callback: AsyncCallback\<Uint8Array>): void; |
| getMedia(resource: Resource): Promise\<Uint8Array>; | getMediaContent(resource: Resource): Promise\<Uint8Array>; |
| getMediaBase64(resource: Resource, <br>callback: AsyncCallback\<string>): void; | getMediaContentBase64(resource: Resource, <br>callback: AsyncCallback\<string>): void; |
| getMediaBase64(resource: Resource): Promise\<string>; | getMediaContentBase64(resource: Resource): Promise\<string>; |
| getPluralString(resource: Resource, num: number, <br>callback: AsyncCallback<string>): void; | getPluralStringValue(resource: Resource, num: number, <br>callback: AsyncCallback\<string>): void; |
| getPluralString(resource: Resource, num: number): Promise\<string>; | getPluralStringValue(resource: Resource, num: number): Promise\<string>; |
**Adaptation Guide**
The following describes how to change **getMedia** to **getMediaContent** in callback mode. The promise mode is similar. You only need to change the function name, add the error code and error information, and keep other information unchanged. The code snippet is as follows:
- Before the change: **getMedia(resource: Resource, callback: AsyncCallback<Uint8Array>): void;**
```ts
let resource = {
bundleName: "com.example.myapplication",
moduleName: "entry",
id: $r('app.media.test').id
};
this.context.resourceManager.getMedia(resource, (error, value) => {
if (error != null) {
console.log("error is " + error);
} else {
let media = value;
}
});
```
- After the change: **getMediaContent(resource: Resource, callback: AsyncCallback<Uint8Array>): void;**
```ts
let resource = {
bundleName: "com.example.myapplication",
moduleName: "entry",
id: $r('app.media.test').id
};
try {
this.context.resourceManager.getMediaContent(resource, (error, value) => {
if (error != null) {
console.log("error is " + error);
} else {
let media = value;
}
});
} catch (error) {
console.error(`callback getMediaContent failed, error code: ${error.code}, message: ${error.message}.`)
}
```
\ No newline at end of file
# WantAgent JS API Changelog
## cl.url.1 Trigger API Changes
trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: Callback<CompleteData>): void ;
This API has been deleted, because some functions have not been implemented. Your application can call the following API:
trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: AsyncCallback<CompleteData>): void
**Change Impact**
Released JS APIs are affected. The application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version.
**Key API/Component Changes**
| OpenHarmony 3.2.8.1 API | OpenHarmony 3.2.9.1 SP8 API |
| ------------------------------------------------------------ | ------------------------------------------------------------ |
| trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: Callback<CompleteData>): void ; | trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: AsyncCallback<CompleteData>): void |
**Adaptation Guide**
The following illustrates how to call the alternative **trigger** API in your application.
Example:
```ts
import WantAgent from '@ohos.app.ability.wantAgent';
// WantAgent object
var wantAgent;
// triggerInfo
var triggerInfo = {
code: 0
}
// WantAgentInfo object
var wantAgentInfo = {
wants: [
{
deviceId: "deviceId",
bundleName: "com.neu.setResultOnAbilityResultTest1",
abilityName: "com.example.test.MainAbility",
action: "action1",
entities: ["entity1"],
type: "MIMETYPE",
uri: "key={true,true,false}",
parameters:
{
mykey0: 2222,
mykey1: [1, 2, 3],
mykey2: "[1, 2, 3]",
mykey3: "ssssssssssssssssssssssssss",
mykey4: [false, true, false],
mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"],
mykey6: true,
}
}
],
operationType: WantAgent.OperationType.START_ABILITIES,
requestCode: 0,
wantAgentFlags:[WantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG]
}
// getWantAgent callback
function getWantAgentCallback(err, data) {
if (err == undefined) {
wantAgent = data;
} else {
console.info('getWantAgent failed' + JSON.stringify(wantAgent));
}
// getUid callback
function triggerCallback(err, data) {
if(err) {
console.info('getUid failed!' + JSON.stringify(err.code) + JSON.stringify(err.message));
} else {
console.info('getUid ok!' + JSON.stringify(data));
}
}
try {
WantAgent.trigger(wantAgent, triggerInfo, triggerCallback);
} catch(err) {
console.info('getUid failed!' + JSON.stringify(err.code) + JSON.stringify(err.message));
}
}
try{
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err){
console.info('getWantAgent failed!' + JSON.stringify(err.code) + JSON.stringify(err.message));
}
```
# Readme
- [Ability framework](changelogs-ability.md)
- [Account subsystem](changelogs-account_os_account.md)
- [ArkUI development framework](changelogs-arkui.md)
- [Multimedia subsystem - camera](changelogs-camera-sync.md)
- [Common library subsystem - container](changelogs-container.md)
- [Distributed data management](changelogs-distributeddatamgr.md)
- [File management subsystem](changelogs-filemanagement.md)
- [Input method framework](changelogs-inputmethod-framworks.md)
- [File management subsystem - MediaLibrary](changelogs-mediaLibrary.md)
- [Multimedia subsystem](changelogs-multimedia.md)
- [Communication subsystem - NFC](changelogs-nfc.md)
- [Common event and notification subsystem](changelogs-notification.md)
- Location subsystem
- [ohos.geoLocationManager](changelogs-ohos-geoLocationManager.md)
- [ohos.geoLocation](changelogs-ohos-geoLocation.md)
- [system.geolocation](changelogs-system-geolocation.md)
- [Upload and download](changelogs-request.md)
- [Resource scheduler subsystem](changelogs-resourceschedule.md)
- [Security subsystem](changelogs-security.md)
- [Telephony subsystem](changelogs-telephony.md)
- [Time service](changelogs-time.md)
- [Common library subsystem - URL](changelogs-url.md)
- [User IAM subsystem](changelogs-useriam.md)
- [Window manager subsystem](changelogs-window.md)
# Readme
- [Account](changelogs-account_os_account.md)
- [Distributed Data Management](changelogs-distributeddatamgr.md)
- [File Management](changelogs-filemanagement.md)
- [User IAM](changelogs-useriam.md)
# *Example* Subsystem Changelog
Changes that affect contract compatibility of the last version should be described in the changelog. The changes include but are not limited to those related to API names, parameters, return values, required permissions, call sequence, enumerated values, configuration parameters, and paths. The last version can be an LTS, release, beta, or monthly version, or the like. Contract compatibility, also called semantic compatibility, means that the original program behavior should remain consistent over versions.
## cl.subsystemname.x xxx Function Change (Example: DeviceType Attribute Change or Camera Permission Change. Use a short description.)
Add the number **cl.*subsystemname*.*x*** before each change title, where **cl** is the abbreviation of changelog, *subsystemname* is the standard English name of the subsystem, and *x* indicates the change sequence number (starting from 1 in ascending order).
Describe the changes in terms of functions. Example: *n* and *m* of the *a* function are changed. Developers need to adapt their applications based on the change description.
If there is a requirement or design document corresponding to the change, attach the requirement number or design document number in the description.
**Change Impact**
Describe whether released APIs (JS or native APIs) are affected or API behavior is changed.
Describe whether available applications are affected, that is, whether an adaptation is required for building the application code in the SDK environment of the new version.
**Key API/Component Changes**
List the API/component changes involved in the function change.
**Adaptation Guide**
Provide guidance for developers on how to adapt their application to the changes to be compatible with the new version.
Example:
Change parameter *n* to *m* in the *a* file.
```
sample code
```
# Ability Framework Changelog
## cl.ability.1 API Migration
The **requestPermissionsFromUser** API of **UIAbilityContext** is migrated from the ability subsystem to the security subsystem.
Previously, the permission popup was implemented based on **UIAbility**, which used the **startAbilityForResult** API of **UIAbilityContext** to return the permission authorization result to the caller. Therefore, **requestPermissionsFromUser** was temporarily placed in **UIAbilityContext**. The permission popup is now implemented based on **ServiceExtensionAbility**, which no longer requires **startAbilityForResult** of **UIAbilityContext**. Therefore, **requestPermissionsFromUser** is migrated to the security subsystem.
You need to adapt your application based on the following information.
**Change Impact**
JS APIs in API version 9 are affected. Your application needs to adapt these APIs so that it can properly implement features in the SDK environment of the new version.
**Key API/Component Changes**
| Module | Class | Method/Attribute/Enum/Constant | Change Type|
| ------------------------- | ------------------- | ------------------------------------------------------------ | -------- |
| application/UIAbilityContext | UIAbilityContext | requestPermissionsFromUser(permissions: Array<string>, requestCallback: AsyncCallback<PermissionRequestResult>): void; | Deleted |
| application/UIAbilityContext | UIAbilityContext | requestPermissionsFromUser(permissions: Array<string>): Promise<PermissionRequestResult>; | Deleted |
| @ohos.abilityAccessCtrl | AtManager | requestPermissionsFromUser(context: Context, permissions: Array<Permissions>, requestCallback: AsyncCallback<PermissionRequestResult>) : void; | Added |
| @ohos.abilityAccessCtrl | AtManager | requestPermissionsFromUser(context: Context, permissions: Array<Permissions>) : Promise<PermissionRequestResult>; | Added |
**Adaptation Guide**
The following illustrates how **requestPermissionsFromUser** is called to show a permission popup.
Stage model:
```ts
import abilityAccessCtrl from '@ohos.abilityAccessCtrl.d.ts';
// onWindowStageCreate lifecycle of UIAbility.
onWindowStageCreate() {
let AtManager = abilityAccessCtrl.createAtManager();
// requestPermissionsFromUser determines whether to display a popup based on the permission authorization status.
AtManager.requestPermissionsFromUser(this.context, ["ohos.permission.MANAGE_DISPOSED_APP_STATUS"]).then((data) => {
console.log("data type:" + typeof(data));
console.log("data:" + data);
console.log("data permissions:" + data.permissions);
console.log("data result:" + data.authResults);
}).catch((err) => {
console.error('Failed to start ability', err.code);
})
}
```
## cl.ability.2 Deletion of Deprecated APIs in API Version 9
In the [Ability Exception Rectification](../OpenHarmony_3.2.8.3/changelogs-ability.md) document, some APIs in API version 9 have been marked as deprecated. According to API specifications of OpenHarmony, these APIs should be deleted.
**Change Impact**
The application developed based on earlier versions needs to use new APIs to replace the deleted ones. Otherwise, the application compilation will be affected.
**Key API/Component Changes**
API files are deleted.
| Deleted API | New API |
| ----------------------------------------------- | ----------------------------------------------- |
| @ohos.application.Ability.d.ts | @ohos.app.ability.UIAbility.d.ts |
| @ohos.application.AbilityConstant.d.ts | @ohos.app.ability.AbilityConstant.d.ts |
| @ohos.application.AbilityLifecycleCallback.d.ts | @ohos.app.ability.AbilityLifecycleCallback.d.ts |
| @ohos.application.AbilityStage.d.ts | @ohos.app.ability.AbilityStage.d.ts |
| @ohos.application.EnvironmentCallback.d.ts | @ohos.app.ability.EnvironmentCallback.d.ts |
| @ohos.application.ExtensionAbility.d.ts | @ohos.app.ability.ExtensionAbility.d.ts |
| @ohos.application.FormExtension.d.ts | @ohos.app.form.FormExtensionAbility.d.ts |
| @ohos.application.ServiceExtensionAbility.d.ts | @ohos.app.ability.ServiceExtensionAbility.d.ts |
| @ohos.application.StartOptions.d.ts | @ohos.app.ability.StartOptions.d.ts |
| @ohos.application.context.d.ts | @ohos.app.ability.common.d.ts |
| @ohos.application.errorManager.d.ts | @ohos.app.ability.errorManager.d.ts |
APIs or attributes are deleted:
- @ohos.application.Configuration.d.ts
- **direction**, **screenDensity**, **displayId**, and **hasPointerDevice** of **Configuration** are deleted. Use **Configuration** of **@ohos.app.ability.Configuration.d.ts**.
- @ohos.application.ConfigurationConstant.d.ts
- **Direction** and **ScreenDensity** are deleted. Use **Direction** and **ScreenDensity** of **@ohos.app.ability.ConfigurationConstant.d.ts**.
- @ohos.application.abilityManager.d.ts
- **getExtensionRunningInfos** and **getTopAbility** are deleted. Use the APIs with the same name in **@ohos.app.ability.abilityManager.d.ts**.
- @ohos.application.appManager.d.ts
- **ApplicationState** and **ProcessState** are deleted. Use **ApplicationState** and **ProcessState** of **@ohos.app.ability.appManager.d.ts**.
- **registerApplicationStateObserver** and **getProcessRunningInformation** are deleted. Use the APIs with the same name in **@ohos.app.ability.appManager.d.ts**.
- @ohos.application.formHost.d.ts
- **shareForm** and **notifyFormsPrivacyProtected** are deleted. Use the APIs with the same name in **@ohos.app.form.formHost.d.ts**.
- @ohos.application.formInfo.d.ts
- **eTS** of **FormType** is deleted. Use **eTS** of **FormType** in **@ohos.app.form.formInfo.d.ts**.
- **IDENTITY_KEY**, **BUNDLE_NAME_KEY**, **ABILITY_NAME_KEY**, and **DEVICE_ID_KEY** of **FormParam** are deleted. Use the enums with the same name in **@ohos.app.form.formInfo.d.ts**.
- **FormInfoFilter** is deleted. Use **FormInfoFilter** of **@ohos.app.form.formInfo.d.ts**.
- **FormDimension** is deleted. Use **FormDimension** of **@ohos.app.form.formInfo.d.ts**.
- **VisibilityType** is deleted. Use **VisibilityType** of **@ohos.app.form.formInfo.d.ts**.
- @ohos.wantAgent.d.ts
- **trigger** and **getOperationType** are deleted. Use the APIs with the same name in **@ohos.app.ability.wantAgent.d.ts**.
- application/ApplicationContext.d.ts
- **registerAbilityLifecycleCallback**, **unregisterAbilityLifecycleCallback**, **registerEnvironmentCallback**, and **unregisterEnvironmentCallback** are deleted. Use **on** and **off**.
- application/ServiceExtensionContext.d.ts
- **connectAbility**, **connectAbilityWithAccount**, and **disconnectAbility** are deleted. Use **connectServiceExtensionAbility**, **connectServiceExtensionAbilityWithAccount**, and **disconnectServiceExtensionAbility**.
- @ohos.application.FormExtension.d.ts
- **onCreate**, **onCastToNormal**, **onUpdate**, **onVisibilityChange**, **onEvent**, **onDestroy**, **onAcquireFormState**, and **onShare** are deleted. Use the following lifecycle methods of **@ohos.app.form.FormExtensionAbility.d.ts**: **onAddForm**, **onCastToNormalForm**, **onUpdateForm**, **onChangeFormVisibility**, **onFormEvent**, **onRemoveForm**, **onAcquireFormState**, and **onShareForm**.
- @ohos.application.abilityDelegatorRegistry.d.ts
- **AbilityDelegator**, **AbilityDelegatorArgs**, **AbilityMonitor**, and **ShellCmdResult** are deleted. Use the classes with the same name in **@ohos.app.ability.abilityDelegatorRegistry.d.ts**.
- @ohos.application.abilityManager.d.ts
- **AbilityRunningInfo** and **ExtensionRunningInfo** are deleted. Use the classes with the same name in **@ohos.app.ability.abilityManager.d.ts**.
- @ohos.application.appManager.d.ts
- **AbilityStateData**, **AppStateData**, **ApplicationStateObserver**, **ProcessRunningInfo**, and **ProcessRunningInformation** are deleted. Use the classes with the same name in **@ohos.app.ability.appManager.d.ts**.
- @ohos.application.missionManager.d.ts
- **MissionInfo**, **MissionListener**, and **MissionSnapshot** are deleted. Use the classes with the same name in **@ohos.app.ability.missionManager.d.ts**.
- @ohos.wantAgent.d.ts
- **TriggerInfo** and **WantAgentInfo** are deleted. Use the classes with the same name in **@ohos.app.ability.wantAgent.d.ts**.
**Adaptation Guide**
As mentioned above, only several APIs have their names changed in terms of, for example, the registration callbacks (**registerAbilityLifecycleCallback**, **unregisterAbilityLifecycleCallback**, **registerEnvironmentCallback**, and **unregisterEnvironmentCallback**) and connection and disconnection **ServiceExtensionAbility** (**connectAbility**, **connectAbilityWithAccount**, and **disconnectAbility**). For such APIs, replace their names with those of their corresponding new APIs in the lifecycle callbacks.
Most APIs are moved to the new namespace. Therefore, you can modify **import** for adaptation.
For example, the original API uses **@ohos.application.Ability**:
```js
import Ability from '@ohos.application.Ability';
```
You can directly modify **import** to switch to the new namespace:
```js
import Ability from '@ohos.app.ability.UIAbility';
```
In addition, exception handling is needed. For details, see the API reference for the new APIs.
## cl.ability.2 RestartFlag Attribute Names Changed and Unsupported Attribute Deleted in appRecovery
In the **appRecovery** API, the enum names of **RestartFlag** are changed from **NO_RESTART** upon a specific fault to **RESTART** upon a specific fault.
The **CPP_CRASH_NO_RESTART** enum is deleted.
**Change Impact**
If your application uses the **CPP_CRASH_NO_RESTART**, **JS_CRASH_NO_RESTART**, or **APP_FREEZE_NO_RESTART** attribute in versions earlier than 3.2.10.6, its behavior will change after an upgrade to 3.2.10.6.
**Key API/Component Changes**
**RestartFlag** <sup>9+</sup>
Before change
| Name | Value | Description |
| --------------------- | ------ | -------------------------------- |
| ALWAYS_RESTART | 0 | The application is restarted in all cases. |
| CPP_CRASH_NO_RESTART | 0x0001 | The application is **not restarted** in the case of CPP_CRASH. |
| JS_CRASH_NO_RESTART | 0x0002 | The application is **not restarted** in the case of JS_CRASH. |
| APP_FREEZE_NO_RESTART | 0x0004 | The application is **not restarted** in the case of APP_FREEZE.|
| NO_RESTART | 0xFFFF | The application is not restarted in any case. |
After change
| Name | Value | Description |
| ----------------------- | ------ | ------------------------------ |
| ALWAYS_RESTART | 0 | The application is restarted in all cases. |
| CPP_CRASH_NO_RESTART | NA | **Deleted.** The restart in this scenario is not supported.|
| RESTART_WHEN_JS_CRASH | 0x0001 | The application is **restarted** in the case of JS_CRASH. |
| RESTART_WHEN_APP_FREEZE | 0x0002 | The application is **restarted** in the case of APP_FREEZE.|
| NO_RESTART | 0xFFFF | The application is not restarted in any case. |
**Adaptation Guide**
Perform adaptation based on the new semantics.
# Common Library Subsystem Changelog
## cl.commonlibrary.1 Error Code and Information Change
The error codes and information returned by APIs of the **ArrayList**, **List**, **LinkedList**, **Stack**, **Queue**, **Deque**, **PlainArray**, **LightWeightMap**, **LightWeightSet**, **HashMap**, **HashSet**, **TreeMap**, and **TreeSet** classes are changed.
For details about the changed error codes, see [Utils Error Codes](../../../application-dev/reference/errorcodes/errorcode-utils.md).
No adaptation is required for applications developed using these APIs.
**Key API/Component Changes**
Error code information is redefined for APIs in these classes and marked using **'@throws'** in the *.d.ts file of the corresponding module.
The sample code is as follows:
**ArrayList** class before the change:
constructor();
**ArrayList** class after the change:
@throws { BusinessError } 10200012 - The ArrayList's constructor cannot be directly invoked.
constructor();
**Change Impact**
No impact.
# File Management Subsystem Changelog
## cl.file.1 mediaLibrary APIs Changed
The **MediaLibrary** class of the multimedia component is replaced by the **FilePicker** class.
**Change Impact**
For applications developed based on earlier versions, pay attention to the changes of APIs. **FilePicker** is a system application preset in OpenHarmony. You can use it to select and save files.
**Key API/Component Changes**
The APIs of **MediaLibrary**, located in **@ohos.multimedia.medialibrary**, are deprecated. The **FilePicker** class, located in [@ohos.file.picker](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.file.picker.d.ts) is used.
| Module | Method/Attribute/Enum/Constant | Change Type|
| ------------------------- | ------------------------------------------------------------ | -------- |
| medialibrary | **function** getMediaLibrary(): MediaLibrary; | Deprecated |
| medialibrary | **function** getMediaLibrary(context: Context): MediaLibrary; | Deprecated |
| medialibrary | **function** getFileAssets(options: MediaFetchOptions, callback: AsyncCallback\<FetchFileResult\>): void | Deprecated |
| medialibrary | **function** getFileAssets(options: MediaFetchOptions): Promise\<FetchFileResult\> | Deprecated |
| medialibrary | **function** on(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback: Callback\<void\>): void | Deprecated |
| medialibrary | **function** off(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback?: Callback\<void\>): void | Deprecated |
| medialibrary | **function** createAsset(mediaType: MediaType, displayName: string, relativePath: string, callback: AsyncCallback\<FileAsset\>): void | Deprecated |
| medialibrary | **function** createAsset(mediaType: MediaType, displayName: string, relativePath: string): Promise\<FileAsset\> | Deprecated |
| medialibrary | **function** deleteAsset(uri: string): Promise\<void\> | Deprecated |
| medialibrary | **function** deleteAsset(uri: string, callback: AsyncCallback\<void\>): void | Deprecated |
| medialibrary | **function** getPublicDirectory(type: DirectoryType, callback: AsyncCallback\<string\>): void | Deprecated |
| medialibrary | **function** getPublicDirectory(type: DirectoryType): Promise\<string\> | Deprecated |
| medialibrary | **function** getAlbums(options: MediaFetchOptions, callback: AsyncCallback\<Array\<Album\>\>): void | Deprecated |
| medialibrary | **function** getAlbums(options: MediaFetchOptions): Promise\<Array\<Album\>\> | Deprecated |
| medialibrary | **function** release(callback: AsyncCallback\<void\>): void | Deprecated |
| medialibrary | **function** release(): Promise\<void\> | Deprecated |
| medialibrary | **function** storeMediaAsset(option: MediaAssetOption, callback: AsyncCallback\<string\>): void | Deprecated |
| medialibrary | **function** storeMediaAsset(option: MediaAssetOption): Promise\<string\> | Deprecated |
| medialibrary | **function** startImagePreview(images: Array\<string\>, index: number, callback: AsyncCallback\<void\>): void | Deprecated |
| medialibrary | **function** startImagePreview(images: Array\<string\>, callback: AsyncCallback\<void\>): void | Deprecated |
| medialibrary | **function** startImagePreview(images: Array\<string\>, index?: number): Promise\<void\> | Deprecated |
| medialibrary | **function** startMediaSelect(option: MediaSelectOption, callback: AsyncCallback\<Array\<string\>\>): void | Deprecated |
| medialibrary | **function** startMediaSelect(option: MediaSelectOption): Promise\<Array\<string\>\> | Deprecated |
| medialibrary | **function** getActivePeers(): Promise\<Array\<PeerInfo\>\>; | Deprecated |
| medialibrary | **function** getActivePeers(callback: AsyncCallback\<Array\<PeerInfo\>\>): void; | Deprecated |
| medialibrary | **function** getAllPeers(): Promise\<Array\<PeerInfo\>\>; | Deprecated |
| medialibrary | **function** FileAsset.isDirectory(callback: AsyncCallback\<boolean\>): void | Deprecated |
| medialibrary | **function** FileAsset.isDirectory():Promise\<boolean\> | Deprecated |
| medialibrary | **function** FileAsset.commitModify(callback: AsyncCallback\<void\>): void | Deprecated |
| medialibrary | **function** FileAsset.commitModify(): Promise\<void\> | Deprecated |
| medialibrary | **function** FileAsset.open(mode: string, callback: AsyncCallback\<number\>): void | Deprecated |
| medialibrary | **function** FileAsset.open(mode: string): Promise\<number\> | Deprecated |
| medialibrary | **function** FileAsset.close(fd: number, callback: AsyncCallback\<void\>): void | Deprecated |
| medialibrary | **function** FileAsset.close(fd: number): Promise\<void\> | Deprecated |
| medialibrary | **function** FileAsset.getThumbnail(callback: AsyncCallback\<image.PixelMap\>): void | Deprecated |
| medialibrary | **function** FileAsset.getThumbnail(size: Size, callback: AsyncCallback\<image.PixelMap\>): void | Deprecated |
| medialibrary | **function** FileAsset.getThumbnail(size?: Size): Promise\<image.PixelMap\> | Deprecated |
| medialibrary | **function** FileAsset.favorite(isFavorite: boolean, callback: AsyncCallback\<void\>): void | Deprecated |
| medialibrary | **function** FileAsset.favorite(isFavorite: boolean): Promise\<void\> | Deprecated |
| medialibrary | **function** FileAsset.isFavorite(callback: AsyncCallback\<boolean\>): void | Deprecated |
| medialibrary | **function** FileAsset.isFavorite():Promise\<boolean\> | Deprecated |
| medialibrary | **function** FileAsset.trash(isTrash: boolean, callback: AsyncCallback\<void\>): void | Deprecated |
| medialibrary | **function** FileAsset.trash(isTrash: boolean): Promise\<void\> | Deprecated |
| medialibrary | **function** FileAsset.isTrash(callback: AsyncCallback\<boolean\>): void | Deprecated |
| medialibrary | **function** FileAsset.isTrash():Promise\<boolean\> | Deprecated |
| medialibrary | **function** FetchFileResult.getCount(): number | Deprecated |
| medialibrary | **function** FetchFileResult.isAfterLast(): boolean | Deprecated |
| medialibrary | **function** FetchFileResult.close(): void | Deprecated |
| medialibrary | **function** FetchFileResult.getFirstObject(callback: AsyncCallback\<FileAsset\>): void | Deprecated |
| medialibrary | **function** FetchFileResult.getFirstObject(): Promise\<FileAsset\> | Deprecated |
| medialibrary | **function** FetchFileResult.getNextObject(callback: AsyncCallback\<FileAsset\>): void | Deprecated |
| medialibrary | **function** FetchFileResult.getNextObject(): Promise\<FileAsset\> | Deprecated |
| medialibrary | **function** FetchFileResult.getLastObject(callback: AsyncCallback\<FileAsset\>): void | Deprecated |
| medialibrary | **function** FetchFileResult.getLastObject(): Promise\<FileAsset\> | Deprecated |
| medialibrary | **function** FetchFileResult.getPositionObject(index: number, callback: AsyncCallback\<FileAsset\>): void | Deprecated |
| medialibrary | **function** FetchFileResult.getPositionObject(index: number): Promise\<FileAsset\> | Deprecated |
| medialibrary | **function** FetchFileResult.getAllObject(callback: AsyncCallback\<Array\<FileAsset\>\>): void | Deprecated |
| medialibrary | **function** FetchFileResult.getAllObject(): Promise\<Array\<FileAsset\>\> | Deprecated |
| medialibrary | **function** Album.commitModify(callback: AsyncCallback\<void\>): void | Deprecated |
| medialibrary | **function** Album.commitModify(): Promise\<void\> | Deprecated |
| medialibrary | **function** Album.getFileAssets(options: MediaFetchOptions, callback: AsyncCallback\<FetchFileResult\>): void | Deprecated |
| medialibrary | **function** Album.getFileAssets(options?: MediaFetchOptions): Promise\<FetchFileResult\> | Deprecated |
| medialibrary | **enum** DeviceType | Deprecated |
| medialibrary | **enum** FileKey | Deprecated |
| medialibrary | **enum** DirectoryType | Deprecated |
| medialibrary | **enum** MediaType | Deprecated |
| medialibrary | **interface** PeerInfo | Deprecated |
| medialibrary | **interface** Size | Deprecated |
| medialibrary | **interface** MediaFetchOptions | Deprecated |
| medialibrary | **interface** MediaAssetOption | Deprecated |
| medialibrary | **interface** MediaSelectOption | Deprecated |
| medialibrary | **interface** FileAsset | Deprecated |
**Adaptation Guide**
For example, refer to the code snippet below to call an API to select an image:
```js
import picker from '@ohos.file.picker';
async function example() {
try {
let PhotoSelectOptions = new picker.PhotoSelectOptions();
PhotoSelectOptions.MIMEType = picker.PhotoViewMIMETypes.IMAGE_TYPE;
PhotoSelectOptions.maxSelectNumber = 1;
let photoPicker = new picker.PhotoViewPicker();
photoPicker.select(PhotoSelectOptions).then((PhotoSelectResult) => {
if (PhotoSelectResult !== undefined) {
console.info("PhotoViewPicker.select pass, PhotoSelectResult uri: " + JSON.stringify(PhotoSelectResult));
} else {
console.error("PhotoViewPicker.select PhotoSelectResult is undefined");
}
}).catch((err) => {
console.error("PhotoViewPicker.select fail, err: " + err);
});
} catch (err) {
console.error("PhotoViewPicker fail, err: " + err);
}
}
```
## cl.multimedia.av_session.001 Change of All av_session APIs to System APIs
All av_session APIs are changed to system APIs.
**Change Impact**
Non-system applications and applications without system API permission cannot call system APIs.
**Key API/Component Changes**
All APIs are changed to system APIs. The table below describes the APIs.
| API/Enum/Variable| Type| Is System API|
| -------- | -------- | ------- |
| SessionToken | interface | Yes|
| AVMetadata | interface | Yes|
| AVPlaybackState | interface | Yes|
| PlaybackPosition | interface | Yes|
| OutputDeviceInfo | interface | Yes|
| AVSessionDescriptor | interface | Yes|
| AVSessionController | interface | Yes|
| AVControlCommand | interface | Yes|
| createAVSession | function | Yes|
| getAllSessionDescriptors | function | Yes|
| createController | function | Yes|
| castAudio | function | Yes|
| on | function | Yes|
| off | function | Yes|
| sendSystemAVKeyEvent | function | Yes|
| sendSystemControlCommand | function | Yes|
| sessionId | variable | Yes|
| setAVMetadata | function | Yes|
| setAVPlaybackState | function | Yes|
| setLaunchAbility | function | Yes|
| getController | function | Yes|
| getOutputDevice | function | Yes|
| activate | function | Yes|
| deactivate | function | Yes|
| destroy | function | Yes|
| getAVPlaybackState | function | Yes|
| getAVMetadata | function | Yes|
| getOutputDevice | function | Yes|
| sendAVKeyEvent | function | Yes|
| getLaunchAbility | function | Yes|
| getRealPlaybackPositionSync | function | Yes|
| isActive | function | Yes|
| getValidCommands | function | Yes|
| sendControlCommand | function | Yes|
| AVSessionType | type | Yes|
| AVControlCommandType | type | Yes|
| LoopMode | enum | Yes|
| PlaybackState | enum | Yes|
| AVSessionErrorCode | enum | Yes|
# Resource Scheduler Subsystem Changelog
## cl.resourceschedule.backgroundTaskManager
Rectified the original APIs of **backgroundTaskManager** of the resource scheduler subsystem. All APIs of API version 9 in the **@ohos.backgroundTaskManager.d.ts** file are deleted, and the APIs of API version 9 in the **@ohos.resourceschedule.backgroundTaskManager.d.ts** file are used. The new APIs in API version 9 comply with the error code specifications.
**Change Impacts**
If your application is developed based on the SDK versions of OpenHarmony 3.2.10.5 and later, adapt to the modules and APIs in API version 9 and the pattern for returning error codes. Otherwise, the service logic will be affected.
**Key API/Component Changes**
The following methods, attributes, enums, and constants are changed in API version 9 and later versions. All the APIs in the **@ohos.backgroundTaskManager.d.ts** file are migrated to the **@ohos.resourceschedule.backgroundTaskManager.d.ts** file.
| Class| API Type| Declaration| Description|
| -- | -- | -- | -- |
| backgroundTaskManager | method | function resetAllEfficiencyResources(): void; | Deleted in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager | method | function applyEfficiencyResources(request: EfficiencyResourcesRequest): bool; | Changed in API version 9 to **function applyEfficiencyResources(request: EfficiencyResourcesRequest): void;** and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.ResourceType | enum | export enum ResourceType | Deleted in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.ResourceType | enum | CPU = 1 | Deleted in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.ResourceType | enum | COMMON_EVENT = 1 << 1 | Deleted in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.ResourceType | enum | TIMER = 1 << 2 | Deleted in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.ResourceType | enum | WORK_SCHEDULER = 1 << 3 | Deleted in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.ResourceType | enum | BLUETOOTH = 1 << 4 | Deleted in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.ResourceType | enum | GPS = 1 << 5 | Deleted in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.ResourceType | enum | AUDIO = 1 << 6 | Deleted in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.EfficiencyResourcesRequest | interface | export interface EfficiencyResourcesRequest | Deleted in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.EfficiencyResourcesRequest | field | reason: string | Deleted in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.EfficiencyResourcesRequest | field | isProcess?: bool | Deleted in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.EfficiencyResourcesRequest | field | isPersist?: bool | Deleted in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.EfficiencyResourcesRequest | field | timeOut: number | Deleted in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.EfficiencyResourcesRequest | field | isApply: bool | Deleted in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
| backgroundTaskManager.EfficiencyResourcesRequest | field | resourceTypes: number | Deleted in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.|
**Adaptation Guide**
Import the **backgroundTaskManager** module.
```
import bundle form '@ohos.resourceschedule.backgroundTaskManager'
```
Exception handling also needs to be adapted. For details, see the [backgroundTaskManager API reference](../../../application-dev/reference/apis/js-apis-resourceschedule-backgroundTaskManager.md).
## c2.resourceschedule.workScheduler
Rectified the original APIs of **workScheduler** of the resource scheduler subsystem. All APIs of API version 9 in the **@ohos.workScheduler.d.ts** file are deleted, and the APIs of API version 9 in the **@ohos.resourceschedule.workScheduler.d.ts** file are used. The new APIs in API version 9 comply with the error code specifications.
**Change Impacts**
If your application is developed based on the SDK versions of OpenHarmony 3.2.10.5 and later, adapt to the modules and APIs in API version 9 and the pattern for returning error codes. Otherwise, the service logic will be affected.
**Key API/Component Changes**
The following methods, attributes, enums, and constants are changed in API version 9 and later versions. The **@ohos.workScheduler.d.ts** file is deleted, and all the APIs in it are moved to the **@ohos.resourceschedule.workScheduler.d.ts** file.
| Class| API Type| Declaration| Change Type|
| -- | -- | -- | -- |
| workScheduler | namespace | declare namespace workScheduler | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.WorkInfo | interface | export interface WorkInfo | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.WorkInfo | field | parameters?: {[key: string]: any} | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.WorkInfo | field | idleWaitTime?: number | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.WorkInfo | field | isDeepIdle?: boolean | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.WorkInfo | field | repeatCount?: number | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.WorkInfo | field | isRepeat?: boolean | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.WorkInfo | field | repeatCycleTime?: number | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.WorkInfo | field | storageRequest?: StorageRequest | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.WorkInfo | field | batteryStatus?: BatteryStatus | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.WorkInfo | field | batteryLevel?: number | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.WorkInfo | field | chargerType?: ChargingType | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.WorkInfo | field | isCharging?: boolean | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.WorkInfo | field | networkType?: NetworkType | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.WorkInfo | field | isPersisted?: boolean | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.WorkInfo | field | abilityName: string | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.WorkInfo | field | bundleName: string | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.WorkInfo | field | workId: number | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler | method | function isLastWorkTimeOut(workId: number): Promise; | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler | method | function isLastWorkTimeOut(workId: number, callback: AsyncCallback<void>): boolean; | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler | method | function stopAndClearWorks(): boolean; | Changed in API version 8 to **function stopAndClearWorks(): boolean;** and moved to the **ohos.resourceschedule.workScheduler.d.ts** file|
| workScheduler | method | function obtainAllWorks(): Promise<Array<WorkInfo>>; | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler | method | function obtainAllWorks(callback: AsyncCallback<void>): Array<WorkInfo>; | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler | method | function getWorkStatus(workId: number): Promise<WorkInfo>; | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler | method | function getWorkStatus(workId: number, callback: AsyncCallback<WorkInfo>): void; | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler | method | function stopWork(work: WorkInfo, needCancel?: boolean): boolean; | Changed in API version 8 to **function stopWork(work: WorkInfo, needCancel?: boolean): void;** and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler | method | function startWork(work: WorkInfo): boolean; | Changed in API version 9 to **function startWork(work: WorkInfo): void;** and moved to the **ohos.resourceschedule.workScheduler.d.ts** file|
| workScheduler.NetworkType | enum | export enum NetworkType | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.NetworkType | enum | NETWORK_TYPE_ANY = 0 | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.NetworkType | enum | NETWORK_TYPE_MOBILE | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.NetworkType | enum | NETWORK_TYPE_WIFI | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.NetworkType | enum | NETWORK_TYPE_BLUETOOTH | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.NetworkType | enum | NETWORK_TYPE_WIFI_P2P | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.NetworkType | enum | NETWORK_TYPE_ETHERNET | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.ChargingType | enum | export enum ChargingType | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.ChargingType | enum | CHARGING_PLUGGED_ANY = 0 | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.ChargingType | enum | CHARGING_PLUGGED_AC | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.ChargingType | enum | CHARGING_PLUGGED_USB | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.ChargingType | enum | CHARGING_PLUGGED_WIRELESS | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.BatteryStatus | enum | export enum BatteryStatus | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.BatteryStatus | enum | BATTERY_STATUS_LOW = 0 | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.BatteryStatus | enum | BATTERY_STATUS_OKAY | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.BatteryStatus | enum | BATTERY_STATUS_LOW_OR_OKAY | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.StorageRequest | enum | export enum StorageRequest | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.BatteryStatus | enum | STORAGE_LEVEL_LOW = 0 | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.BatteryStatus | enum | STORAGE_LEVEL_OKAY | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
| workScheduler.BatteryStatus | enum | STORAGE_LEVEL_LOW_OR_OKAY | Deleted in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.|
**Adaptation Guide**
Import the **workScheduler** module.
```
import bundle form '@ohos.resourceschedule.workScheduler'
```
Exception handling also needs to be adapted. For details, see the [workScheduler API reference](../../../application-dev/reference/apis/js-apis-resourceschedule-workScheduler.md).
# Common Library Subsystem Changelog
## cl.commonlibrary.1 URLParams Class Changes
The constructor function of the **URLParams** class in the URL module of the common library subsystem is changed.
Specifically, **constructor(init?: string[][] | Record<string, string> | string | URLSearchParams)** is changed to **constructor(init?: string[][] | Record<string, string> | string | URLParams)**, and the parameter type is changed from **URLSearchParams** to **URLParams**.
You need to adapt your application.
**Change Impacts**
JS APIs in API version 9 are affected. Your application needs to adapt these APIs so that it can properly implement features in the SDK environment of the new version.
**Key API/Component Changes**
| Module | Class | Method/Attribute/Enum/Constant | Change Type|
| :------------------------ | ------------------- | ------------------------------------------------------------ | -------- |
| @ohos.url | URLParams | constructor(string[][] \| Record&lt;string, string&gt; \| string \| URLSearchParams) | Deleted |
| @ohos.url | URLParams | constructor(string[][] \| Record&lt;string, string&gt; \| string \| URLParams)| Changed |
**Adaptation Guide**
The following illustrates how to create a **URLParams** object in your application.
Example:
```ts
import url from '@ohos.url'
try {
let params1 = new Url.URLParams('?user=abc&query=xyz')
let params2 = new Url.URLParams(params1)
var result= params2.toString()
console.log(result) //"user=abc&query=xyz"
} catch (err) {
console.error(`Fail to ceate URLParams.codeis${err.code},message is ${err.message}`);
}
```
## cl.commonlibrary.2 URL Attribute Changes of URLParams Class APIs
The URL attributes of the URL module in the common library subsystem are changed.
Specifically, the **searchParams: URLSearchParams** attribute is deprecated, and the **params: URLParams** attribute is added.
You need to adapt your application.
**Change Impacts**
JS APIs in API version 9 are affected. Your application needs to adapt these APIs so that it can properly implement features in the SDK environment of the new version.
**Key API/Component Changes**
| Module | Class | Method/Attribute/Enum/Constant | Change Type|
| :------------------------ | ------------------- | ------------------------------------------------------------ | -------- |
| @ohos.url | URL | searchParams: URLSearchParams; |Deprecated (in API version 9)<br> |
| @ohos.url | URL | params: URLParams; | Added |
**Adaptation Guide**
The following illustrates how to create a **URLParams** object in your application.
Example:
```ts
import url from '@ohos.url'
let that = new Url.URL('http://username:password@host:8080/directory/file?Hello=china#qwer=da')
let params = that.URLParams
var result = params.toString()
console.log(result) //%E4%BD%A0%E5%A5%BD=china
```
# Window Manager Subsystem Changelog
## cl.window.1 Change of Window Stage Lifecycle Listener Types
Changed the enumerated listener types of the window stage lifecycle in version 3.2.10.5 and later.
**Change Impacts**
Application lifecycle listeners developed using **FOREGROUND** and **BACKGROUND** in versions earlier than 3.2.10.5 will be invalidated in version 3.2.10.5 and later.
**Key API/Component Changes**
## WindowStageEventType<sup>9+</sup>
Before change
| Name | Value | Description |
| ---------- | ---- | ---------- |
| FOREGROUND | 1 | The window stage is running in the foreground.|
| BACKGROUND | 4 | The window stage is running in the background.|
After change
| Name | Value | Description |
| ------ | ---- | ---------- |
| SHOWN | 1 | The window stage is running in the foreground.|
| HIDDEN | 4 | The window stage is running in the background.|
**Adaptation Guide**
When registering lifecycle listeners, change the foreground and background event types to **SHOWN** and **HIDDEN**, respectively.
```
import Ability from '@ohos.application.Ability';
class myAbility extends Ability {
onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate');
try {
windowStage.on('windowStageEvent', (stageEventType) => {
switch (stageEventType) {
case window.WindowStageEventType.SHOWN:
console.log("windowStage shown");
break;
case window.WindowStageEventType.ACTIVE:
console.log("windowStage active");
break;
case window.WindowStageEventType.INACTIVE:
console.log("windowStage inActive");
break;
case window.WindowStageEventType.HIDDEN:
console.log("windowStage hidden");
break;
default:
break;
}
} )
} catch (exception) {
console.error('Failed to enable the listener for window stage event changes. Cause:' +
JSON.stringify(exception));
};
}
};
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册