From: Hyunjin Park Date: Wed, 29 Apr 2015 14:57:24 +0000 (+0900) Subject: tizen 2.4/2.3.1 new feature X-Git-Tag: tizen_3.0/TD_SYNC/20161201~855^2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=21590f911f576513d438c7cfdbe0bcb1b037419d;p=sdk%2Fonline-doc.git tizen 2.4/2.3.1 new feature 1. sensor HRM raw 2. sound path 3. NFC HCE 4. torch 5. appgroup 6. websetting - remove privilege Change-Id: I81c90bd754d1f6f1cda701b135674ab060d45b60 Signed-off-by: hyunjin park --- diff --git a/org.tizen.web.apireference/html/device_api/mobile/tizen/application.html b/org.tizen.web.apireference/html/device_api/mobile/tizen/application.html index 2bbe3a7..b492c75 100644 --- a/org.tizen.web.apireference/html/device_api/mobile/tizen/application.html +++ b/org.tizen.web.apireference/html/device_api/mobile/tizen/application.html @@ -43,6 +43,8 @@ For more information on the Application features, see ApplicationContextId +
  • 1.3. ApplicationControlLaunchMode +
  • 2. Interfaces
      @@ -195,6 +197,28 @@ For more information on the Application features, see +

      1.3. ApplicationControlLaunchMode

      +
      + Specifies the application launch mode when it is launched by launchAppControl(). This value may be overriden if application launched by launchAppControl() has value SINGLE configured in application manifest. +
      +
        enum ApplicationControlLaunchMode { "SINGLE", "GROUP" };
      +

      + Since: + 2.4 +

      +
      +

      +The launch modes defined by this enumerator are: +

      +
        +
      • +SINGLE - Launch application as standalone instance
      • +
      • +GROUP - Launch application in subgroup
      • +
      +
      +

      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;
      +
         };

      Since: @@ -1625,7 +1651,7 @@ and launches the selected application.

      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

      +
    • +ApplicationControlLaunchMode launchMode
      + An attribute to specify launch mode. Default application launch mode is SINGLE. +
      +

      + Since: + 2.4 +

      +
    @@ -2217,6 +2252,8 @@ an application is installed, updated, or uninstalled. typedef DOMString ApplicationContextId; + enum ApplicationControlLaunchMode { "SINGLE", "GROUP" }; + [NoInterfaceObject] interface ApplicationManagerObject { readonly attribute ApplicationManager application; }; @@ -2320,7 +2357,7 @@ an application is installed, updated, or uninstalled. [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; @@ -2333,6 +2370,8 @@ an application is installed, updated, or uninstalled. attribute ApplicationControlData[] data; + attribute ApplicationControlLaunchMode launchMode; + }; [NoInterfaceObject] interface RequestedApplicationControl { diff --git a/org.tizen.web.apireference/html/device_api/mobile/tizen/nfc.html b/org.tizen.web.apireference/html/device_api/mobile/tizen/nfc.html index 790bcda..fb85dd0 100644 --- a/org.tizen.web.apireference/html/device_api/mobile/tizen/nfc.html +++ b/org.tizen.web.apireference/html/device_api/mobile/tizen/nfc.html @@ -46,6 +46,12 @@ For more information on the NFC features, see SecureElementType
  • +
  • 1.5. CardEmulationCategoryType +
  • +
  • 1.6. HCEEventType +
  • +
  • 1.7. AID +
  • 2. Interfaces
  • @@ -122,7 +136,15 @@ For more information on the NFC features, see addActiveSecureElementChangeListener (ActiveSecureElementChangeCallback changeCallback)
    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)
    void ondetach () @@ -186,6 +216,14 @@ For more information on the NFC features, see ActiveSecureElementChangeCallback void onchanged (SecureElementType type) + +HCEEventReceiveCallback +void ondetected (HCEEventData data) + + +AIDArraySuccessCallback +void onsuccess (AIDData[] aids) +
    @@ -281,7 +319,7 @@ OFF - Card emulation mode off
    Specifies the secure element types.
    -
      enum SecureElementType { "ESE", "UICC" };
    +
      enum SecureElementType { "ESE", "UICC",  "HCE" };

    Since: 2.3 @@ -295,9 +333,71 @@ The following values are supported: ESE - The eSE (Embedded Secure Element) secure element type

  • UICC - The UICC (Universal Integrated Circuit Card) secure element type
  • +
  • +HCE - The HCE (Host Card Emulation) type. This allows a card to be emulated without secure element
  • + +
    +

    Remark : + HCE is supported since Tizen 2.3.1 +

    + +
    +

    1.5. CardEmulationCategoryType

    +
    + Specifies the card emulation category types. +
    +
      enum CardEmulationCategoryType { "PAYMENT", "OTHER" };
    +

    + Since: + 2.3.1 +

    +
    +

    +The following values are supported: +

    +
      +
    • +PAYMENT - Category used for NFC payment services
    • +
    • +OTHER - Category that can be used for all other cards
    • +
    +
    +
    +
    +

    1.6. HCEEventType

    +
    + Specifies the HCE event types. +
    +
      enum HCEEventType { "DEACTIVATED", "ACTIVATED", "APDU_RECEIVED" };
    +

    + Since: + 2.3.1 +

    +
    +

    +The following values are supported: +

    +
      +
    • +DEACTIVATED - HCE deactivated
    • +
    • +ACTIVATED - HCE activated
    • +
    • +APDU_RECEIVED - APDU (Application Protocol Data Unit) received
    +
    +

    1.7. AID

    +
    + AID (Application ID) as specified in ISO/IEC 7816-4. +
    +
      typedef DOMString AID;
    +

    + Since: + 2.3.1 +

    +

    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); + };

    Since: @@ -1379,8 +1495,547 @@ Such an event may indicate initiating a financial transaction using the device.

    Parameters:

    • -watchId: - Subscription identifier to remove +watchId: + Subscription identifier to remove +
    • +
    +
    +
    +

    Exceptions:

    +
    • WebAPIException
        +
      • + 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:

     try {
    +   adapter.removeActiveSecureElementChangeListener(listenerId) ;
    + } catch (err) {
    +   console.log(err.name + ": " + err.message);
    + }
    + 
    +
    + +
    +getCachedMessage +
    +
    +
    + Gets the NDEF message cached when the tag is detected. +
    +
    NDEFMessage? getCachedMessage();
    +             
    +

    + 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:

    + NDEFMessage The NDEF Message that was last read. +
    +
    +

    Exceptions:

    +
    • WebAPIException
        +
      • + 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:

     // Gets the cached message
    + var cachedMessage = tizen.nfc.getDefaultAdapter().getCachedMessage();
    + 
    +
    +
    +
    +setExclusiveModeForTransaction +
    +
    +
    + Gives priority to the current application for NFC transaction events. +
    +
    void setExclusiveModeForTransaction(boolean mode);
    +             
    +

    + 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:

    +
      +
    • +mode: + Value of the exclusive mode +
    • +
    +
    +
    +

    Exceptions:

    +
    • WebAPIException
        +
      • + 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:

     try {
    +   adapter.setExclusiveModeForTransaction(true) ;
    + } catch (err) {
    +   console.log(err.name + ": " + err.message);
    + }
    + 
    +
    +
    +
    +addHCEEventListener +
    +
    +
    + Registers a callback function for receiving HCE event. +
    +
    long addHCEEventListener(HCEEventReceiveCallback eventCallback);
    +             
    +

    + 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"). +
    If it is not supported, NotSupportedError is thrown. +

    +
    +

    Parameters:

    +
      +
    • +eventCallback: + Callback method to be invoked when host device receives an APDU that is defined in the ISO/IEC 7816-4 specification +
    • +
    +
    +
    +

    Return value:

    + long Subscription identifier +
    +
    +

    Exceptions:

    +
    • WebAPIException
        +
      • + 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:

     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 +
    +
    +
    + Unsubscribes from receiving notification of a HCE event. +
    +
    void removeHCEEventListener(long watchId);
    +             
    +

    + Since: + 2.3.1 +

    +

    + Privilege level: + public +

    +

    + Privilege: + http://tizen.org/privilege/nfc.cardemulation +

    +
    +

    Parameters:

    +
      +
    • +watchId: + Subscription identifier to remove +
    • +
    +
    +
    +

    Exceptions:

    +
    • WebAPIException
        +
      • + 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:

     try {
    +   adapter.removeHCEEventListener(listenerId) ;
    + } catch (err) {
    +   console.log(err.name + ": " + err.message);
    + }
    + 
    +
    +
    +
    +sendHostAPDUResponse +
    +
    +
    + send host APDU response to CLF (Contactless Front-end). +
    +
    void sendHostAPDUResponse(byte[] apdu, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback);
    +             
    +

    + Since: + 2.3.1 +

    +
    +

    +The ErrorCallback is launched with these error types: +

    +
      +
    • + ServiceNotAvailableError - If the NFC service is not available.
    • +
    • + UnknownError - If any other error occurs.
    • +
    +
    +

    + 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"). +
    If it is not supported, NotSupportedError is thrown. +

    +
    +

    Parameters:

    +
      +
    • +apdu: + The APDU data to send. APDU is defined in the ISO/IEC 7816-4 specification. +
    • +
    • +successCallback [optional] [nullable]: + Invoked when an APDU is successfully sent to the NFC reader. +
    • +
    • +errorCallback [optional] [nullable]: + Invoked in case any error occurs while sending. +
    • +
    +
    +
    +

    Exceptions:

    +
    • WebAPIException
        +
      • + 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:

     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 +
    +
    +
    + Allows an application to query whether an application is currently the activated handler for a specific AID and secure element type. +
    +
    boolean isActivatedHandlerForAID(SecureElementType type, AID aid);
    +             
    +

    + 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"). +
    If it is not supported, NotSupportedError is thrown. +

    +
    +

    Parameters:

    +
      +
    • +type: + The secure element type +
    • +
    • +aid: + Application ID, specified in ISO/IEC 7816-4 +
    • +
    +
    +
    +

    Return value:

    + boolean true if current application is activated handler for the AID +
    +
    +

    Exceptions:

    +
    • WebAPIException
        +
      • + 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:

     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 +
    +
    +
    + Allows an application to query whether an application is currently the activated handler for a specific card emulation category and secure element type. +
    +
    boolean isActivatedHandlerForCategory(SecureElementType type, CardEmulationCategoryType category);
    +             
    +

    + 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"). +
    If it is not supported, NotSupportedError is thrown. +

    +
    +

    Parameters:

    +
      +
    • +type: + The secure element type +
    • +
    • +category: + The card emulation category type +
    • +
    +
    +
    +

    Return value:

    + boolean true if current application is activated handler for the category +
    +
    +

    Exceptions:

    +
    • WebAPIException
        +
      • + 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:

     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 +
    +
    +
    + Registers an AID for a specific category and secure element type. +
    +
    void registerAID(SecureElementType type, AID aid, CardEmulationCategoryType category);
    +             
    +

    + 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"). +
    If it is not supported, NotSupportedError is thrown. +

    +
    +

    Parameters:

    +
      +
    • +type: + The secure element type +
    • +
    • +aid: + Application Id, specified in ISO/IEC 7816-4 +
    • +
    • +category: + The card emulation category type
    @@ -1388,10 +2043,13 @@ Such an event may indicate initiating a financial transaction using the device.

    Exceptions:

    • WebAPIException
      • + 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:

         try {
        -   adapter.removeActiveSecureElementChangeListener(listenerId) ;
        +
        +   var aid = "ABC0012345";
        +   adapter.registerAID("HCE", aid, "PAYMENT") ;
          } catch (err) {
            console.log(err.name + ": " + err.message);
          }
          
    -
    -getCachedMessage +
    +unregisterAID
    - Gets the NDEF message cached when the tag is detected. + Unregisters an AID that was previously registered for a specific card emulation category and secure element type. An application can only remove the AIDs which it registered.
    -
    NDEFMessage? getCachedMessage();
    +
    void unregisterAID(SecureElementType type, AID aid, CardEmulationCategoryType category);
                  

    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:

    - NDEFMessage The NDEF Message that was last read. -
    +

    Remark : + To check if NFC HCE is supported on this device, use tizen.systeminfo.getCapability("http://tizen.org/feature/network.nfc.card_emulation.hce"). +
    If it is not supported, NotSupportedError is thrown. +

    +
    +

    Parameters:

    +
      +
    • +type: + The secure element type +
    • +
    • +aid: + Application Id, specified in ISO/IEC 7816-4 +
    • +
    • +category: + The card emulation category type +
    • +
    +

    Exceptions:

    • WebAPIException
      • + 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:

     // Gets the cached message
    - var cachedMessage = tizen.nfc.getDefaultAdapter().getCachedMessage();
    +

    Code example:

     try {
    +
    +   var aid = "ABC0012345";
    +   adapter.unregisterAID("HCE", aid, "PAYMENT") ;
    + } catch (err) {
    +   console.log(err.name + ": " + err.message);
    + }
      
    -
    -setExclusiveModeForTransaction +
    +getAIDsForCategory
    - Gives priority to the current application for NFC transaction events. + Retrieves AIDs that were previously registered for a specific card emulation category and secure element type. An application can only retrieve the AIDs which it registered.
    -
    void setExclusiveModeForTransaction(boolean mode);
    +
    void getAIDsForCategory(SecureElementType type, CardEmulationCategoryType category, AIDArraySuccessCallback successCallback, optional ErrorCallback? errorCallback);
                  

    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:

    +
      +
    • + ServiceNotAvailableError - If the NFC service is not available.
    • +
    • + UnknownError - If any other error occurs.
    • +

    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"). +
    If it is not supported, NotSupportedError is thrown. +

    Parameters:

    • -mode: - Value of the exclusive mode +type: + The secure element type +
    • +
    • +category: + The card emulation category type +
    • +
    • +successCallback: + Invoked when the AIDs are retrieved successfully. +
    • +
    • +errorCallback [optional] [nullable]: + Invoked in case any error occurs while retrieving.
    @@ -1504,28 +2200,17 @@ Losing priority is always allowed regardless of an application's status.

    Exceptions:

    • WebAPIException
      • - 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:

     try {
    -   adapter.setExclusiveModeForTransaction(true) ;
    - } catch (err) {
    -   console.log(err.name + ": " + err.message);
    - }
    - 
    -
    @@ -2419,8 +3104,113 @@ The byte array contains 0 to (2 ** 32 - 1) bytes. +
    +

    2.11. HCEEventData

    +
    + The HCEEventData interface represents HCE event data. +
    +
      [NoInterfaceObject] interface  HCEEventData {
    +   readonly attribute HCEEventType eventType;
    +
    +   readonly attribute byte[] apdu;
    +
    +   readonly attribute long length;
    +  };
    +

    + Since: + 2.3.1 +

    +
    +

    Attributes

    +
      +
    • + readonly +HCEEventType eventType
      + HCE event type. +
      +

      + Since: + 2.3.1 +

      +
    • +
    • + readonly +byte[] + apdu
      + The bytes array of APDU +
      +

      + Since: + 2.3.1 +

      +
    • +
    • + readonly +long length
      + The length of APDU +
      +

      + Since: + 2.3.1 +

      +
    • +
    +
    +
    +
    +

    2.12. AIDData

    +
    + The AID data interface represents registerd AID data +
    +
      [NoInterfaceObject] interface  AIDData{
    +   readonly attribute SecureElementType type;
    +
    +   readonly attribute AID aid;
    +
    +   readonly attribute boolean  readOnly;
    +  };
    +

    + Since: + 2.3.1 +

    +
    +

    Attributes

    +
      +
    • + readonly +SecureElementType type
      + Secure Element type. +
      +

      + Since: + 2.3.1 +

      +
    • +
    • + readonly +AID aid
      + The AID (Application ID) data, specified in ISO/IEC 7816-4 +
      +

      + Since: + 2.3.1 +

      +
    • +
    • + readonly +boolean readOnly
      + An attribute to indicate whether the registered AID is read-only or not +
      +

      + Since: + 2.3.1 +

      +
    • +
    +
    +
    -

    2.11. NFCTagDetectCallback

    +

    2.13. NFCTagDetectCallback

    The NFCTagDetectCallback interface specifies a success callback to be invoked when an NFC tag is detected or lost.
    @@ -2490,7 +3280,7 @@ It is used in NFCAdapter.setTagListener().
    -

    2.12. NFCPeerDetectCallback

    +

    2.14. NFCPeerDetectCallback

    The NFCPeerDetectCallback interface specifies a success callback to be invoked when an NFC peer-to-peer target is detected or lost.
    @@ -2560,7 +3350,7 @@ It is used in NFCAdapter.setPeerListener().
    -

    2.13. NDEFMessageReadCallback

    +

    2.15. NDEFMessageReadCallback

    The NDEFMessageReadCallback interface specifies a success callback to be invoked when data has been read successfully from the NFC tag or target.
    @@ -2609,7 +3399,7 @@ operations, such as NFCTag.readNDEF() or NFCPeer.setReceiveNDEFListener().
    -

    2.14. ByteArraySuccessCallback

    +

    2.16. ByteArraySuccessCallback

    The ByteArraySuccessCallback interface specifies a success callback to be invoked when NFCTag.transceive() completes successfully.
    @@ -2656,7 +3446,7 @@ raw data as an input parameter. It is used in NFCTag.transceive().
    -

    2.15. CardEmulationModeChangeCallback

    +

    2.17. CardEmulationModeChangeCallback

    The CardEmulationModeChangeCallback interface specifies a success callback to be invoked when the card emulation mode is changed.
    @@ -2697,7 +3487,7 @@ raw data as an input parameter. It is used in NFCTag.transceive().
    -

    2.16. TransactionEventCallback

    +

    2.18. TransactionEventCallback

    The TransactionEventCallback interface specifies a success callback to be invoked when an external reader tries to access a secure element.
    @@ -2742,7 +3532,7 @@ raw data as an input parameter. It is used in NFCTag.transceive().
    -

    2.17. ActiveSecureElementChangeCallback

    +

    2.19. ActiveSecureElementChangeCallback

    The ActiveSecureElementChangeCallback interface specifies a success callback to be invoked when an active secure element is changed.
    @@ -2782,6 +3572,88 @@ raw data as an input parameter. It is used in NFCTag.transceive().
    +
    +

    2.20. HCEEventReceiveCallback

    +
    + The HCEEventReceiveCallback interface specifies a success callback to be invoked when an HCE event is detected. +
    +
    [Callback=FunctionOnly, NoInterfaceObject] interface HCEEventReceiveCallback {
    +  void ondetected(HCEEventData data);
    +};
    +

    + Since: + 2.3.1 +

    +
    +

    Methods

    +
    +
    +ondetected +
    +
    +
    + Called when HCE event is detected. +
    +
    void ondetected(HCEEventData data);
    +             
    +

    + Since: + 2.3.1 +

    +
    +

    Parameters:

    +
      +
    • +data: + HCE event data +
    • +
    +
    +
    +
    +
    +
    +
    +

    2.21. AIDArraySuccessCallback

    +
    + The AIDArraySuccessCallback interface specifies a success callback to be invoked when an NFCAdaptor.getAIDsForCategory() completes successfully. +
    +
    [Callback=FunctionOnly, NoInterfaceObject] interface AIDArraySuccessCallback {
    +  void onsuccess(AIDData[] aids);
    +};
    +

    + Since: + 2.3.1 +

    +
    +

    Methods

    +
    +
    +onsuccess +
    +
    +
    + The method invoked when the asynchronous call completes successfully. +
    +
    void onsuccess(AIDData[] aids);
    +             
    +

    + Since: + 2.3.1 +

    +
    +

    Parameters:

    +
      +
    • +aids: + The list of AIDs +
    • +
    +
    +
    +
    +
    +

    3. Related Feature

    @@ -2802,6 +3674,14 @@ To guarantee that the NFC card emulation application runs on a device with the N

  • http://tizen.org/feature/network.nfc.card_emulation
  • +
    +

    +

    +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: +

    +

    +
  • http://tizen.org/feature/network.nfc.card_emulation.hce
  • +

    For more information, see Application Filtering. @@ -2816,7 +3696,13 @@ To guarantee that the NFC card emulation application runs on a device with the N enum CardEmulationMode { "ALWAYS_ON", "OFF" }; - enum SecureElementType { "ESE", "UICC" }; + enum SecureElementType { "ESE", "UICC", "HCE" }; + + enum CardEmulationCategoryType { "PAYMENT", "OTHER" }; + + enum HCEEventType { "DEACTIVATED", "ACTIVATED", "APDU_RECEIVED" }; + + typedef DOMString AID; [NoInterfaceObject] interface NFCManagerObject { readonly attribute NFCManager nfc; @@ -2875,6 +3761,22 @@ To guarantee that the NFC card emulation application runs on a device with the N 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); + }; @@ -2957,6 +3859,21 @@ To guarantee that the NFC card emulation application runs on a device with the N readonly attribute DOMString mimeType; }; + [NoInterfaceObject] interface HCEEventData { + readonly attribute HCEEventType eventType; + + readonly attribute byte[] apdu; + + readonly attribute long length; + }; + + [NoInterfaceObject] interface AIDData{ + readonly attribute SecureElementType type; + + readonly attribute AID aid; + + readonly attribute boolean readOnly; + }; [Callback, NoInterfaceObject] interface NFCTagDetectCallback { void onattach(NFCTag nfcTag); @@ -2989,6 +3906,14 @@ To guarantee that the NFC card emulation application runs on a device with the N void onchanged(SecureElementType type); }; +[Callback=FunctionOnly, NoInterfaceObject] interface HCEEventReceiveCallback { + void ondetected(HCEEventData data); +}; + +[Callback=FunctionOnly, NoInterfaceObject] interface AIDArraySuccessCallback { + void onsuccess(AIDData[] aids); +}; + }; -
        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

  • ULTRAVIOLET - Ultraviolet sensor
  • +
  • +HRM_RAW - HRM sensor
  • +

    Remark : + HRM_RAW is supported since Tizen 2.3.1 +

    1.2. ProximityState

    @@ -273,8 +290,21 @@ The supported sensor types are hardware-dependent.

    To check if the given PROXIMITY - tizen.systeminfo.getCapability("http://tizen.org/feature/sensor.proximity")
  • ULTRAVIOLET - tizen.systeminfo.getCapability("http://tizen.org/feature/sensor.ultraviolet")
  • +
  • + HRM_RAW - tizen.systeminfo.getCapability("http://tizen.org/feature/sensor.heart_rate_monitor")
  • +

    + 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:

      @@ -300,6 +330,9 @@ The supported sensor types are hardware-dependent.

      To check if the given
    • 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. +

    @@ -1009,8 +1042,113 @@ The ErrorCallback method is launched with these error types: +
    +

    2.9. HRMRawSensor

    +
    + The HRMRawSensor interface provides methods to access HRM sensor raw data. +
    +
        [NoInterfaceObject] interface HRMRawSensor : Sensor {
    +
    +        void getHRMRawSensorData(SensorDataSuccessCallback successCallback,
    +                                optional ErrorCallback? errorCallback) raises(WebAPIException);
    +    };
    +

    + Since: + 2.3.1 +

    + +
    +

    Methods

    +
    +
    +getHRMRawSensorData +
    +
    +
    + Gets the current sensor data. +
    +
    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: +

    +
      +
    • + ServiceNotAvailableError : If the getHRMRawSensorData method is called without calling the start method.
    • +
    • + UnknownError : An unknown error has occurred.
    • +
    +
    +

    + Privilege level: + public +

    +

    + Privilege: + http://tizen.org/privilege/healthinfo +

    +
    +

    Parameters:

    +
      +
    • +successCallback: + Callback method to be invoked when the sensor data has been read +
    • +
    • +errorCallback [optional] [nullable]: + Callback method to be invoked when an error occurs +
    • +
    +
    +
    +

    Exceptions:

    +
    • WebAPIException
        +
      • + 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);
    +
    + 
    +
    +
    +
    +
    +
    -

    2.9. SensorData

    +

    2.10. SensorData

    The SensorData interface is a common abstract interface used by different types of sensor data objects.
    @@ -1022,7 +1160,7 @@ The ErrorCallback method is launched with these error types:

    -

    2.10. SensorLightData

    +

    2.11. SensorLightData

    The SensorLightData interface represents light sensor data.
    @@ -1050,7 +1188,7 @@ The ErrorCallback method is launched with these error types:
    -

    2.11. SensorMagneticData

    +

    2.12. SensorMagneticData

    The SensorMagneticData interface represents magnetic sensor data.
    @@ -1121,7 +1259,7 @@ For increasing the accuracy, wave the device around in the air in figure-eight p
    -

    2.12. SensorPressureData

    +

    2.13. SensorPressureData

    The SensorPressureData interface represents pressure sensor data.
    @@ -1149,7 +1287,7 @@ For increasing the accuracy, wave the device around in the air in figure-eight p
    -

    2.13. SensorProximityData

    +

    2.14. SensorProximityData

    The SensorProximityData interface represents proximity sensor data.
    @@ -1177,7 +1315,7 @@ For increasing the accuracy, wave the device around in the air in figure-eight p
    -

    2.14. SensorUltravioletData

    +

    2.15. SensorUltravioletData

    The SensorUltravioletData interface represents ultraviolet sensor data.
    @@ -1209,8 +1347,63 @@ The ultraviolet index is an international standard measurement of the strength o
    +
    +

    2.16. SensorHRMRawData

    +
    + The SensorHRMRawData interface represents HRM sensor raw data. +
    +
        [NoInterfaceObject] interface SensorHRMRawData : SensorData {
    +
    +        readonly attribute DOMString lightType;
    +
    +        readonly attribute unsigned long lightIntensity;
    +    };
    +

    + Since: + 2.3.1 +

    + +
    +

    Attributes

    +
      +
    • + readonly +DOMString lightType
      + HRM sensor light type. +
      +
      +

      +The following values are supported: +

      +
        +
      • +LED_IR - The infrared spectrum
      • +
      • +LED_RED - The red light spectrum
      • +
      • +LED_GREEN - The green light spectrum
      • +
      +
      +

      + Since: + 2.3.1 +

      +
    • +
    • + readonly +unsigned long lightIntensity
      + HRM sensor light intensity measures the light intensity that is reflected from a blood vessel. The changes in the reported value represent blood volume changes in the microvascular bed of the tissue, and can be used to estimate heart rate. +
      +

      + Since: + 2.3.1 +

      +
    • +
    +
    +
    -

    2.15. SensorDataSuccessCallback

    +

    2.17. SensorDataSuccessCallback

    The SensorDataSuccessCallback interface is a callback interface that is invoked when the sensor data has changed. For example, see the Sensor interface.
    @@ -1294,13 +1487,21 @@ To guarantee that the UV sensor application runs on a device with a UV sensor, d

  • http://tizen.org/feature/sensor.ultraviolet
  • +
    +

    +

    +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: +

    +

    +
  • http://tizen.org/feature/sensor.heart_rate_monitor
  • +

    For more information, see Application Filtering.

    4. Full WebIDL

    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
  • @@ -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 SoundVolumeChangeCallback void 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 +
    +
    +
    + Gets a list of connected sound devices. +
    +
    SoundDeviceInfo[] getConnectedDeviceList();
    +             
    +

    + Since: + 2.3.1 +

    +
    +

    Return value:

    + The list of connected sound devices +
    +
    +

    Exceptions:

    +
    • WebAPIException
      • + 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 +
    +
    +
    + Gets a list of activated sound devices. +
    +
    SoundDeviceInfo[] getActivatedDeviceList();
    +             
    +

    + Since: + 2.3.1 +

    +
    +

    Return value:

    + The list of activated sound devices +
    +
    +

    Exceptions:

    +
    • WebAPIException
      • + 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 +
    +
    +
    + Registers a listener that is to be called when the sound device state is changed. +
    +
    long addDeviceStateChangeListener(SoundDeviceStateChangeCallback callback);
    +             
    +

    + Since: + 2.3.1 +

    +
    +

    +There are two types of device state changes: +

    +
      +
    • +Connectivity: When a device changes from being connected to being disconnected or from being disconnected to being connected.
    • +
    • +Activation: When a device chages from being activated to being deactivated or from being deactivated to being activated.
    • +
    +
    +
    +

    Parameters:

    +
      +
    • +callback: + Callback method to be invoked when the sound device state is changed +
    • +
    +
    +
    +

    Return value:

    + long ID of the listener that can be used to remove the listener later. +
    +
    +

    Exceptions:

    +
    • WebAPIException
        +
      • + 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 +
    +
    +
    + Unsubscribes from receiving notifications when the sound device state is changed. +
    +
    void removeDeviceStateChangeListener(long id);
    +             
    +

    + Since: + 2.3.1 +

    +
    +

    Parameters:

    +
      +
    • +id: + An ID that identifies the listener +
    • +
    +
    +
    +

    Exceptions:

    +
    • WebAPIException
      • + with error type UnknownError in any error case. +

      +
    +
    +
    +

    Code example:

     // If a listener to be called was registered previously.
    + tizen.sound.removeDeviceStateChangeListener(id);
    + 
    +
    +
    +
    +

    2.3. SoundDeviceInfo

    +
    + The SoundDeviceInfo interface specifies the information about a sound device. +
    +
        [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 +

    +
    +

    Attributes

    +
      +
    • + readonly +long id
      + The sound device ID +
      +

      + Since: + 2.3.1 +

      +
    • +
    • + readonly +DOMString name
      + The sound device name +
      +

      + Since: + 2.3.1 +

      +
    • +
    • + readonly +SoundDeviceType device
      + The sound device type +
      +

      + Since: + 2.3.1 +

      +
    • +
    • + readonly +SoundIOType direction
      + The sound device I/O type +
      +

      + Since: + 2.3.1 +

      +
    • +
    • + readonly +boolean isConnected
      + True if the sound device state is connected +
      +

      + Since: + 2.3.1 +

      +
    • +
    • + readonly +boolean isActivated
      + True if the sound device state is activated +
      +

      + Since: + 2.3.1 +

      +
    • +
    +
    +
    -

    2.3. SoundModeChangeCallback

    +

    2.4. SoundModeChangeCallback

    The SoundModeChangeCallback interface specifies a mode change callback for getting notified about the sound mode changes.
    -
        [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

    -

    2.4. SoundVolumeChangeCallback

    +

    2.5. SoundVolumeChangeCallback

    The SoundVolumeChangeCallback interface specifies a volume change callback for getting notified about the volume changes.
    -
        [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

    +
    +

    2.6. SoundDeviceStateChangeCallback

    +
    + The SoundDeviceStateChangeCallback interface specifies a sound device type change callback for getting notified when the sound device state changes. +
    +
        [Callback=FunctionOnly, NoInterfaceObject] interface SoundDeviceStateChangeCallback {
    +
    +        void onchanged(SoundDeviceInfo info);
    +    };
    +

    + Since: + 2.3.1 +

    +
    +

    Methods

    +
    +
    +onchanged +
    +
    +
    + Method invoked when the sound device state changes. +
    +
    void onchanged(SoundDeviceInfo info);
    +             
    +

    + Since: + 2.3.1 +

    +
    +

    Parameters:

    +
      +
    • +info: + The info to have changed +
    • +
    +
    +
    +
    +
    +

    3. Full WebIDL

    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);
    +    };
     };

    1.2. SystemInfoNetworkType

    @@ -863,7 +874,7 @@ NotSupportedError - If the given property is not supported. (since Ti
  • options [optional] [nullable]: - An object containing the various options for fetching the properties requested. See details. + An object containing the various options for fetching the properties requested. See details.
  • errorCallback [optional] [nullable]: @@ -3130,6 +3141,181 @@ identify a mobile phone operator/carrier using the GSM, CDMA, iDEN, TETRA and UM
  • +
    +

    2.22. SystemInfoCameraFlash

    +
    + The SystemInfoCameraFlash provides the way to control the attached the camera flash. +
    +
      [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);
    +  };
    + +
    +

    Attributes

    +
      +
    • + readonly +double brightness
      + Brightness level of the camera flash (0~1) +
      +

      + Since: + 2.4 +

      +

      + Privilege level: + public +

      +

      + Privilege: + http://tizen.org/privilege/led +

      +
      +

      Exceptions:

      +
      • WebAPIException
        • + 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);
      +    }
      + );
      + 
      +
      +
    • +
    • + readonly +DOMString camera
      + Specifies camera to which this flash belongs +
      +
      +
        +
      • +BACK - back camera flash
      • +
      • +FRONT - front camera flash
      • +
      • +EXTERNAL - external camera flash
      • +
      • +OTHER - a flash attached to any other camera
      • +
      +
      +
      +

      +The getPropertyValue() method retrieves the SystemInfoCameraFlash for BACK camera. +

      +
      +

      + Since: + 2.4 +

      +
    • +
    • + readonly +long levels
      + Number of brightness levels supported by the flash (other than 0 brightness) +
      +

      + Since: + 2.4 +

      +

      + Privilege level: + public +

      +

      + Privilege: + http://tizen.org/privilege/led +

      +
      +

      Exceptions:

      +
      • WebAPIException
        • + with error type SecurityError, if this attribute is not allowed. +

        +
      +
      +
    • +
    +
    +
    +

    Methods

    +
    +
    +setBrightness +
    +
    +
    + Sets the brightness value of the flash that is located next to the camera. +
    +
    void setBrightness(double brightness);
    +             
    +

    + Since: + 2.4 +

    +

    + Privilege level: + public +

    +

    + Privilege: + http://tizen.org/privilege/led +

    +
    +

    Parameters:

    +
      +
    • +brightness: + The brightness value of LED (0~1) +
    • +
    +
    +
    +

    Exceptions:

    +
    • WebAPIException
        +
      • + 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);
    +    }
    + );
    + 
    +
    +
    +
    +
    +

    3. Related Feature

    @@ -3156,7 +3342,7 @@ To guarantee the running of this application on a device which supports telephon

    4. Full WebIDL

    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:

    -
    • WebAPIException
        -
      • +

        • WebAPIException
          • 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. -

          • -
          +