diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.6/changelogs-mediaLibrary.md b/en/release-notes/changelogs/OpenHarmony_3.2.10.6/changelogs-mediaLibrary.md new file mode 100644 index 0000000000000000000000000000000000000000..fbb2d0d39e2bb292b2d75164ea30b6b6e1a6c00b --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.10.6/changelogs-mediaLibrary.md @@ -0,0 +1,116 @@ +# File 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\): void | Deprecated | +| medialibrary | **function** getFileAssets(options: MediaFetchOptions): Promise\ | Deprecated | +| medialibrary | **function** on(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback: Callback\): void | Deprecated | +| medialibrary | **function** off(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback?: Callback\): void | Deprecated | +| medialibrary | **function** createAsset(mediaType: MediaType, displayName: string, relativePath: string, callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** createAsset(mediaType: MediaType, displayName: string, relativePath: string): Promise\ | Deprecated | +| medialibrary | **function** deleteAsset(uri: string): Promise\ | Deprecated | +| medialibrary | **function** deleteAsset(uri: string, callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** getPublicDirectory(type: DirectoryType, callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** getPublicDirectory(type: DirectoryType): Promise\ | Deprecated | +| medialibrary | **function** getAlbums(options: MediaFetchOptions, callback: AsyncCallback\\>): void | Deprecated | +| medialibrary | **function** getAlbums(options: MediaFetchOptions): Promise\\> | Deprecated | +| medialibrary | **function** release(callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** release(): Promise\ | Deprecated | +| medialibrary | **function** storeMediaAsset(option: MediaAssetOption, callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** storeMediaAsset(option: MediaAssetOption): Promise\ | Deprecated | +| medialibrary | **function** startImagePreview(images: Array\, index: number, callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** startImagePreview(images: Array\, callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** startImagePreview(images: Array\, index?: number): Promise\ | Deprecated | +| medialibrary | **function** startMediaSelect(option: MediaSelectOption, callback: AsyncCallback\\>): void | Deprecated | +| medialibrary | **function** startMediaSelect(option: MediaSelectOption): Promise\\> | Deprecated | +| medialibrary | **function** getActivePeers(): Promise\\>; | Deprecated | +| medialibrary | **function** getActivePeers(callback: AsyncCallback\\>): void; | Deprecated | +| medialibrary | **function** getAllPeers(): Promise\\>; | Deprecated | +| medialibrary | **function** FileAsset.isDirectory(callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** FileAsset.isDirectory():Promise\ | Deprecated | +| medialibrary | **function** FileAsset.commitModify(callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** FileAsset.commitModify(): Promise\ | Deprecated | +| medialibrary | **function** FileAsset.open(mode: string, callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** FileAsset.open(mode: string): Promise\ | Deprecated | +| medialibrary | **function** FileAsset.close(fd: number, callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** FileAsset.close(fd: number): Promise\ | Deprecated | +| medialibrary | **function** FileAsset.getThumbnail(callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** FileAsset.getThumbnail(size: Size, callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** FileAsset.getThumbnail(size?: Size): Promise\ | Deprecated | +| medialibrary | **function** FileAsset.favorite(isFavorite: boolean, callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** FileAsset.favorite(isFavorite: boolean): Promise\ | Deprecated | +| medialibrary | **function** FileAsset.isFavorite(callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** FileAsset.isFavorite():Promise\ | Deprecated | +| medialibrary | **function** FileAsset.trash(isTrash: boolean, callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** FileAsset.trash(isTrash: boolean): Promise\ | Deprecated | +| medialibrary | **function** FileAsset.isTrash(callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** FileAsset.isTrash():Promise\ | 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\): void | Deprecated | +| medialibrary | **function** FetchFileResult.getFirstObject(): Promise\ | Deprecated | +| medialibrary | **function** FetchFileResult.getNextObject(callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** FetchFileResult.getNextObject(): Promise\ | Deprecated | +| medialibrary | **function** FetchFileResult.getLastObject(callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** FetchFileResult.getLastObject(): Promise\ | Deprecated | +| medialibrary | **function** FetchFileResult.getPositionObject(index: number, callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** FetchFileResult.getPositionObject(index: number): Promise\ | Deprecated | +| medialibrary | **function** FetchFileResult.getAllObject(callback: AsyncCallback\\>): void | Deprecated | +| medialibrary | **function** FetchFileResult.getAllObject(): Promise\\> | Deprecated | +| medialibrary | **function** Album.commitModify(callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** Album.commitModify(): Promise\ | Deprecated | +| medialibrary | **function** Album.getFileAssets(options: MediaFetchOptions, callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** Album.getFileAssets(options?: MediaFetchOptions): Promise\ | 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); + } +} +``` diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.7/changelogs-util.md b/en/release-notes/changelogs/OpenHarmony_3.2.10.7/changelogs-util.md new file mode 100644 index 0000000000000000000000000000000000000000..52035aa2be49e1f11d72e91ec65f413112f5f13a --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.10.7/changelogs-util.md @@ -0,0 +1,99 @@ +# 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
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
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
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); +```