The **AuthorizationExtensionAbility** module provides APIs for implementing authorization to app accounts based on the ExtensionAbility framework.
> **NOTE**
>
> The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version.
| ino | number | Yes | No | File ID. Different files on the same device have different **ino**s.| |
| ino | number | Yes | No | File ID. Different files on the same device have different **ino**s.| |
| mode | number | Yes | No | File permissions. The meaning of each bit is as follows:<br>- **0o400**: The owner has the read permission on a regular file or a directory entry.<br>- **0o200**: The owner has the permission to write a regular file or create and delete a directory entry.<br>- **0o100**: The owner has the permission to execute a regular file or search for the specified path in a directory.<br>- **0o040**: The user group has the read permission on a regular file or a directory entry.<br>- **0o020**: The user group has the permission to write a regular file or create and delete a directory entry.<br>- **0o010**: The user group has the permission to execute a regular file or search for the specified path in a directory.<br>- **0o004**: Other users have the permission to read a regular file or read a directory entry.<br>- **0o002**: Other users have the permission to write a regular file or create and delete a directory entry.<br>- **0o001**: Other users have the permission to execute a regular file or search for the specified path in a directory.|
| mode | number | Yes | No | File permissions. The meaning of each bit is as follows:<br>**NOTE**<br>The following values are in octal format. The returned values are in decimal format. You need to convert the values.<br>- **0o400**: The owner has the permission to read a regular file or a directory entry.<br>- **0o200**: The owner has the permission to write a regular file or create and delete a directory entry.<br>- **0o100**: The owner has the permission to execute a regular file or search for the specified path in a directory.<br>- **0o040**: The user group has the permission to read a regular file or a directory entry.<br>- **0o020**: The user group has the permission to write a regular file or create and delete a directory entry.<br>- **0o010**: The user group has the permission to execute a regular file or search for the specified path in a directory.<br>- **0o004**: Other users have the permission to read a regular file or a directory entry.<br>- **0o002**: Other users have the permission to write a regular file or create and delete a directory entry.<br>- **0o001**: Other users have the permission to execute a regular file or search for the specified path in a directory.|
| uid | number | Yes | No | ID of the file owner.|
| uid | number | Yes | No | ID of the file owner.|
| gid | number | Yes | No | ID of the user group of the file.|
| gid | number | Yes | No | ID of the user group of the file.|
| size | number | Yes | No | File size, in bytes. This parameter is valid only for regular files. |
| size | number | Yes | No | File size, in bytes. This parameter is valid only for regular files. |
@@ -23,20 +23,18 @@ Before developing applications related to tag read and write, you must declare N
...
@@ -23,20 +23,18 @@ Before developing applications related to tag read and write, you must declare N
// Add the nfc tag action.
// Add the nfc tag action.
"ohos.nfc.tag.action.TAG_FOUND"
"ohos.nfc.tag.action.TAG_FOUND"
],
"uris":[
{
"type":"tag-tech/NfcA"
},
{
"type":"tag-tech/IsoDep"
}
// Add other technology if neccessary,
// such as NfcB, NfcF, NfcV, Ndef, MifareClassic, MifareUL, and NdefFormatable.
]
]
}
}
],
"metadata":[
{
"name":"tag-tech",
"value":"NfcA"
},
{
"name":"tag-tech",
"value":"IsoDep"
}
// Add other technologies,
// such as NfcB, NfcF, NfcV, Ndef, MifareClassic, MifareUL, and NdefFormatable.
]
]
}
}
],
],
...
@@ -49,13 +47,11 @@ Before developing applications related to tag read and write, you must declare N
...
@@ -49,13 +47,11 @@ Before developing applications related to tag read and write, you must declare N
}
}
}
}
```
```
> **CAUTION**<br>
> **CAUTION**
>
>
> - The **actions** field is mandatory. It must be **ohos.nfc.tag.action.TAG_FOUND** and cannot be changed.
> - The **actions** field is mandatory. It must be **ohos.nfc.tag.action.TAG_FOUND** and cannot be changed.
> - The **name** field under **metadata** is mandatory. It must be **tag-tech** and cannot be changed.
> - The **type** field under **uris** must start with **tag-tech/**, followed by NfcA, NfcB, NfcF, NfcV, IsoDep, Ndef, MifareClassic, MifareUL, or NdefFormatable. If there are multiple types, enter them in different lines. Incorrect settings of this field will cause a parsing failure.
> - The **value** field under **metadata** is mandatory. It can be **NfcA**, **NfcB**, **NfcF**, **NfcV**, **IsoDep**, **Ndef**, **MifareClassic**, **MifareUL**, **NdefFormatable** or any of their combinations. Incorrect settings of this field will cause a parsing failure.
> - The **name** field under **requestPermissions** is mandatory. It must be **ohos.permission.NFC_TAG** and cannot be changed.
> - The **name** field under **requestPermissions** is mandatory. It must be **ohos.permission.NFC_TAG** and cannot be changed.
## **Modules to Import**
## **Modules to Import**
```js
```js
...
@@ -528,8 +524,16 @@ import tag from '@ohos.nfc.tag';
...
@@ -528,8 +524,16 @@ import tag from '@ohos.nfc.tag';
letelementName=null;
letelementName=null;
letdiscTech=[tag.NFC_A,tag.NFC_B];// replace with the tech(s) that is needed by foreground ability
letdiscTech=[tag.NFC_A,tag.NFC_B];// replace with the tech(s) that is needed by foreground ability
functionforegroundCb(tagInfo:any){
console.log("foreground callback: tag found tagInfo = ",JSON.stringify(tagInfo));
functionforegroundCb(err,taginfo){
if(!err){
console.log("foreground callback: tag found tagInfo = ",JSON.stringify(tagInfo));
| photoUri | string | Yes | URI of the media asset whose index is to be obtained.|
| albumUri | string | Yes | Album URI, which can be an empty string. If it is an empty string, all the media assets in the Gallery are obtained by default. |
| options | [FetchOptions](#fetchoptions) | Yes | Fetch options. Only one search condition or sorting mode must be set in **predicates**. If no value is set or multiple search conditions or sorting modes are set, the API cannot be called successfully. |
| photoUri | string | Yes | URI of the media asset whose index is to be obtained.|
| albumUri | string | Yes | Album URI, which can be an empty string. If it is an empty string, all the media assets in the Gallery are obtained by default. |
| options | [FetchOptions](#fetchoptions) | Yes | Fetch options. Only one search condition or sorting mode must be set in **predicates**. If no value is set or multiple search conditions or sorting modes are set, the API cannot be called successfully. |
| uri | string | Yes | No | File asset URI, for example, **file://media/image/2**. |
| uri | string | Yes | No | File asset URI, for example, **file://media/Photo/1/IMG_datetime_0001/displayName.jpg**. |
| photoType | [PhotoType](#phototype) | Yes | No | Type of the file. |
| photoType | [PhotoType](#phototype) | Yes | No | Type of the file. |
| displayName | string | Yes | No | File name, including the file name extension, to display. |
| displayName | string | Yes | No | File name, including the file name extension, to display. |
...
@@ -2243,6 +2388,282 @@ async function example() {
...
@@ -2243,6 +2388,282 @@ async function example() {
}
}
```
```
### getExif<sup>10+</sup>
getExif(): Promise<string>
Obtains a JSON string consisting of the EXIF tags of this JPG image. This API uses a promise to return the result.
**CAUTION**<br>This API returns a JSON string consisting of EXIF tags. The complete EXIF information consists of **all_exif** and **js-apis-photoAccessHelper.md**. These two fields must be passed in via **fetchColumns**.
Obtains a JSON string consisting of the EXIF tags of this JPG image. This API uses an asynchronous callback to return the result.
**CAUTION**<br>This API returns a JSON string consisting of EXIF tags. The complete EXIF information consists of **all_exif** and **ImageVideoKey.USER_COMMENT**. These two fields must be passed in via **fetchColumns**.
console.error('setUserComment failed with error: '+err);
}
});
}catch(err){
console.error('setUserCommentDemoCallback failed with error: '+err);
}
}
```
## FetchResult
## FetchResult
Provides APIs to manage the file retrieval result.
Provides APIs to manage the file retrieval result.
...
@@ -3726,6 +4147,7 @@ Defines the key information about an image or video file.
...
@@ -3726,6 +4147,7 @@ Defines the key information about an image or video file.
| DATE_TRASHED | 'date_trashed' | Date when the file was deleted. The value is the number of seconds between the time when the file is deleted and January 1, 1970. **System API**: This is a system API. |
| DATE_TRASHED | 'date_trashed' | Date when the file was deleted. The value is the number of seconds between the time when the file is deleted and January 1, 1970. **System API**: This is a system API. |
| HIDDEN | 'hidden' | Whether the file is hidden. **System API**: This is a system API. |
| HIDDEN | 'hidden' | Whether the file is hidden. **System API**: This is a system API. |
| CAMERA_SHOT_KEY | 'camera_shot_key' | Key for the Untra Snamshot feature, which allows the camera to take photos or record videos with the screen off. (This parameter is available only for the system camera, and the key value is defined by the system camera.)<br/>**System API**: This is a system API. |
| CAMERA_SHOT_KEY | 'camera_shot_key' | Key for the Untra Snamshot feature, which allows the camera to take photos or record videos with the screen off. (This parameter is available only for the system camera, and the key value is defined by the system camera.)<br/>**System API**: This is a system API. |
| USER_COMMENT<sup>10+</sup> | 'user_comment' | User comment information. **System API**: This is a system API. |
| photoUri | string | Yes | URI of the media asset whose index is to be obtained.|
| albumUri | string | Yes | Album URI, which can be an empty string. If it is an empty string, all the media assets in the Gallery are obtained by default. |
| options | [FetchOptions](#fetchoptions) | Yes | Fetch options. Only one search condition or sorting mode must be set in **predicates**. If no value is set or multiple search conditions or sorting modes are set, the API cannot be called successfully. |
| photoUri | string | Yes | URI of the media asset whose index is to be obtained.|
| albumUri | string | Yes | Album URI, which can be an empty string. If it is an empty string, all the media assets in the Gallery are obtained by default. |
| options | [FetchOptions](#fetchoptions) | Yes | Fetch options. Only one search condition or sorting mode must be set in **predicates**. If no value is set or multiple search conditions or sorting modes are set, the API cannot be called successfully. |
| uri | string | Yes | No | File asset URI, for example, **file://media/image/2**. |
| uri | string | Yes | No | File asset URI, for example, **file://media/Photo/1/IMG_datetime_0001/displayName.jpg**. |
| fileType | [FileType](#filetype) | Yes | No | Type of the file. |
| fileType | [FileType](#filetype) | Yes | No | Type of the file. |
| displayName | string | Yes | Yes | File name, including the file name extension, to display. |
| displayName | string | Yes | Yes | File name, including the file name extension, to display. |
...
@@ -2350,6 +2495,282 @@ async function example() {
...
@@ -2350,6 +2495,282 @@ async function example() {
}
}
```
```
### getExif<sup>10+</sup>
getExif(): Promise<string>
Obtains a JSON string consisting of the exchangeable image file format (EXIF) tags of this JPG image. This API uses a promise to return the result.
**CAUTION**<br>This API returns a JSON string consisting of EXIF tags. The complete EXIF information consists of **all_exif** and **ImageVideoKey.USER_COMMENT**. These two fields must be passed in via **fetchColumns**.
Obtains a JSON string consisting of the EXIF tags of this JPG image. This API uses an asynchronous callback to return the result.
**CAUTION**<br>This API returns a JSON string consisting of EXIF tags. The complete EXIF information consists of **all_exif** and **ImageVideoKey.USER_COMMENT**. These two fields must be passed in via **fetchColumns**.
console.error('setUserComment failed with error: '+err);
}
});
}catch(err){
console.error('setUserCommentDemoCallback failed with error: '+err);
}
}
```
## FetchResult
## FetchResult
Provides APIs to manage the file retrieval result.
Provides APIs to manage the file retrieval result.
...
@@ -3962,6 +4383,7 @@ Defines the key information about an image or video file.
...
@@ -3962,6 +4383,7 @@ Defines the key information about an image or video file.
| DATE_TRASHED<sup>10+</sup> | date_trashed | Date when the file was deleted. The value is the number of seconds between the time when the file is deleted and January 1, 1970. |
| DATE_TRASHED<sup>10+</sup> | date_trashed | Date when the file was deleted. The value is the number of seconds between the time when the file is deleted and January 1, 1970. |
| HIDDEN<sup>10+</sup> | hidden | Whether the file is hidden. |
| HIDDEN<sup>10+</sup> | hidden | Whether the file is hidden. |
| CAMERA_SHOT_KEY<sup>10+</sup> | camera_shot_key | Key for the Untra Snamshot feature, which allows the camera to take photos or record videos with the screen off. (This parameter is available only for the system camera, and the key value is defined by the system camera.) |
| CAMERA_SHOT_KEY<sup>10+</sup> | camera_shot_key | Key for the Untra Snamshot feature, which allows the camera to take photos or record videos with the screen off. (This parameter is available only for the system camera, and the key value is defined by the system camera.) |
| USER_COMMENT<sup>10+</sup> | user_comment | User comment information. |
@@ -6,11 +6,11 @@ Deprecated **X509Cert.getSerialNumber()** and replaced it with **X509Cert.getCer
...
@@ -6,11 +6,11 @@ Deprecated **X509Cert.getSerialNumber()** and replaced it with **X509Cert.getCer
**Change Impact**
**Change Impact**
**X509Cert.getSerialNumber()** is deprecated since API version 10. **X509Cert.getCertSerialNumber()** should be used to replace**X509Cert.getSerialNumber()** in application development. The API function remains unchanged.
Since API version 10, use **X509Cert.getCertSerialNumber()** instead of**X509Cert.getSerialNumber()** in application development. The API function remains unchanged.
1. The location permission is not required if a random MAC is returned.
1. The GET_WIFI_PEERS_MAC permission is required if a real MAC address is returned.
| API| Permission|
| -------- | ---------------------------- |
|**function** getCandidateConfigs(): Array<WifiDeviceConfig>; | 1. The location permission is not required.|
|**function** getDeviceConfigs(): Array<WifiDeviceConfig>; | 1. The location permission is not required.|
|**function** getStations(): Array<StationInfo>; | 1. The location permission is not required. <br/>2. A random MAC address is returned (the GET_WIFI_PEERS_MAC permission is required if a real MAC address is returned). |
| **function** getCurrentP2pGroup(): Promise<WifiP2pGroupInfo>; | 1. The location permission is not required.|
| **function** getCurrentP2pGroup(callback: AsyncCallback<WifiP2pGroupInfo>): **void**; | 1. The location permission is not required.|
| **function** getP2pPeerDevices(): Promise<WifiP2pDevice[]>; | 1. The location permission is not required. <br/>2. A random MAC address is returned (the GET_WIFI_PEERS_MAC permission is required if a real MAC address is returned). |
| **function** getP2pPeerDevices(callback: AsyncCallback<WifiP2pDevice[]>): **void**; | 1. The location permission is not required. <br/>2. A random MAC address is returned (the GET_WIFI_PEERS_MAC permission is required if a real MAC address is returned). |
| **function** p2pConnect(config: WifiP2PConfig): **void**; | 1. The location permission is not required.|
| **function** startDiscoverDevices(): **void**; | 1. The location permission is not required.|
| **function** getP2pGroups(): Promise<Array<WifiP2pGroupInfo>>; | 1. The location permission is not required.|
| **function** getP2pGroups(callback: AsyncCallback<Array<WifiP2pGroupInfo>>): **void**; | 1. The location permission is not required.|
| **function** on(**type**: "p2pDeviceChange", callback: Callback<WifiP2pDevice>): **void**; | 1. The location permission is not required. <br/>2. A random MAC address is returned (the GET_WIFI_PEERS_MAC permission is required if a real MAC address is returned). |
| **function** off(**type**: "p2pDeviceChange", callback?: Callback<WifiP2pDevice>): **void**; | 1. The location permission is not required. <br/>2. A random MAC address is returned (the GET_WIFI_PEERS_MAC permission is required if a real MAC address is returned). |
| **function** on(**type**: "p2pPeerDeviceChange", callback: Callback<WifiP2pDevice[]>): **void**; | 1. The location permission is not required. <br/>2. A random MAC address is returned (the GET_WIFI_PEERS_MAC permission is required if a real MAC address is returned). |
| **function** off(**type**: "p2pPeerDeviceChange", callback?: Callback<WifiP2pDevice[]>): **void**; | 1. The location permission is not required. <br/>2. A random MAC address is returned (the GET_WIFI_PEERS_MAC permission is required if a real MAC address is returned). |
## 2 Added APIs
| API| Description|
|------|---------|
| **function** startScan(): **void**; | Starts a scan.|
| **function** getScanInfoList(): Array<WifiScanInfo>; | Obtains the scan list. |