From: Hyunjin Park
+ Since:
+ 2.4
+
+The launch modes defined by this enumerator are:
+
Since:
@@ -1625,7 +1651,7 @@ and launches the selected application.
+ Since:
+ 2.4
+
Since:
2.3
@@ -295,9 +333,71 @@ The following values are supported:
ESE - The eSE (Embedded Secure Element) secure element type
Remark :
+ HCE is supported since Tizen 2.3.1
+
+ Since:
+ 2.3.1
+
+The following values are supported:
+
+ Since:
+ 2.3.1
+
+The following values are supported:
+
+ Since:
+ 2.3.1
+
Since:
@@ -1379,8 +1495,547 @@ Such an event may indicate initiating a financial transaction using the device.
Parameters: Exceptions:
+ with error type SecurityError, if the application does not have the privilege to call this method.
+
+ with error type NotSupportedError, if NFC card emulation is not supported.
+
+ with error type UnknownError, in any other error case.
+ Code example:
+ Since:
+ 1.0
+
+If the operation completes successfully, the NDEF Message that is last read
+should be returned.
+
+ Privilege level:
+ public
+
+ Privilege:
+ http://tizen.org/privilege/nfc.common
+ Return value: Exceptions:
+ with error type SecurityError, if the application does not have the privilege to call this method.
+
+ with error type UnknownError, in any other error case.
+ Code example:
+ Since:
+ 2.3
+
+If the current application has priority, and is in the foreground, the system will not generate
+application control requests to pick an application to handle a transaction event request.
+
+When the current application moves to the background, it loses priority.
+
+An application is allowed to get priority only when it is in the foreground.
+Losing priority is always allowed regardless of an application's status.
+
+ Privilege level:
+ public
+
+ Privilege:
+ http://tizen.org/privilege/nfc.cardemulation
+ Parameters: Exceptions:
+ with error type SecurityError, if the application does not have the privilege to call this method or a valid certificate to call this method.
+
+ with error type ServiceNotAvailableError, if the application is not in the foreground and is trying to get priority.
+
+ with error type NotSupportedError, if NFC card emulation is not supported.
+
+ with error type UnknownError, in any other error case.
+ Code example:
+ Since:
+ 2.3.1
+
+ Privilege level:
+ public
+
+ Privilege:
+ http://tizen.org/privilege/nfc.cardemulation
+ Remark :
+ To check if NFC HCE is supported on this device, use tizen.systeminfo.getCapability("http://tizen.org/feature/network.nfc.card_emulation.hce").
+ Parameters: Return value: Exceptions:
+ with error type TypeMismatchError, if the input parameter is not compatible with the expected type for that parameter.
+
+ with error type SecurityError, if the application does not have the privilege to call this method.
+
+ with error type NotSupportedError, if NFC HCE is not supported.
+
+ with error type UnknownError, in any other error case.
+ Code example:
+ Since:
+ 2.3.1
+
+ Privilege level:
+ public
+
+ Privilege:
+ http://tizen.org/privilege/nfc.cardemulation
+ Parameters: Exceptions:
+ with error type SecurityError, if the application does not have the privilege to call this method.
+
+ with error type NotSupportedError, if NFC HCE is not supported.
+
+ with error type UnknownError, in any other error case.
+ Code example:
+ Since:
+ 2.3.1
+
+The ErrorCallback is launched with these error types:
+
+ Privilege level:
+ public
+
+ Privilege:
+ http://tizen.org/privilege/nfc.cardemulation
+ Remark :
+ To check if NFC HCE is supported on this device, use tizen.systeminfo.getCapability("http://tizen.org/feature/network.nfc.card_emulation.hce").
+ Parameters: Exceptions:
+ with error type TypeMismatchError, if the input parameter is not compatible with the expected type for that parameter.
+
+ with error type SecurityError, if the application does not have the privilege to call this method.
+
+ with error type NotSupportedError, if NFC HCE is not supported.
+ Code example:
+ Since:
+ 2.3.1
+
+ Privilege level:
+ public
+
+ Privilege:
+ http://tizen.org/privilege/nfc.cardemulation
+ Remark :
+ To check if NFC HCE is supported on this device, use tizen.systeminfo.getCapability("http://tizen.org/feature/network.nfc.card_emulation.hce").
+ Parameters: Return value: Exceptions:
+ with error type TypeMismatchError, if the input parameter is not compatible with the expected type for that parameter.
+
+ with error type SecurityError, if the application does not have the privilege to call this method.
+
+ with error type NotSupportedError, if NFC HCE is not supported.
+
+ with error type UnknownError, in any other error case.
+ Code example:
+ Since:
+ 2.3.1
+
+ Privilege level:
+ public
+
+ Privilege:
+ http://tizen.org/privilege/nfc.cardemulation
+ Remark :
+ To check if NFC HCE is supported on this device, use tizen.systeminfo.getCapability("http://tizen.org/feature/network.nfc.card_emulation.hce").
+ Parameters: Return value: Exceptions:
+ with error type TypeMismatchError, if the input parameter is not compatible with the expected type for that parameter.
+
+ with error type SecurityError, if the application does not have the privilege to call this method.
+
+ with error type NotSupportedError, if NFC HCE is not supported.
+
+ with error type UnknownError, in any other error case.
+ Code example:
+ Since:
+ 2.3.1
+
+ Privilege level:
+ public
+
+ Privilege:
+ http://tizen.org/privilege/nfc.cardemulation
+ Remark :
+ To check if NFC HCE is supported on this device, use tizen.systeminfo.getCapability("http://tizen.org/feature/network.nfc.card_emulation.hce").
+ Parameters: Exceptions:
+ with error type TypeMismatchError, if the input parameter is not compatible with the expected type for that parameter.
+
with error type SecurityError, if the application does not have the privilege to call this method.
- with error type NotSupportedError, if NFC card emulation is not supported.
+ with error type NotSupportedError, if NFC HCE is not supported.
with error type UnknownError, in any other error case.
@@ -1401,87 +2059,109 @@ Such an event may indicate initiating a financial transaction using the device.
Code example:
Since:
- 1.0
-
-If the operation completes successfully, the NDEF Message that is last read
-should be returned.
+ 2.3.1
Privilege level:
public
Privilege:
- http://tizen.org/privilege/nfc.common
+ http://tizen.org/privilege/nfc.cardemulation
Return value: Remark :
+ To check if NFC HCE is supported on this device, use tizen.systeminfo.getCapability("http://tizen.org/feature/network.nfc.card_emulation.hce").
+ Parameters: Exceptions:
+ with error type TypeMismatchError, if the input parameter is not compatible with the expected type for that parameter.
+
with error type SecurityError, if the application does not have the privilege to call this method.
+ with error type NotSupportedError, if NFC HCE is not supported.
+
with error type UnknownError, in any other error case.
Code example: Code example:
Since:
- 2.3
+ 2.3.1
-If the current application has priority, and is in the foreground, the system will not generate
-application control requests to pick an application to handle a transaction event request.
-
-When the current application moves to the background, it loses priority.
-
-An application is allowed to get priority only when it is in the foreground.
-Losing priority is always allowed regardless of an application's status.
+The ErrorCallback is launched with these error types:
Privilege level:
@@ -1491,12 +2171,28 @@ Losing priority is always allowed regardless of an application's status.
Privilege:
http://tizen.org/privilege/nfc.cardemulation
Remark :
+ To check if NFC HCE is supported on this device, use tizen.systeminfo.getCapability("http://tizen.org/feature/network.nfc.card_emulation.hce").
+ Parameters: Exceptions:
- with error type SecurityError, if the application does not have the privilege to call this method or a valid certificate to call this method.
-
- with error type ServiceNotAvailableError, if the application is not in the foreground and is trying to get priority.
+ with error type TypeMismatchError, if the input parameter is not compatible with the expected type for that parameter.
- with error type NotSupportedError, if NFC card emulation is not supported.
+ with error type SecurityError, if the application does not have the privilege to call this method.
- with error type UnknownError, in any other error case.
+ with error type NotSupportedError, if NFC HCE is not supported.
Code example:
+ Since:
+ 2.3.1
+
+ Since:
+ 2.3.1
+
+ Since:
+ 2.3.1
+
+ Since:
+ 2.3.1
+
+ Since:
+ 2.3.1
+
+ Since:
+ 2.3.1
+
+ Since:
+ 2.3.1
+
+ Since:
+ 2.3.1
+
+ Since:
+ 2.3.1
+
+ Since:
+ 2.3.1
+ Parameters:
+ Since:
+ 2.3.1
+
+ Since:
+ 2.3.1
+ Parameters:
@@ -195,6 +197,28 @@ For more information on the Application features, see
+
1.3. ApplicationControlLaunchMode
+ enum ApplicationControlLaunchMode { "SINGLE", "GROUP" };
+
+
+ 2. Interfaces
@@ -1594,7 +1618,7 @@ and launches the selected application.
[Constructor(DOMString operation, optional DOMString? uri,
optional DOMString? mime, optional DOMString? category,
- optional ApplicationControlData[]? data)]
+ optional ApplicationControlData[]? data, optional ApplicationControlLaunchMode? launchMode)]
interface ApplicationControl {
attribute DOMString operation;
@@ -1607,6 +1631,8 @@ and launches the selected application.
attribute ApplicationControlData[] data;
+ attribute ApplicationControlLaunchMode launchMode;
+
};
Constructors
-
+ApplicationControl(DOMString operation, optional DOMString? uri, optional DOMString? mime, optional DOMString? category, optional ApplicationControlData[]? data);
ApplicationControl(DOMString operation, optional DOMString? uri, optional DOMString? mime, optional DOMString? category, optional ApplicationControlData[]? data, optional ApplicationControlLaunchMode? launchMode);
Attributes
@@ -1677,6 +1703,15 @@ performed by an application control.
2.0
+
@@ -69,19 +75,27 @@ For more information on the NFC features, see NDEFRecordMedia
void removeActiveSecureElementChangeListener (long watchId)
NDEFMessage? getCachedMessage ()
- void setExclusiveModeForTransaction (boolean mode)
+ void setExclusiveModeForTransaction (boolean mode)
+ long addHCEEventListener (HCEEventReceiveCallback eventCallback)
+ void removeHCEEventListener (long watchId)
+ void sendHostAPDUResponse (byte[] apdu, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback)
+ boolean isActivatedHandlerForAID (SecureElementType type, AID aid)
+ boolean isActivatedHandlerForCategory (SecureElementType type, CardEmulationCategoryType category)
+ void registerAID (SecureElementType type, AID aid, CardEmulationCategoryType category)
+ void unregisterAID (SecureElementType type, AID aid, CardEmulationCategoryType category)
+ void getAIDsForCategory (SecureElementType type, CardEmulationCategoryType category, AIDArraySuccessCallback successCallback, optional ErrorCallback? errorCallback)
+NFCTag
@@ -157,6 +179,14 @@ For more information on the NFC features, see HCEEventData
+
+
+
+AIDData
+
+
+NFCTagDetectCallback
void onattach (NFCTag nfcTag)
@@ -186,6 +216,14 @@ For more information on the NFC features, see ActiveSecureElementChangeCallback
void ondetach ()void onchanged (SecureElementType type)
+
+HCEEventReceiveCallback
+void ondetected (HCEEventData data)
+
+
AIDArraySuccessCallback
+void onsuccess (AIDData[] aids)
+ enum SecureElementType { "ESE", "UICC" };
+ enum SecureElementType { "ESE", "UICC", "HCE" };
1.5. CardEmulationCategoryType
+ enum CardEmulationCategoryType { "PAYMENT", "OTHER" };
+
+
+ 1.6. HCEEventType
+ enum HCEEventType { "DEACTIVATED", "ACTIVATED", "APDU_RECEIVED" };
+
+
1.7. AID
+ typedef DOMString AID;
+2. Interfaces
@@ -577,6 +677,22 @@ The exclusive mode can only be set when NFC is on. If NFC is off, the mode is ig
void setExclusiveModeForTransaction(boolean mode) raises(WebAPIException);
+ long addHCEEventListener(HCEEventReceiveCallback eventCallback) raises(WebAPIException);
+
+ void removeHCEEventListener(long watchId) raises(WebAPIException);
+
+ void sendHostAPDUResponse(byte[] apdu, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException);
+
+ boolean isActivatedHandlerForAID(SecureElementType type, AID aid) raises(WebAPIException);
+
+ boolean isActivatedHandlerForCategory(SecureElementType type, CardEmulationCategoryType category) raises(WebAPIException);
+
+ void registerAID(SecureElementType type, AID aid, CardEmulationCategoryType category) raises(WebAPIException);
+
+ void unregisterAID(SecureElementType type, AID aid, CardEmulationCategoryType category) raises(WebAPIException);
+
+ void getAIDsForCategory(SecureElementType type, CardEmulationCategoryType category, AIDArraySuccessCallback successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException);
+
};
+
+
+
+ try {
+ adapter.removeActiveSecureElementChangeListener(listenerId) ;
+ } catch (err) {
+ console.log(err.name + ": " + err.message);
+ }
+
+getCachedMessage
+NDEFMessage? getCachedMessage();
+
+
+
+ // Gets the cached message
+ var cachedMessage = tizen.nfc.getDefaultAdapter().getCachedMessage();
+
+setExclusiveModeForTransaction
+void setExclusiveModeForTransaction(boolean mode);
+
+
+
+
+
+ try {
+ adapter.setExclusiveModeForTransaction(true) ;
+ } catch (err) {
+ console.log(err.name + ": " + err.message);
+ }
+
+addHCEEventListener
+long addHCEEventListener(HCEEventReceiveCallback eventCallback);
+
If it is not supported, NotSupportedError is thrown.
+
+
+
+
+
+ try {
+ var onDetectedCB = function(event_data) {
+ console.log("HCE event type is " + event_data.eventType);
+ console.log("APDU is " + event_data.apdu);
+ };
+ var listenerId = adapter.addHCEEventListener(onDetectedCB) ;
+ } catch (err) {
+ console.log(err.name + ": " + err.message);
+ }
+
+removeHCEEventListener
+void removeHCEEventListener(long watchId);
+
+
+
+
+
+ try {
+ adapter.removeHCEEventListener(listenerId) ;
+ } catch (err) {
+ console.log(err.name + ": " + err.message);
+ }
+
+sendHostAPDUResponse
+void sendHostAPDUResponse(byte[] apdu, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback);
+
+
+
If it is not supported, NotSupportedError is thrown.
+
+
+
+
+
+ try {
+ var successCB = function() {
+ console.log("Sending APDU reponse was successful.");
+ };
+
+ var errorCB = function() {
+ console.log("Sending APDU reponse failed.");
+ };
+
+ var apdu_response= [0x00,0xA4,0x04,0x00,0x04,0x11,0x12, 0x13, 0x14]; //set apdu response.
+ adapter.sendHostAPDUResponse(apdu_response, successCB, errorCB) ;
+ } catch (err) {
+ console.log(err.name + ": " + err.message);
+ }
+
+isActivatedHandlerForAID
+boolean isActivatedHandlerForAID(SecureElementType type, AID aid);
+
If it is not supported, NotSupportedError is thrown.
+
+
+
+
+
+ try {
+ var aid = "ABC0012345";
+ var isActiveHandler = adapter.isActivatedHandlerForAID("HCE", aid);
+ if(isActiveHandler){
+ console.log("current application is activated handler for the AID");
+ }
+ } catch (err) {
+ console.log(err.name + ": " + err.message);
+ }
+
+isActivatedHandlerForCategory
+boolean isActivatedHandlerForCategory(SecureElementType type, CardEmulationCategoryType category);
+
If it is not supported, NotSupportedError is thrown.
+
+
+
+
+
+ try {
+ var isActiveHandler = adapter.isActivatedHandlerForCategory("ESE", "PAYMENT") ;
+ if(isActiveHandler){
+ console.log("current application is activated handler for the category");
+ }
+ } catch (err) {
+ console.log(err.name + ": " + err.message);
+ }
+
+registerAID
+void registerAID(SecureElementType type, AID aid, CardEmulationCategoryType category);
+
If it is not supported, NotSupportedError is thrown.
+
+
try {
- adapter.removeActiveSecureElementChangeListener(listenerId) ;
+
+ var aid = "ABC0012345";
+ adapter.registerAID("HCE", aid, "PAYMENT") ;
} catch (err) {
console.log(err.name + ": " + err.message);
}
getCachedMessage
+unregisterAID
NDEFMessage? getCachedMessage();
+
void unregisterAID(SecureElementType type, AID aid, CardEmulationCategoryType category);
If it is not supported, NotSupportedError is thrown.
+
+
+
// Gets the cached message
- var cachedMessage = tizen.nfc.getDefaultAdapter().getCachedMessage();
+
try {
+
+ var aid = "ABC0012345";
+ adapter.unregisterAID("HCE", aid, "PAYMENT") ;
+ } catch (err) {
+ console.log(err.name + ": " + err.message);
+ }
setExclusiveModeForTransaction
+getAIDsForCategory
void setExclusiveModeForTransaction(boolean mode);
+
void getAIDsForCategory(SecureElementType type, CardEmulationCategoryType category, AIDArraySuccessCallback successCallback, optional ErrorCallback? errorCallback);
+
If it is not supported, NotSupportedError is thrown.
+
try {
- adapter.setExclusiveModeForTransaction(true) ;
- } catch (err) {
- console.log(err.name + ": " + err.message);
- }
-
-2.11. HCEEventData
+ [NoInterfaceObject] interface HCEEventData {
+ readonly attribute HCEEventType eventType;
+
+ readonly attribute byte[] apdu;
+
+ readonly attribute long length;
+ };
+Attributes
+
+
+2.12. AIDData
+ [NoInterfaceObject] interface AIDData{
+ readonly attribute SecureElementType type;
+
+ readonly attribute AID aid;
+
+ readonly attribute boolean readOnly;
+ };
+Attributes
+
+
+2.11. NFCTagDetectCallback
+2.13. NFCTagDetectCallback
2.12. NFCPeerDetectCallback
+2.14. NFCPeerDetectCallback
2.13. NDEFMessageReadCallback
+2.15. NDEFMessageReadCallback
2.14. ByteArraySuccessCallback
+2.16. ByteArraySuccessCallback
2.15. CardEmulationModeChangeCallback
+2.17. CardEmulationModeChangeCallback
2.16. TransactionEventCallback
+2.18. TransactionEventCallback
2.17. ActiveSecureElementChangeCallback
+2.19. ActiveSecureElementChangeCallback
2.20. HCEEventReceiveCallback
+[Callback=FunctionOnly, NoInterfaceObject] interface HCEEventReceiveCallback {
+ void ondetected(HCEEventData data);
+};
+Methods
+
+
+ondetected
+void ondetected(HCEEventData data);
+
+
+2.21. AIDArraySuccessCallback
+[Callback=FunctionOnly, NoInterfaceObject] interface AIDArraySuccessCallback {
+ void onsuccess(AIDData[] aids);
+};
+Methods
+
+
+onsuccess
+void onsuccess(AIDData[] aids);
+
+
+3. Related Feature
+To guarantee that the NFC host-based card emulation application runs on a device with the NFC host-based card emulation feature, declare the following feature requirements in the config file: +
+enum SensorType { "LIGHT", "MAGNETIC", "PRESSURE", "PROXIMITY", "ULTRAVIOLET" };+
enum SensorType { "LIGHT", "MAGNETIC", "PRESSURE", "PROXIMITY", "ULTRAVIOLET", "HRM_RAW" };
Since: 2.3 @@ -183,8 +195,13 @@ PRESSURE - Pressure sensor PROXIMITY - Proximity sensor
Remark : + HRM_RAW is supported since Tizen 2.3.1 +
+ Privilege level: + public +
++ Privilege: + http://tizen.org/privilege/healthinfo +
+Remark : + http://tizen.org/privilege/healthinfo is required only for HRM_RAW type. HRM_RAW is supported since Tizen 2.3.1 +
Parameters:
with error type NotSupportedError, if the given type is not supported on the device.
+ with error type SecurityError, this error is only thrown for HRM_RAW sensor type when an application does not have http://tizen.org/privilege/healthinfo privilege in config.xml. +
[NoInterfaceObject] interface HRMRawSensor : Sensor { + + void getHRMRawSensorData(SensorDataSuccessCallback successCallback, + optional ErrorCallback? errorCallback) raises(WebAPIException); + };+
+ Since: + 2.3.1 +
+ +getHRMRawSensorData
+void getHRMRawSensorData(SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback); +
+ Since: + 2.3.1 +
++Note that before calling the getHRMRawSensorData() method, the start() method should be called to turn on the sensor. +
++The ErrorCallback method is launched with these error types: +
++ Privilege level: + public +
++ Privilege: + http://tizen.org/privilege/healthinfo +
+Parameters:
+Exceptions:
++ with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter. +
+ with error type UnknownError, if retrieving the sensor data fails because of an unknown error. +
+ with error type SecurityError, if the application does not have the privilege to use this function. +
Code example:
var HRMrawsensor = tizen.sensorservice.getDefaultSensor("HRM_RAW"); + + function onGetSuccessCB(sensorData) { + console.log("HRMRaw light intensity : " + sensorData.lightIntensity); + } + + function onerrorCB(error) { + console.log("error occurs"); + } + + function onsuccessCB() { + console.log("HRMRaw sensor start"); + HRMrawsensor.getHRMRawSensorData(onGetSuccessCB, onerrorCB); + } + + HRMrawsensor.start(onsuccessCB); + ++
[NoInterfaceObject] interface SensorHRMRawData : SensorData { + + readonly attribute DOMString lightType; + + readonly attribute unsigned long lightIntensity; + };+
+ Since: + 2.3.1 +
+ ++The following values are supported: +
++ Since: + 2.3.1 +
++ Since: + 2.3.1 +
++To guarantee that the Heart Rate Monitor application runs on a device with a heart rate monitor, declare the following feature requirements in the config file: +
+module Sensor { - enum SensorType { "LIGHT", "MAGNETIC", "PRESSURE", "PROXIMITY", "ULTRAVIOLET" }; + enum SensorType { "LIGHT", "MAGNETIC", "PRESSURE", "PROXIMITY", "ULTRAVIOLET", "HRM_RAW" }; enum ProximityState { "FAR", "NEAR" }; @@ -1363,6 +1564,12 @@ To guarantee that the UV sensor application runs on a device with a UV sensor, d optional ErrorCallback? errorCallback) raises(WebAPIException); }; + [NoInterfaceObject] interface HRMRawSensor : Sensor { + + void getHRMRawSensorData(SensorDataSuccessCallback successCallback, + optional ErrorCallback? errorCallback) raises(WebAPIException); + }; + [NoInterfaceObject] interface SensorData { }; @@ -1397,6 +1604,13 @@ To guarantee that the UV sensor application runs on a device with a UV sensor, d readonly attribute long ultravioletLevel; }; + [NoInterfaceObject] interface SensorHRMRawData : SensorData { + + readonly attribute DOMString lightType; + + readonly attribute unsigned long lightIntensity; + }; + [Callback=FunctionOnly, NoInterfaceObject] interface SensorDataSuccessCallback { void onsuccess(optional SensorData? sensorData); }; diff --git a/org.tizen.web.apireference/html/device_api/mobile/tizen/sound.html b/org.tizen.web.apireference/html/device_api/mobile/tizen/sound.html index 48008fe..d331c30 100644 --- a/org.tizen.web.apireference/html/device_api/mobile/tizen/sound.html +++ b/org.tizen.web.apireference/html/device_api/mobile/tizen/sound.html @@ -10,7 +10,7 @@Sound API
- The Sound API provides functions to control volume level for several sound types. + The Sound API provides functions to control the volume level for several sound types and to check whether a specified sound device type is connected.@@ -32,6 +32,10 @@ For more information on the Sound features, see SoundModeType +
1.3. SoundDeviceType + +1.4. SoundIOType + 2. Interfaces -@@ -39,9 +43,13 @@ For more information on the Sound features, see SoundManager
2.3. SoundModeChangeCallback + 2.3. SoundDeviceInfo + +2.4. SoundModeChangeCallback + +2.5. SoundVolumeChangeCallback -2.4. SoundVolumeChangeCallback + 2.6. SoundDeviceStateChangeCallback @@ -69,7 +77,15 @@ For more information on the Sound features, see setSoundModeChangeListener (SoundModeChangeCallback callback)
void unsetSoundModeChangeListener ()
void setVolumeChangeListener (SoundVolumeChangeCallback callback)
- void unsetVolumeChangeListener () + void unsetVolumeChangeListener ()
+ SoundDeviceInfo[] getConnectedDeviceList ()
+ SoundDeviceInfo[] getActivatedDeviceList ()
+ long addDeviceStateChangeListener (SoundDeviceStateChangeCallback callback)
+ void removeDeviceStateChangeListener (long id) + ++ SoundDeviceInfo ++ SoundModeChangeCallback @@ -79,6 +95,10 @@ For more information on the Sound features, see SoundVolumeChangeCallbackvoid onsuccess (SoundType type, double volume) + SoundDeviceStateChangeCallback +void onchanged (SoundDeviceInfo info) +@@ -145,6 +165,77 @@ For more information on the Sound features, see ++1.3. SoundDeviceType
++ Sound device type ++enum SoundDeviceType { + "SPEAKER", + "RECEIVER", + "AUDIO_JACK", + "BLUETOOTH", + "HDMI", + "MIRRORING", + "USB_AUDIO", + "MIC" + };++ Since: + 2.3.1 +
++++The possible types are: +
++
+- + SPEAKER - For sound output using the built-in device speaker
+- + RECEIVER - For sound output using the built-in device receiver
+- + AUDIO_JACK - For sound input and/or output using the device audio jack which can be connected to a wired accessory such as a headset or headphone
+- + BLUETOOTH - For sound input and/or output through a device that is connected by Bluetooth
+- + HDMI - For sound output through a device that is connected by HDMI
+- + MIRRORING - For sound output through a device that is connected by mirroring
+- + USB_AUDIO - For sound output through a device that is connected by USB
+- + MICROPHONE - For sound input using the built-in device mic
++1.4. SoundIOType
++ Sound device I/O type ++enum SoundIOType { + "IN", + "OUT", + "BOTH" + };++ Since: + 2.3.1 +
++++The possible types are: +
++
+- + IN - For sound device type which only support input
+- + OUT - For sound device type which only support output
+- + BOTH - For sound device type which supports both input and output
++2. Interfaces
@@ -180,7 +271,6 @@ There is a tizen.sound object that allows accessing the functionality of the Sou double getVolume(SoundType type) raises(WebAPIException); - void setSoundModeChangeListener(SoundModeChangeCallback callback) raises(WebAPIException); void unsetSoundModeChangeListener() raises(WebAPIException); @@ -188,6 +278,14 @@ There is a tizen.sound object that allows accessing the functionality of the Sou void setVolumeChangeListener(SoundVolumeChangeCallback callback) raises(WebAPIException); void unsetVolumeChangeListener() raises(WebAPIException); + + SoundDeviceInfo[] getConnectedDeviceList() raises(WebAPIException); + + SoundDeviceInfo[] getActivatedDeviceList() raises(WebAPIException); + + long addDeviceStateChangeListener(SoundDeviceStateChangeCallback callback) raises(WebAPIException); + + void removeDeviceStateChangeListener(long id) raises(WebAPIException); };Since: @@ -428,16 +526,280 @@ There is a tizen.sound object that allows accessing the functionality of the Sou
getConnectedDeviceList
+SoundDeviceInfo[] getConnectedDeviceList(); +
+ Since: + 2.3.1 +
+Return value:
+ The list of connected sound devices +Exceptions:
++ with error type UnknownError in any other error case. +
Code example:
var infoArr = tizen.sound.getConnectedDeviceList(); + + for (var i = 0; i < infoArr.length; i++) { + cosole.log( infoArr[i].device ); + } ++
getActivatedDeviceList
+SoundDeviceInfo[] getActivatedDeviceList(); +
+ Since: + 2.3.1 +
+Return value:
+ The list of activated sound devices +Exceptions:
++ with error type UnknownError in any other error case. +
Code example:
var infoArr = tizen.sound.getActivatedDeviceList(); + + for (var i = 0; i < infoArr.length; i++) { + cosole.log( infoArr[i].device ); + } ++
addDeviceStateChangeListener
+long addDeviceStateChangeListener(SoundDeviceStateChangeCallback callback); +
+ Since: + 2.3.1 +
++There are two types of device state changes: +
+Parameters:
+Return value:
+ long ID of the listener that can be used to remove the listener later. +Exceptions:
++ with error type TypeMismatchError, if the input parameter is not compatible with the expected type. +
+ with error type UnknownError in any other error case. +
Code example:
// A callback + var onChanged = function(info) { + // Some code to execute when a sound device state is changed + if (info.isConnected) { + // Some code to execute if the device is connected. + console.log( info.device + " is connected" ); + } else { + // Some code to execute if the device is not connected. + console.log( info.device + " is not connected" ); + } + + if (info.isActivated) { + // Some code to execute if the device is activated. + console.log( info.device + " is activated" ); + } else { + // Some code to execute if the device is not activated. + console.log( info.device + " is not activated" ); + } + } + + var id = tizen.sound.addDeviceStateChangeListener(onChanged); ++
removeDeviceStateChangeListener
+void removeDeviceStateChangeListener(long id); +
+ Since: + 2.3.1 +
+Parameters:
+Exceptions:
++ with error type UnknownError in any error case. +
Code example:
// If a listener to be called was registered previously. + tizen.sound.removeDeviceStateChangeListener(id); ++
[NoInterfaceObject] interface SoundDeviceInfo { + + readonly attribute long id; + + readonly attribute DOMString name; + + readonly attribute SoundDeviceType device; + + readonly attribute SoundIOType direction; + + readonly attribute boolean isConnected; + + readonly attribute boolean isActivated; + };+
+ Since: + 2.3.1 +
++ Since: + 2.3.1 +
++ Since: + 2.3.1 +
++ Since: + 2.3.1 +
++ Since: + 2.3.1 +
++ Since: + 2.3.1 +
++ Since: + 2.3.1 +
+[Callback=FunctionOnly, NoInterfaceObject] - interface SoundModeChangeCallback { +[Callback=FunctionOnly, NoInterfaceObject] interface SoundModeChangeCallback { + void onsuccess(SoundModeType mode); };@@ -474,12 +836,12 @@ There is a tizen.sound object that allows accessing the functionality of the Sou
[Callback=FunctionOnly, NoInterfaceObject] - interface SoundVolumeChangeCallback { +[Callback=FunctionOnly, NoInterfaceObject] interface SoundVolumeChangeCallback { + void onsuccess(SoundType type, double volume); };@@ -519,9 +881,52 @@ There is a tizen.sound object that allows accessing the functionality of the Sou
[Callback=FunctionOnly, NoInterfaceObject] interface SoundDeviceStateChangeCallback { + + void onchanged(SoundDeviceInfo info); + };+
+ Since: + 2.3.1 +
+onchanged
+void onchanged(SoundDeviceInfo info); +
+ Since: + 2.3.1 +
+Parameters:
+module Sound { + enum SoundType { "SYSTEM", "NOTIFICATION", @@ -537,6 +942,23 @@ There is a tizen.sound object that allows accessing the functionality of the Sou "MUTE" }; + enum SoundDeviceType { + "SPEAKER", + "RECEIVER", + "AUDIO_JACK", + "BLUETOOTH", + "HDMI", + "MIRRORING", + "USB_AUDIO", + "MIC" + }; + + enum SoundIOType { + "IN", + "OUT", + "BOTH" + }; + [NoInterfaceObject] interface SoundManagerObject { readonly attribute SoundManager sound; }; @@ -550,7 +972,6 @@ There is a tizen.sound object that allows accessing the functionality of the Sou double getVolume(SoundType type) raises(WebAPIException); - void setSoundModeChangeListener(SoundModeChangeCallback callback) raises(WebAPIException); void unsetSoundModeChangeListener() raises(WebAPIException); @@ -558,17 +979,45 @@ There is a tizen.sound object that allows accessing the functionality of the Sou void setVolumeChangeListener(SoundVolumeChangeCallback callback) raises(WebAPIException); void unsetVolumeChangeListener() raises(WebAPIException); + + SoundDeviceInfo[] getConnectedDeviceList() raises(WebAPIException); + + SoundDeviceInfo[] getActivatedDeviceList() raises(WebAPIException); + + long addDeviceStateChangeListener(SoundDeviceStateChangeCallback callback) raises(WebAPIException); + + void removeDeviceStateChangeListener(long id) raises(WebAPIException); }; - [Callback=FunctionOnly, NoInterfaceObject] - interface SoundModeChangeCallback { + [NoInterfaceObject] interface SoundDeviceInfo { + + readonly attribute long id; + + readonly attribute DOMString name; + + readonly attribute SoundDeviceType device; + + readonly attribute SoundIOType direction; + + readonly attribute boolean isConnected; + + readonly attribute boolean isActivated; + }; + + [Callback=FunctionOnly, NoInterfaceObject] interface SoundModeChangeCallback { + void onsuccess(SoundModeType mode); }; - [Callback=FunctionOnly, NoInterfaceObject] - interface SoundVolumeChangeCallback { + [Callback=FunctionOnly, NoInterfaceObject] interface SoundVolumeChangeCallback { + void onsuccess(SoundType type, double volume); }; + + [Callback=FunctionOnly, NoInterfaceObject] interface SoundDeviceStateChangeCallback { + + void onchanged(SoundDeviceInfo info); + }; };
[NoInterfaceObject] interface SystemInfoCameraFlash : SystemInfoProperty { + readonly attribute double brightness raises(WebAPIException); + + readonly attribute DOMString camera; + + readonly attribute long levels raises(WebAPIException); + + void setBrightness(double brightness) raises(WebAPIException); + };+ +
+ Since: + 2.4 +
++ Privilege level: + public +
++ Privilege: + http://tizen.org/privilege/led +
+Exceptions:
++ with error type SecurityError, if this attribute is not allowed. +
Code example:
tizen.systeminfo.getPropertyValue("CAMERA_FLASH", + function (flash) { + console.log("Flash brightness is set to: " + (flash.brightness * 100).toFixed(0) + "%"); + }, + function (error) { + console.log("Error, name: " + error.name + ", message: " + error.message); + } + ); ++
+The getPropertyValue() method retrieves the SystemInfoCameraFlash for BACK camera. +
++ Since: + 2.4 +
++ Since: + 2.4 +
++ Privilege level: + public +
++ Privilege: + http://tizen.org/privilege/led +
+Exceptions:
++ with error type SecurityError, if this attribute is not allowed. +
setBrightness
+void setBrightness(double brightness); +
+ Since: + 2.4 +
++ Privilege level: + public +
++ Privilege: + http://tizen.org/privilege/led +
+Parameters:
+Exceptions:
++ with error type InvalidValuesError, if any of the input parameters contain an invalid value. +
+ with error type SecurityError, if the application does not have the privilege to call this method or if the author signature does not match that of the designated application. +
+ with error type UnknownError, if the method cannot be completed because of an unknown error. +
Code example:
tizen.systeminfo.getPropertyValue("CAMERA_FLASH", + function (flash) { + try { + flash.setBrightness(1); + } catch (error) { + console.log("Setting flash brightness failed: " + error.message); + } + }, + function (error) { + console.log("Error, name: " + error.name + ", message: " + error.message); + } + ); ++
module SystemInfo { - enum SystemInfoPropertyId { "BATTERY", "CPU", "STORAGE", "DISPLAY", "DEVICE_ORIENTATION", "BUILD", "LOCALE", "NETWORK", "WIFI_NETWORK", "CELLULAR_NETWORK", "SIM", "PERIPHERAL", "MEMORY" }; + enum SystemInfoPropertyId { "BATTERY" , "CPU", "STORAGE", "DISPLAY", "DEVICE_ORIENTATION", "BUILD", "LOCALE", "NETWORK", "WIFI_NETWORK", "CELLULAR_NETWORK", "SIM", "PERIPHERAL", "MEMORY", "CAMERA_FLASH" }; enum SystemInfoNetworkType { "NONE", "2G", "2.5G", "3G", "4G", "WIFI", "ETHERNET", "UNKNOWN" }; @@ -3494,6 +3680,16 @@ To guarantee the running of this application on a device which supports telephon }; + [NoInterfaceObject] interface SystemInfoCameraFlash : SystemInfoProperty { + readonly attribute double brightness raises(WebAPIException); + + readonly attribute DOMString camera; + + readonly attribute long levels raises(WebAPIException); + + void setBrightness(double brightness) raises(WebAPIException); + }; + };
- Privilege level: - public -
-- Privilege: - http://tizen.org/privilege/websetting +
Remark : + privilege is not required from api version 2.4
Parameters:
@@ -212,14 +207,9 @@ UnknownError - If any error occurs while deleting the cookies.Exceptions:
-+
with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter. -
- with error type SecurityError, if the application does not have the privilege to call this method. -