From: Taeyoung Kim Date: Fri, 19 Feb 2016 08:38:52 +0000 (+0900) Subject: [device] update tutorial for privilege information X-Git-Tag: tizen_3.0/TD_SYNC/20161201~164 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e75ed894d25e2c13dc2949cac2e688cd4d722364;p=sdk%2Fonline-doc.git [device] update tutorial for privilege information - Privileges are necessary to use device apis. Thus tutorial is updated to notice the privilege information. Change-Id: Iacacd15e2ce4363cf4ceec0cca1cb502eff5c266 Signed-off-by: Taeyoung Kim --- diff --git a/org.tizen.tutorials/html/native/system/device_tutorial_n.htm b/org.tizen.tutorials/html/native/system/device_tutorial_n.htm index f9306df..b5d8bcc 100644 --- a/org.tizen.tutorials/html/native/system/device_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/system/device_tutorial_n.htm @@ -121,7 +121,8 @@ error = device_battery_get_level_status(&level);
  • To retrieve and set display properties:
      -
    • Get the number of display devices with the device_display_get_numbers() function: +
    • Get the number of display devices with the device_display_get_numbers() function. +

      The function requires the http://tizen.org/privilege/display privilege.

       int error, num;
       error = device_display_get_numbers(&num);
      @@ -130,6 +131,7 @@ error = device_display_get_numbers(&num);
       		
       		
    • Get the maximum brightness with the device_display_get_max_brightness() function.

      The function returns the maximum brightness value that can be set.

      +

      The function requires the http://tizen.org/privilege/display privilege.

       int error, max;
      @@ -137,7 +139,8 @@ error = device_display_get_max_brightness(0, &max);
       
    • -
    • Get and set the display brightness with the device_display_get_brightness() and device_display_set_brightness() functions: +
    • Get and set the display brightness with the device_display_get_brightness() and device_display_set_brightness() functions. +

      The functions require the http://tizen.org/privilege/display privilege.

       int error, brt;
      @@ -148,7 +151,8 @@ error = device_display_set_brightness(0, 100);
       		
    • Get and set the display state with the device_display_get_state() and device_display_change_state() functions. -

      The display_state_e enumerator (in mobile and wearable applications) defines the available display states.

      +

      The display_state_e enumerator (in mobile and wearable applications) defines the available display states.

      +

      The device_display_change_state() function requires the http://tizen.org/privilege/display privilege.

       int error;
       display_state_e state;
      @@ -172,6 +176,7 @@ error = device_display_change_state(DISPLAY_STATE_NORMAL);
       
    • Get the number of haptic devices with the device_haptic_get_count() function. +

      The function requires the http://tizen.org/privilege/haptic privilege.

       int error, num;
      @@ -182,6 +187,7 @@ error = device_haptic_get_count(&num);
       
      1. Initialize the haptic device with the device_haptic_open() function.

        The function opens a haptic-vibration device and returns the handle to it. It makes a connection to the vibrator.

        +

        The function requires the http://tizen.org/privilege/haptic privilege.

         int error;
         haptic_device_h handle;
        @@ -191,6 +197,7 @@ error = device_haptic_open(0, &handle);
         
         
      2. Play and stop an effect on the device with the device_haptic_vibrate() and device_haptic_stop() functions.

        The device vibrates during specified time with a constant intensity. The effect handle can be 0.

        +

        The functions require the http://tizen.org/privilege/haptic privilege.

         int error;
         haptic_effect_h effect_handle;
        @@ -202,6 +209,7 @@ error = device_haptic_stop(handle, &effect_handle);
         
         
      3. When no longer needed, uninitialize the haptic device with the device_haptic_close() function.

        The function closes the haptic handle and disconnects the connection to the vibrator.

        +

        The function requires the http://tizen.org/privilege/haptic privilege.

         int error;
        @@ -225,6 +233,7 @@ error = device_haptic_close(0, handle);
         
        • Get the maximum brightness value of a torch LED with the device_flash_get_max_brightness() function.

          The function returns the maximum brightness value of the torch LED located next to the camera.

          +

          The function requires the http://tizen.org/privilege/led privilege.

           int error, max;
           error = device_flash_get_max_brightness(&max);
          @@ -232,6 +241,7 @@ error = device_flash_get_max_brightness(&max);
           
        • Get and set the current brightness value of a torch LED with the device_flash_get_brightness() and device_flash_set_brightness() functions. +

          The functions require the http://tizen.org/privilege/led privilege.

           int error, val;
          @@ -244,6 +254,7 @@ error = device_flash_set_brightness(1);
           
        • Play and stop a custom effect of the service LED with the device_led_play_custom() and device_led_stop_custom() functions.

          The led_custom_flags enumerator (in mobile and wearable applications) defines the available custom effects.

          The custom effect plays on the service LED that is located on the front of the device.

          +

          The functions require the http://tizen.org/privilege/led privilege.

           int error;
          @@ -271,6 +282,7 @@ error = device_led_stop_custom();
           

          The function locks the specific lock type for a specified time. After the given timeout, the lock type is unlocked automatically. If the process is destroyed, every lock is removed.

          The power_lock_e enumerator (in mobile and wearable applications) defines the available lock types.

          +

          The function requires the http://tizen.org/privilege/display privilege.

           int error;
          @@ -280,6 +292,7 @@ error = device_power_request_lock(POWER_LOCK_CPU, 0);
           
           
        • Unlock the power state with the device_power_release_lock() function.

          The function releases the specific lock type locked before.

          +

          The function requires the http://tizen.org/privilege/display privilege.

           int error;
           error = device_power_release_lock(POWER_LOCK_CPU);