提交 d5ca44da 编写于 作者: G Gloria

Update docs against 17231

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 fc4b7c80
# Pasteboard Subsystem Changelog
OpenHarmony 4.0.3.2 has the following changes in the APIs of the pasteboard subsystem:
## cl.pasteboard.1 convertToTextV9 API Change
Renamed **convertToTextV9** **toPlainText()** and changed the API from asynchronous to synchronous.
**Change Impact**
Applications developed using the **convertToTextV9** API in versions earlier than OpenHarmony 4.0.3.3 cannot be used in OpenHarmony 4.0.3.3 and later versions.
**Key API/Component Changes**
- Involved APIs:
function convertToTextV9
- Before change:
```ts
convertToTextV9(callback: AsyncCallback<string>): void;
convertToTextV9(): Promise<string>;
```
- After change:
```ts
toPlainText(): string;
```
**Adaptation Guide**
Replace **convertToTextV9**, an asynchronous API, with **toPlainText**, a synchronous API.
## cl.pasteboard.2 ShareOption Enum Name Change
Changed the enum names of **ShareOption** from UpperCamelCase to all caps.
**Change Impact**
Applications developed using the **InApp/LocalDevice/CrossDevice** attributes in versions earlier than OpenHarmony 4.0.3.3 cannot be used in OpenHarmony 4.0.3.3 and later versions.
**Key API/Component Changes**
ShareOption<sup>9+</sup>
Before change:
| Name| Value| Description |
| ---- |---|-------------------|
| InApp | 0 | Only intra-application pasting is allowed. |
| LocalDevice | 1 | Paste is allowed in any application on the local device.|
| CrossDevice | 2 | Paste is allowed in any application across devices. |
After change:
| Name| Value| Description |
| ---- |---|-------------------|
| INAPP | 0 | Only intra-application pasting is allowed. |
| LOCALDEVICE | 1 | Paste is allowed in any application on the local device.|
| CROSSDEVICE | 2 | Paste is allowed in any application across devices. |
**Adaptation Guide**
Perform adaptation based on the new semantics.
# Readme
- [Ability framework](changelogs-ability.md)
- [Account subsystem](changelogs-account_os_account.md)
- [Multimedia subsystem - camera](changelogs-camera.md)
- [Device manager](changelogs-device-manager.md)
- [USB manager](changelogs-device-usb.md)
- [Distributed scheduler subsystem](changelogs-dmsfwk.md)
- [DSoftBus subsystem](changelogs-dsoftbus.md)
- [File management subsystem](changelogs-filemanagement.md)
- [Location subsystem](changelogs-geolocation.md)
- [Globalization subsystem](changelogs-global.md)
- [Multimedia subsystem](changelogs-multimedia.md)
- [Multimodal input subsystem](changelogs-multimodalinput.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)
- [User IAM subsystem](changelogs-useriam.md)
- [Ability framework - WantAgent](changelogs-wantAgent.md)
- [Communication subsystem - WiFi](changelogs-wifi.md)
# Readme
- [Account](changelogs-account_os_account.md)
- [DSoftBus](changelogs-dsoftbus.md)
- [File Management](changelogs-filemanagement.md)
- [Test](changelogs-testfwk_arkxtest.md)
- [User IAM](changelogs-useriam.md)
- [Communication-WIFI](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
```
# Device Manager ChangeLog
## cl.device_manager.1 Error Information Return Method Change of APIs
The device manager API uses service logic return values to indicate the error information, which does not comply with the API error code specifications of OpenHarmony. The following changes are made in API version 9 and later:
Asynchronous API: An error message is returned via **AsyncCallback** or the **error** object of **Promise**.
Synchronous API: An error message is returned via an exception.
**Change Impact**
The application developed based on earlier versions needs to adapt the method for returning API error information. Otherwise, the original service logic will be affected.
**Key API/Component Changes**
Error code processing is added for the following APIs:
- createDeviceManager(bundleName: string, callback: AsyncCallback&lt;DeviceManager&gt;): void;
- release(): void;
- getTrustedDeviceListSync(): Array&lt;DeviceInfo&gt;
- getTrustedDeviceList(callback:AsyncCallback&lt;Array&lt;DeviceInfo&gt;&gt;): void;
- getTrustedDeviceList(): Promise&lt;Array&lt;DeviceInfo&gt;&gt;
- getLocalDeviceInfoSync(): DeviceInfo;
- getLocalDeviceInfo(callback:AsyncCallback&lt;DeviceInfo&gt;): void;
- getLocalDeviceInfo(): Promise&lt;DeviceInfo&gt;
- startDeviceDiscovery(subscribeInfo: SubscribeInfo): void;
- startDeviceDiscovery(subscribeInfo: SubscribeInfo, filterOptions?: string): void;
- stopDeviceDiscovery(subscribeId: number): void;
- publishDeviceDiscovery(publishInfo: PublishInfo): void;
- unPublishDeviceDiscovery(publishId: number): void;
- authenticateDevice(deviceInfo: DeviceInfo, authParam: AuthParam, callback: AsyncCallback&lt;{deviceId: string, pinToken ?: number}&gt;): void;
- unAuthenticateDevice(deviceInfo: DeviceInfo): void;
- verifyAuthInfo(authInfo: AuthInfo, callback: AsyncCallback&lt;{deviceId: string, level: number}&gt;): void;
- setUserOperation(operateAction: number, params: string): void;
- on(type: 'uiStateChange', callback: Callback&lt;{ param: string}&gt;): void;
- off(type: 'uiStateChange', callback?: Callback&lt;{ param: string}&gt;): void;
- on(type: 'deviceStateChange', callback: Callback&lt;{ action: DeviceStateChangeAction, device: DeviceInfo }&gt;): void;
- off(type: 'deviceStateChange', callback?: Callback&lt;{ action: DeviceStateChangeAction, device: DeviceInfo }&gt;): void;
- on(type: 'deviceFound', callback: Callback&lt;{ subscribeId: number, device: DeviceInfo }&gt;): void;
- off(type: 'deviceFound', callback?: Callback&lt;{ subscribeId: number, device: DeviceInfo }&gt;): void;
- on(type: 'discoverFail', callback: Callback&lt;{ subscribeId: number, reason: number }&gt;): void;
- off(type: 'discoverFail', callback?: Callback&lt;{ subscribeId: number, reason: number }&gt;): void;
- on(type: 'publishSuccess', callback: Callback&lt;{ publishId: number }&gt;): void;
- off(type: 'publishSuccess', callback?: Callback&lt;{ publishId: number }&gt;): void;
- on(type: 'publishFail', callback: Callback&lt;{ publishId: number, reason: number }&gt;): void;
- off(type: 'publishFail', callback?: Callback&lt;{ publishId: number, reason: number }&gt;): void;
- on(type: 'serviceDie', callback: () =&gt; void): void;
- off(type: 'serviceDie', callback?: () =&gt; void): void;
**Adaptation Guide**
The following uses **getTrustedDeviceList** as an example for asynchronous APIs:
```ts
import account_osAccount from "@ohos.distributedHardware.deviceManager"
dmInstance.getTrustedDeviceList((err, data) => {
console.log("getTrustedDeviceList err: " + JSON.stringify(err));
console.log('get trusted device info: ' + JSON.stringify(data));
});
try {
dmInstance.getTrustedDeviceList((err, data) => {
if (err) {
console.error("getTrustedDeviceList errCode:" + err.code + ",errMessage:" + err.message);
return;
}
console.log('get trusted device info: ' + JSON.stringify(data));
});
} catch (err) {
console.error("getTrustedDeviceList errCode:" + err.code + ",errMessage:" + err.message);
}
```
The following uses **startDeviceDiscovery** as an example for synchronous APIs:
```ts
// Automatically generate a unique subscription ID.
var subscribeId = Math.floor(Math.random() * 10000 + 1000);
var subscribeInfo = {
"subscribeId": subscribeId,
"mode": 0xAA, // Active discovery
"medium": 0, // Automatic. Multiple media can be used for device discovery.
"freq": 2, // High frequency
"isSameAccount": false,
"isWakeRemote": false,
"capability": 1
};
dmInstance.startDeviceDiscovery(subscribeInfo); // The deviceFound callback is called to notify the application when a device is discovered.
// Automatically generate a unique subscription ID.
var subscribeId = Math.floor(Math.random() * 10000 + 1000);
var subscribeInfo = {
"subscribeId": subscribeId,
"mode": 0xAA, // Active discovery
"medium": 0, // Automatic. Multiple media can be used for device discovery.
"freq": 2, // High frequency
"isSameAccount": false,
"isWakeRemote": false,
"capability": 1
};
try {
dmInstance.startDeviceDiscovery(subscribeInfo); // The deviceFound callback is called to notify the application when a device is discovered.
} catch (err) {
console.error("startDeviceDiscovery errCode:" + err.code + ",errMessage:" + err.message);
}
```
# Distributed Scheduler Subsystem Changelog
## cl.DistributedManagerService.1 continuationManager on()/off() Changes
- The event types passed to the **continuationManager.on** and **continuationManager.off** APIs do not comply with the OpenHarmony API specifications.
- The return value of **continuationManager.on** varies with the event type, which does not comply with the OpenHarmony API specifications.
The following changes have been made:
- Changed the event type **deviceConnect** to **deviceSelected** and **deviceDisconnect** to **deviceUnselected** in the **continuationManager.on** and **continuationManager.off** APIs.
- Changed the return value of **continuationManager.on** to **Callback&lt;Array&lt;ContinuationResult&gt;&gt;** for all events.
**Change Impact**
The application developed based on earlier versions needs to be adapted. Otherwise, the service logic will be affected.
**Key API/Component Changes**
- Involved APIs:
continuationManager.on;
continuationManager.off;
- Before change:
```js
function on(type: "deviceConnect", token: number, callback: Callback<Array<ContinuationResult>>): void;
function off(type: "deviceConnect", token: number): void;
function on(type: "deviceDisconnect", token: number, callback: Callback<Array<string>>): void;
function off(type: "deviceDisconnect", token: number): void;
```
- After change:
```js
function on(type: "deviceSelected", token: number, callback: Callback<Array<ContinuationResult>>): void;
function off(type: "deviceSelected", token: number): void;
function on(type: "deviceUnselected", token: number, callback: Callback<Array<ContinuationResult>>): void;
function off(type: "deviceUnselected", token: number): void;
```
**Adaptation Guide**
Change the event names. The code snippet is as follows:
Event of device selection in **continuationManager.on**:
```ts
let token = 1;
try {
continuationManager.on("deviceSelected", token, (data) => {
console.info('onDeviceSelected len: ' + data.length);
for (let i = 0; i < data.length; i++) {
console.info('onDeviceSelected deviceId: ' + JSON.stringify(data[i].id));
console.info('onDeviceSelected deviceType: ' + JSON.stringify(data[i].type));
console.info('onDeviceSelected deviceName: ' + JSON.stringify(data[i].name));
}
});
} catch (err) {
console.error('on failed, cause: ' + JSON.stringify(err));
}
```
Event of device selection in **continuationManager.off**:
```ts
let token = 1;
try {
continuationManager.off("deviceSelected", token);
} catch (err) {
console.error('off failed, cause: ' + JSON.stringify(err));
}
```
Event of device deselection in **continuationManager.on**:
```ts
let token = 1;
try {
continuationManager.on("deviceUnselected", token, (data) => {
console.info('onDeviceUnselected len: ' + data.length);
for (let i = 0; i < data.length; i++) {
console.info('onDeviceUnselected deviceId: ' + JSON.stringify(data[i].id));
console.info('onDeviceUnselected deviceType: ' + JSON.stringify(data[i].type));
console.info('onDeviceUnselected deviceName: ' + JSON.stringify(data[i].name));
}
console.info('onDeviceUnselected finished.');
});
} catch (err) {
console.error('on failed, cause: ' + JSON.stringify(err));
}
```
Event of device deselection in **continuationManager.off**:
```ts
let token = 1;
try {
continuationManager.off("deviceUnselected", token);
} catch (err) {
console.error('off failed, cause: ' + JSON.stringify(err));
}
```
## cl.DistributedManagerService.2 Adding DATASYNC Permission Verification to continuationManager APIs
In earlier versions, the **continuationManager** APIs do not verify the caller, which does not comply with the OpenHarmony API specifications.
Now, before using a **continuationManager** API, the caller must apply for the **ohos.permission.DISTRIBUTED_DATASYNC** permission.
**Change Impact**
The application developed based on earlier versions needs to apply for the **ohos.permission.DISTRIBUTED_DATASYNC** permission in advance. Otherwise, the service logic will be affected.
**Key API/Component Changes**
Involved APIs:
- continuationManager.registerContinuation;
- continuationManager.on;
- continuationManager.off;
- continuationManager.unregisterContinuation;
- continuationManager.updateContinuationState;
- continuationManager.startContinuationDeviceManager;
# 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
# Upload and Download Subsystem Changelog
# Upload and Download Changelog
## cl.request.1 Changes of Error Code Definitions and API Names
......
# 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));
}
```
# Wi-Fi Subsystem Changelog
# Communication Subsystem - WiFi Changelog
## cl.wifi.1 Moving System APIs and APIs of Version 9 to @ohos.wifiManager.d.ts
......
# Readme
- [Ability framework](changelogs-ability.md)
- [Account subsystem](changelogs-account_os_account.md)
- [Multimedia subsystem - camera](changelogs-camera-sync.md)
- [Common library subsystem - container](changelogs-container.md)
- [Distributed data management subsystem](changelogs-distributeddatamgr.md)
- [File management subsystem](changelogs-filemanagement.md)
- [File management subsystem - MediaLibrary](changelogs-mediaLibrary.md)
- [Multimedia subsystem](changelogs-multimedia.md)
- [Communication subsystem - NFC](changelogs-nfc.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)
- [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)
- [Communication-NFC](changelogs-nfc.md)
- [Security](changelogs-security.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|
# Upload and Download Subsystem Changelog
# Upload and Download Changelog
## cl.request.2 Upload and Download API Change
......
# 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));
};
}
};
```
# Readme
- [Ability framework](changelogs-ability.md)
- [Bundle manager subsystem](changelogs-bundlemanager.md)
- [Resource scheduler subsystem](changelogs-resourceschedule.md)
- [Telephony subsystem](changelogs-telephony.md)
- [Util subsystem](changelogs-util.md)
# Ability Framework Changelog
## cl.ability.1 AreaMode APIs Changed
Duplicate **AreaMode** APIs are deleted.
**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|
| ------------------------- | ------------------- | ------------------------------------------------------------ | -------- |
| @ohos.app.ability.common.d.ts | common.AreaMode | | Deleted |
| application/Context.d.ts | AreaMode | | Deleted |
**Adaptation Guide**
Use **AreaMode** in **@ohos.app.ability.contextConstant.d.ts**.
```ts
import contextConstant from '@ohos.app.ability.contextConstant';
let area: contextConstant.AreaMode = contextConstant.AreaMode.EL1;
```
## cl.ability.2 killProcessesBySelf Renamed
The **killProcessesBySelf** API is renamed **killAllProcesses**.
**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/ApplicationContext | ApplicationContext | killProcessesBySelf(): Promise\<void\>; | Deleted |
| application/ApplicationContext | ApplicationContext | killProcessesBySelf(callback: AsyncCallback\<void\>); | Deleted |
| application/ApplicationContext | ApplicationContext | killAllProcesses(): Promise\<void\>; | Added |
| application/ApplicationContext | ApplicationContext | killAllProcesses(callback: AsyncCallback\<void\>); | Added |
**Adaptation Guide**
The following code snippet shows how to call **killProcessesBySelf** in an application.
Code before the change:
```ts
let context: common.UIAbilityContext = globalThis.abilityContext;
let appContext = context.getApplicationContext();
appContext.killProcessesBySelf()
```
Code after the change:
```ts
let context: common.UIAbilityContext = globalThis.abilityContext;
let appContext = context.getApplicationContext();
appContext.killAllProcesses()
```
## cl.ability.3 getProcessRunningInformation Renamed
The **getProcessRunningInformation** API is renamed **getRunningProcessInformation**.
**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|
| ----------------------------------- | ------------------ | ------------------------------------------------------------ | -------- |
| @ohos.app.ability.appManager.d.ts | appManager | function getProcessRunningInformation(): Promise\<Array\<ProcessRunningInformation\>\>; | Deleted |
| @ohos.app.ability.appManager.d.ts | appManager | function getProcessRunningInformation(callback: AsyncCallback\<Array\<ProcessRunningInformation\>\>): void; | Deleted |
| @ohos.app.ability.appManager.d.ts | appManager | function getRunningProcessInformation(): Promise\<Array\<ProcessInformation\>\>; | Added |
| @ohos.app.ability.appManager.d.ts | appManager | function getRunningProcessInformation(callback: AsyncCallback\<Array\<ProcessInformation\>\>): void; | Added |
| application/ApplicationContext.d.ts | ApplicationContext | getProcessRunningInformation(): Promise\<Array\<ProcessRunningInformation\>\>; | Deleted |
| application/ApplicationContext.d.ts | ApplicationContext | getProcessRunningInformation(callback: AsyncCallback\<Array\<ProcessRunningInformation\>\>): void; | Deleted |
| application/ApplicationContext.d.ts | ApplicationContext | getRunningProcessInformation(): Promise\<Array\<ProcessInformation\>\>; | Added |
| application/ApplicationContext.d.ts | ApplicationContext | getRunningProcessInformation(callback: AsyncCallback\<Array\<ProcessInformation\>\>): void; | Added |
**Adaptation Guide**
The following code snippet shows how to call **getProcessRunningInformation** in an application.
Code before the change:
```ts
let context: common.UIAbilityContext = globalThis.abilityContext;
let appContext = context.getApplicationContext();
appContext.getProcessRunningInformation()
```
Code after the change:
```ts
let context: common.UIAbilityContext = globalThis.abilityContext;
let appContext = context.getApplicationContext();
appContext.getRunningProcessInformation()
```
## cl.ability.4 WantConstant.Flags API Changed
**WantConstant.Flags** has multiple invalid flag definitions. These invalid flags are deleted.
**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|
| ------------------------- | ------------------- | ------------------------------------------------------------ | -------- |
| @ohos.app.ability.wantConstant.d.ts | wantConstant.Flags | FLAG_ABILITY_FORWARD_RESULT | Deleted |
| @ohos.app.ability.wantConstant.d.ts | wantConstant.Flags | FLAG_ABILITY_CONTINUATION | Deleted |
| @ohos.app.ability.wantConstant.d.ts | wantConstant.Flags | FLAG_NOT_OHOS_COMPONENT | Deleted |
| @ohos.app.ability.wantConstant.d.ts | wantConstant.Flags | FLAG_ABILITY_FORM_ENABLED | Deleted |
| @ohos.app.ability.wantConstant.d.ts | wantConstant.Flags | FLAG_AUTH_PERSISTABLE_URI_PERMISSION | Deleted |
| @ohos.app.ability.wantConstant.d.ts | wantConstant.Flags | FLAG_AUTH_PREFIX_URI_PERMISSION | Deleted |
| @ohos.app.ability.wantConstant.d.ts | wantConstant.Flags | FLAG_ABILITYSLICE_MULTI_DEVICE | Deleted |
| @ohos.app.ability.wantConstant.d.ts | wantConstant.Flags | FLAG_START_FOREGROUND_ABILITY | Deleted |
| @ohos.app.ability.wantConstant.d.ts | wantConstant.Flags | FLAG_ABILITY_CONTINUATION_REVERSIBLE | Deleted |
| @ohos.app.ability.wantConstant.d.ts | wantConstant.Flags | FLAG_INSTALL_WITH_BACKGROUND_MODE | Deleted |
| @ohos.app.ability.wantConstant.d.ts | wantConstant.Flags | FLAG_ABILITY_CLEAR_MISSION | Deleted |
| @ohos.app.ability.wantConstant.d.ts | wantConstant.Flags | FLAG_ABILITY_NEW_MISSION | Deleted |
| @ohos.app.ability.wantConstant.d.ts | wantConstant.Flags | FLAG_ABILITY_MISSION_TOP | Deleted |
## cl.ability.5 WantConstant.Action API Changed
**WantConstant.Action** has multiple invalid action definitions. These invalid actions are deleted.
**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|
| ------------------------- | ------------------- | ------------------------------------------------------------ | -------- |
| @ohos.app.ability.wantConstant.d.ts | wantConstant.Action | ACTION_APP_ACCOUNT_AUTH | Deleted |
| @ohos.app.ability.wantConstant.d.ts | wantConstant.Action | ACTION_MARKET_DOWNLOAD | Deleted |
| @ohos.app.ability.wantConstant.d.ts | wantConstant.Action | ACTION_MARKET_CROWDTEST | Deleted |
| @ohos.app.ability.wantConstant.d.ts | wantConstant.Action | DLP_PARAMS_SANDBOX | Deleted |
| @ohos.app.ability.wantConstant.d.ts | wantConstant.Action | DLP_PARAMS_BUNDLE_NAME | Deleted |
| @ohos.app.ability.wantConstant.d.ts | wantConstant.Action | DLP_PARAMS_MODULE_NAME | Deleted |
| @ohos.app.ability.wantConstant.d.ts | wantConstant.Action | DLP_PARAMS_ABILITY_NAME | Deleted |
## cl.ability.6 Caller APIs Changed
Caller APIs use the **Parcelable** and **MessageSequence** objects provided by RPC in API version 9 to replace the deprecated **Sequenceable** and **MessageParcel** object.
**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|
| ------------------------- | ------------------- | ------------------------------------------------------------ | -------- |
| api/@ohos.app.ability.UIAbility.d.ts | CalleeCallback | (indata: rpc.MessageParcel): rpc.Sequenceable; | Changed to **(indata: rpc.MessageSequence): rpc.Parcelable;**. |
| api/@ohos.app.ability.UIAbility.d.ts | Caller | call(method: string, data: rpc.Sequenceable): Promise<void>; | Changed to **call(method: string, data: rpc.Parcelable): Promise<void>;**. |
| api/@ohos.app.ability.UIAbility.d.ts | Caller | callWithResult(method: string, data: rpc.Sequenceable): Promise<rpc.MessageParcel>; | Changed to **callWithResult(method: string, data: rpc.Parcelable): Promise<rpc.MessageSequence>;**. |
**Adaptation Guide**
The following illustrates how to call the caller APIs in your application.
Code before the change:
```ts
class MyMessageAble{
name:""
str:""
num: 1
constructor(name, str) {
this.name = name;
this.str = str;
}
marshalling(messageParcel) {
messageParcel.writeInt(this.num);
messageParcel.writeString(this.str);
console.log('MyMessageAble marshalling num[' + this.num + '] str[' + this.str + ']');
return true;
}
unmarshalling(messageParcel) {
this.num = messageParcel.readInt();
this.str = messageParcel.readString();
console.log('MyMessageAble unmarshalling num[' + this.num + '] str[' + this.str + ']');
return true;
}
};
let method = 'call_Function';
function funcCallBack(pdata) {
console.log('Callee funcCallBack is called ' + pdata);
let msg = new MyMessageAble("test", "");
pdata.readSequenceable(msg);
return new MyMessageAble("test1", "Callee test");
}
export default class MainUIAbility extends UIAbility {
onCreate(want, launchParam) {
console.log('Callee onCreate is called');
try {
this.callee.on(method, funcCallBack);
} catch (error) {
console.log('Callee.on catch error, error.code: ' + error.code +
' error.message: ' + error.message);
}
}
}
```
Code after the change:
```ts
class MyMessageAble{
name:""
str:""
num: 1
constructor(name, str) {
this.name = name;
this.str = str;
}
marshalling(messageSequence) {
messageSequence.writeInt(this.num);
messageSequence.writeString(this.str);
console.log('MyMessageAble marshalling num[' + this.num + '] str[' + this.str + ']');
return true;
}
unmarshalling(messageSequence) {
this.num = messageSequence.readInt();
this.str = messageSequence.readString();
console.log('MyMessageAble unmarshalling num[' + this.num + '] str[' + this.str + ']');
return true;
}
};
let method = 'call_Function';
function funcCallBack(pdata) {
console.log('Callee funcCallBack is called ' + pdata);
let msg = new MyMessageAble("test", "");
pdata.readParcelable(msg);
return new MyMessageAble("test1", "Callee test");
}
export default class MainUIAbility extends UIAbility {
onCreate(want, launchParam) {
console.log('Callee onCreate is called');
try {
this.callee.on(method, funcCallBack);
} catch (error) {
console.log('Callee.on catch error, error.code: ' + error.code +
' error.message: ' + error.message);
}
}
}
```
## cl.ability.7 WantConstant.Flags API Changed
The **wantConstant** API had two similar enums. Now the two enums are combined into one.
**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|
| ----------------------------------- | ---------------------- | ----------------------------------- | -------- |
| @ohos.app.ability.wantConstant.d.ts | wantConstant.Parameter | ABILITY_BACK_TO_OTHER_MISSION_STACK | Deleted |
| @ohos.app.ability.wantConstant.d.ts | wantConstant.Params | ABILITY_BACK_TO_OTHER_MISSION_STACK | Added |
**Adaptation Guide**
Use **ABILITY_BACK_TO_OTHER_MISSION_STACK** in **@ohos.app.ability.wantConstant.d.ts**.
```ts
import wantConstant from '@ohos.app.ability.wantConstant';
let backToOtherMissionStack: wantConstant.Params = wantParam.Params.ABILITY_BACK_TO_OTHER_MISSION_STACK;
```
# Bundle Manager Subsystem Changelog
## cl.bundlemanager.1 Deleted getAbilityIcon
The **getAbilityIcon** API in [@ohos.bundle.bundleManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.bundleManager.d.ts) is deleted. The **getMediaContent** API in [@ohos.resourceManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.resourceManager.d.ts) can be used instead.
**Change Impact**<br>
The **getAbilityIcon** API does not take effect.
**Key API/Component Changes**<br>
The **getAbilityIcon** API is deleted from **@ohos.bundle.bundleManager.d.ts**.
**Adaptation Guide**<br>
If your application uses **getAbilityIcon** in **@ohos.bundle.bundleManager.d.ts**, replace it with **getMediaContent** in **@ohos.resourceManager.d.ts**. You need to obtain the icon ID in advance. For details, see [Usage Guide](../../../application-dev/reference/apis/js-apis-resource-manager.md#getmediacontent9).
## cl.bundlemanager.2 Bottom-Layer Capability Changed So That Only the System Resource HAP Supports Custom Permissions
Only the system resource HAP supports custom permissions. During HAP parsing, the bundle manager module parses the **definePermissions** field only in the configuration file of the resource HAP (bundle name: **ohos.global.systemres**), but not this field in other HAPs. This field is used to define permissions.
If an application requires custom permissions, add the permissions under the **definePermissions** field in the [configuration file](https://gitee.com/openharmony/utils_system_resources/blob/master/systemres/main/config.json) of the system resource HAP. For details about the permission format, see [Defining Permissions](../../../application-dev/quick-start/module-structure.md#internal-structure-of-the-definepermissions-attribute).
**Change Impact**<br>
After an upgrade to the new version image, the custom permission of the application does not take effect, and the authorization fails.
**Key API/Component Changes**<br>
The bottom-layer capability of the bundle manager module is changed. Only the system resource HAP supports custom permissions.
**Adaptation Guide**<br>
If an application requires custom permissions, add the permissions under the **definePermissions** field in the [configuration file](https://gitee.com/openharmony/utils_system_resources/blob/master/systemres/main/config.json) of the system resource HAP. For details about the permission format, see [Defining Permissions](../../../application-dev/quick-start/module-structure.md#internal-structure-of-the-definepermissions-attribute).
## cl.bundlemanager.3 Level-2 Module File Names Changed
The level-2 module file names of the bundle manager module are changed to their respective API names in the file, as listed below.
| Original File Name|New File Name|
|----|----|
| bundleManager/abilityInfo.d.ts | bundleManager/AbilityInfo.d.ts |
| bundleManager/applicationInfo.d.ts | bundleManager/ApplicationInfo.d.ts |
| bundleManager/bundleInfo.d.ts | bundleManager/BundleInfo.d.ts |
| bundleManager/dispatchInfo.d.ts | bundleManager/DispatchInfo.d.ts |
| bundleManager/elementName.d.ts | bundleManager/ElementName.d.ts |
| bundleManager/extensionAbilityInfo.d.ts | bundleManager/ExtensionAbilityInfo.d.ts |
| bundleManager/hapModuleInfo.d.ts | bundleManager/HapModuleInfo.d.ts |
| bundleManager/launcherAbilityInfo.d.ts | bundleManager/LauncherAbilityInfo.d.ts |
| bundleManager/metadata.d.ts | bundleManager/Metadata.d.ts |
| bundleManager/packInfo.d.ts | bundleManager/BundlePackInfo.d.ts |
| bundleManager/permissionDef.d.ts | bundleManager/PermissionDef.d.ts |
| bundleManager/remoteAbilityInfo.d.ts | bundleManager/RemoteAbilityInfo.d.ts |
| bundleManager/shortcutInfo.d.ts | bundleManager/ShortcutInfo.d.ts |
To sum up, except **packInfo**, which is changed to **BundlePackInfo**, the other file names are changed to start with uppercase letters.
**Change Impact**<br>
The change of the level-2 module file names does not affect the use of the level-1 module. If a level-2 module interface under **bundleManager** is directly imported to the .ts file and an error is reported during compilation on DevEco Studio, you must change the name of the imported file.
**Key API/Component Changes**<br>
The .d.ts file names in the **bundleManager** folder are changed to their respective API names in the file.
**Adaptation Guide**<br>
Generally, no adaptation is required. If a file in the **bundleManager** folder is directly imported to the application, you must change the imported file name as follows:
**Before change:**
```ts
import {AbilityInfo} from 'bundleManger/abilityInfo';
import {ExtensionAbilityInfo} from 'bundleManger/extensionAbilityInfo';
import {BundlePackInfo} from 'bundleManger/packInfo';
```
**After change:**
```ts
import {AbilityInfo} from 'bundleManger/AbilityInfo';
import {ExtensionAbilityInfo} from 'bundleManger/ExtensionAbilityInfo';
import {BundlePackInfo} from 'bundleManger/BundlePackInfo';
```
## cl.bundlemanager.4 LaunchType Enum Type Name Changed from STANDARD to MULTITON
The enum type name of [LaunchType](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.bundleManager.d.ts) is changed from **STANDARD** to **MULTITON**. The enum value remains unchanged, indicating the multi-instance type.
**Change Impact**<br>
The **LaunchType.STANDARD** type does not take effect.
**Key API/Component Changes**<br>
The enum type name of **LaunchType** is changed from **STANDARD** to **MULTITON**.
**Adaptation Guide**<br>
Change **LaunchType.STANDARD** to **LaunchType.MULTITON** for your application.
## cl.bundlemanager.5 Changed the isVisible Field in the AbilityInfo Struct to exported
The **isVisible** field in the [AbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/AbilityInfo.d.ts) struct is changed to **exported**. The type remains unchanged, indicating whether the ability can be exported and used by other abilities.
**Change Impact**<br>
The **isVisible** field does not take effect.
**Key API/Component Changes**<br>
The **isVisible** field in the [AbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/AbilityInfo.d.ts) struct is changed to **exported**, and the type remains unchanged.
**Adaptation Guide**<br>
Change **isVisible** to **exported** for your application.
## cl.bundlemanager.6 Changed the isVisible Field in the ExtensionAbilityInfo Struct to exported
The **isVisible** field in the [ExtensionAbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ExtensionAbilityInfo.d.ts) struct is changed to **exported**. The type remains unchanged, indicating whether the ability can be exported and used by other abilities.
**Change Impact**<br>
The **isVisible** field does not take effect.
**Key API/Component Changes**<br>
The **isVisible** field in the [ExtensionAbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ExtensionAbilityInfo.d.ts) struct is changed to **exported**, and the type remains unchanged.
**Adaptation Guide**<br>
Change **isVisible** to **exported** for your application.
## cl.bundlemanager.7 Changed the visible Field in the ModuleAbilityInfo Struct to exported
The **visible** field in the [ModuleAbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/BundlePackInfo.d.ts) struct is changed to **exported**. The type remains unchanged, indicating whether the ability can be exported and used by other abilities.
**Change Impact**<br>
The **visible** field does not take effect.
**Key API/Component Changes**<br>
The **visible** field in the [ModuleAbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/BundlePackInfo.d.ts) struct is changed to **exported**, and the type remains unchanged.
**Adaptation Guide**<br>
Change **visible** to **exported** for your application.
## cl.bundlemanager.8 Deleted the distributedNotificationEnabled Tag from the app.json Configuration File
The [distributedNotificationEnabled](../../../application-dev/quick-start/app-configuration-file.md) tag is deleted from the **app.json** configuration file.
**Change Impact**<br>
If this tag is used, an error is reported during compilation on DevEco Studio.
**Adaptation Guide**<br>
Delete this tag from the configuration file.
## cl.bundlemanager.9 Deleted the entityType Tag from the app.json Configuration File
The [entityType](../../../application-dev/quick-start/app-configuration-file.md) tag is deleted from the **app.json** configuration file.
**Change Impact**<br>
If this tag is used, an error is reported during compilation on DevEco Studio.
**Adaptation Guide**<br>
Delete this tag from the configuration file.
## cl.bundlemanager.10 Deleted the keepAlive Tag from the app.json Configuration File
The [keepAlive](../../../application-dev/quick-start/app-configuration-file.md) tag is deleted from the **app.json** configuration file.
**Change Impact**<br>
If this tag is used, an error is reported during compilation on DevEco Studio.
**Adaptation Guide**<br>
Delete this tag from the configuration file.
## cl.bundlemanager.11 Deleted the removable Tag from the app.json Configuration File
The [removable](../../../application-dev/quick-start/app-configuration-file.md) tag is deleted from the **app.json** configuration file.
**Change Impact**<br>
If this tag is used, an error is reported during compilation on DevEco Studio.
**Adaptation Guide**<br>
Delete this tag from the configuration file.
## cl.bundlemanager.12 Deleted the singleton Tag from the app.json Configuration File
The [singleton](../../../application-dev/quick-start/app-configuration-file.md) tag is deleted from the **app.json** configuration file.
**Change Impact**<br>
If this tag is used, an error is reported during compilation on DevEco Studio.
**Adaptation Guide**<br>
Delete this tag from the configuration file.
## cl.bundlemanager.13 Deleted the userDataClearable Tag from the app.json Configuration File
The [userDataClearable](../../../application-dev/quick-start/app-configuration-file.md) tag is deleted from the **app.json** configuration file.
**Change Impact**<br>
If this tag is used, an error is reported during compilation on DevEco Studio.
**Adaptation Guide**<br>
Delete this tag from the configuration file.
## cl.bundlemanager.14 No Longer Chinese Characters for the name Tag under module in the module.json Configuration File
The value of [name](../../../application-dev/quick-start/module-configuration-file.md) under **module** in the **module.json** configuration file does not support Chinese characters.
**Change Impact**<br>
If the tag is set to Chinese, an error is reported during compilation on DevEco Studio.
**Adaptation Guide**<br>
Set this tag to English.
## cl.bundlemanager.15 No Longer Chinese Characters for the name Tag under ability in the module.json Configuration File
The value of [name](../../../application-dev/quick-start/module-configuration-file.md) under **ability** in the **module.json** configuration file does not support Chinese characters.
**Change Impact**<br>
If the tag is set to Chinese, an error is reported during compilation on DevEco Studio.
**Adaptation Guide**<br>
Set this tag to English.
## cl.bundlemanager.16 Deleted the uiSyntax Tag from the module.json Configuration File
The [uiSyntax](../../../application-dev/quick-start/module-configuration-file.md) tag is deleted from the **module.json** configuration file.
**Change Impact**<br>
If this tag is used, an error is reported during compilation on DevEco Studio.
**Adaptation Guide**<br>
Delete this tag from the configuration file.
## cl.bundlemanager.17 Changed srcEntrance to srcEntry in the module.json Configuration File
The [srcEntrance](../../../application-dev/quick-start/module-configuration-file.md) tag under **module** and **ability** in the **module.json** configuration file is changed to **srcEntry**.
**Change Impact**<br>
If the **srcEntrance** tag is used, an error is reported during compilation on DevEco Studio.
**Adaptation Guide**<br>
Replace the **srcEntrance** tag with **srcEntry** in the configuration file.
## cl.bundlemanager.18 Deleted the apiVersion Tag Under distroFilter from the module.json Configuration File
The **apiVersion** tag under [distroFilter](../../../application-dev/quick-start/module-configuration-file.md) is deleted from the **module.json** configuration file.
**Change Impact**<br>
If this tag is used, an error is reported during compilation on DevEco Studio.
**Adaptation Guide**<br>
Delete this tag from the configuration file.
## cl.bundlemanager.19 Changed distroFilter to distributionFilter in the module.json Configuration File
The [distroFilter](../../../application-dev/quick-start/module-configuration-file.md) tag in the **module.json** configuration file is changed to **distributionFilter**.
**Change Impact**<br>
If the **distroFilter** tag is used, an error is reported during compilation on DevEco Studio.
**Adaptation Guide**<br>
Replace **distroFilter** with **distributionFilter** in the configuration file.
## cl.bundlemanager.20 Changed standard of launchType to multiton in the module.json Configuration File
The **standard** mode of the [launchType](../../../application-dev/quick-start/module-configuration-file.md) tag in the **module.json** file is changed to **multiton**.
**Adaptation Guide**<br>
Replace **standard** of **launchType** to **multiton** in the configuration file.
## cl.bundlemanager.21 Deleted the atomicService Tag from the app.json File
The **atomicService** tag is deleted from the **app.json** file.
**Change Impact**<br>
If this tag is used, an error is reported during compilation on DevEco Studio.
**Adaptation Guide**<br>
Delete the **atomicService** tag from your code.
## cl.bundlemanager.22 Added the bundleType Tag to the app.json File
The **bundleType** tag is added to the **app.json** file.
**Change Impact**<br>
For an existing ability with [installationFree](../../../application-dev/quick-start/module-configuration-file.md) set to **true**, **bundleType** must be set to **atomicService** in the **app.json** file. Otherwise, the packaging fails.
**Adaptation Guide**<br>
Add the [bundleType](../../../application-dev/quick-start/app-configuration-file.md) tag. This tag can be left blank. The default value is **app**. The setting of this tag and the [installationFree](../../../application-dev/quick-start/module-configuration-file.md) field in the **module.json** file must meet the following rules:
- If **bundleType** is **app**, **installationFree** must be set to **false**.
- If **bundleType** is **atomicService**, **installationFree** must be set to **true**.
## cl.bundlemanager.23 Deleted the split Field from the ApplicationInfo Struct
The **split** field is deleted from the [ApplicationInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ApplicationInfo.d.ts) struct.
**Change Impact**<br>
If the **split** field is used in your code, the compilation fails.
**Key API/Component Changes**<br>
The **split** field is deleted from the [ApplicationInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ApplicationInfo.d.ts) struct.
**Adaptation Guide**<br>
Delete the **split** field from the **ApplicationInfo** struct of your code. The stage model always forcibly splits bundles.
## cl.bundlemanager.24 Deleted the atomicServiceModuleType Field from the HapModuleInfo Struct
The **atomicServiceModuleType** field is deleted from the [HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) struct.
**Change Impact**<br>
If the **atomicServiceModuleType** field is used in your code, the compilation fails.
**Key API/Component Changes**<br>
The **atomicServiceModuleType** field is deleted from the [HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) struct.
**Adaptation Guide**<br>
Record the setting of the **atomicServiceModuleType** field, delete it from the [HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) struct, and set the **moduleType** field in the [HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) struct to the recorded value.
## cl.bundlemanager.25 Deleted the AtomicServiceModuleType Enumerated Value
The **atomicServiceModuleType** field is deleted from the [HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) struct.
**Change Impact**<br>
If the **atomicServiceModuleType** field is used in your code, the compilation fails.
**Key API/Component Changes**<br>
The **atomicServiceModuleType** field is deleted from the [HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) struct.
**Adaptation Guide**<br>
Record the setting of the **atomicServiceModuleType** field, delete it from the [HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) struct, and set the **moduleType** field in the [HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) struct to the recorded value.
# Resource Scheduler Subsystem Changelog
## cl.resourceschedule.workScheduler
The data type of the **parameters** attribute value is changed. Specifically, the number, string, and boolean types are supported, but the any type is not.
**Change Impact**
For applications developed based on OpenHarmony3.2.10.7 and later SDK versions, the **parameters** attribute value can use the number, string, and boolean types only. If it uses the any type, a compilation error is reported.
**Key API/Component Changes**
The **parameters** attribute in @ohos.resourceschedule.workScheduler.d.ts is changed.
| Class| API Type| Statement Before the Change| Statement After the Change|
| -- | -- | -- | -- |
| workScheduler.WorkInfo | field | parameters?: {[key: string]: any} | parameters?: {[key: string]: number | string | boolean} |
**Adaptation Guide**
The **parameters** attribute uses the {[key: string]: number | string | boolean} data type.
# Util Subsystem Changelog
Compared with OpenHarmony 3.2 Beta4, OpenHarmony 3.2.10.7(MR) has the following API changes in the util subsystem.
## cl.util.1. randomUUID Name Changed
The **randomUUID** function name is changed to **generateRandomUUID**.
Before change: function randomUUID(entropyCache?: boolean): string <br>After change: function generateRandomUUID(entropyCache?: boolean): string
You need to adapt your application.
**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 | Method/Attribute/Enum/Constant | Change Type|
| :---------- | ------------------- | ------- |
| @ohos.util | function randomUUID(entropyCache?: boolean): string | Deleted |
| @ohos.util | function generateRandomUUID(entropyCache?: boolean): string| Added |
**Adaptation Guide**
Refer to the code snippet below to call **generateRandomUUID** in your application.
Example:
```ts
import util from '@ohos.util'
let uuid = util.generateRandomUUID(true);
console.log("RFC 4122 Version 4 UUID:" + uuid);
// Output:
// RFC 4122 Version 4 UUID:88368f2a-d5db-47d8-a05f-534fab0a0045
```
## cl.util.2 randomBinaryUUID Name Changed
The **randomBinaryUUID** function name is changed to **generateRandomBinaryUUID**.
Before change: function randomBinaryUUID(entropyCache?: boolean): Uint8Array<br>After change: function generateRandomBinaryUUID(entropyCache?: boolean): Uint8Array
You need to adapt your application.
**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 | Method/Attribute/Enum/Constant | Change Type|
| :---------- | ------------------- | ------- |
| @ohos.util | function randomBinaryUUID(entropyCache?: boolean): Uint8Array; | Deleted |
| @ohos.util | function generateRandomBinaryUUID(entropyCache?: boolean): Uint8Array| Added |
**Adaptation Guide**
Refer to the code snippet below to call **generateRandomBinaryUUID** in your application.
Example:
```ts
import util from '@ohos.util'
let uuid = util.generateRandomBinaryUUID(true);
console.log(JSON.stringify(uuid));
// Output:
// 138,188,43,243,62,254,70,119,130,20,235,222,199,164,140,150
```
## cl.util.3. contains Parameter Type in the LRUCache Class Changed
The **contains** parameter type in the LRUCache class is changed from **object** to **K**.
Before change: contains(key: object): boolean <br>After change: contains(key: K): boolean
You need to adapt your application.
**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|
| :-------- | ---------| -------------------------------- | -------- |
| @ohos.util | LRUCache | contains(key: object): boolean | Deleted |
| @ohos.util | LRUCache | contains(key: K): boolean | Added |
**Adaptation Guide**
Follow the code snippet to use the **contains** function in your application.
Example:
```ts
import util from '@ohos.util'
let pro = new util.LRUCache();
pro.put(2,10);
let obj = {1:"key"};
let result = pro.contains(obj);
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册