haptic: Vibrate on highlighted object change. 43/52943/2
authorKamil Lipiszko <k.lipiszko@samsung.com>
Fri, 27 Nov 2015 14:37:11 +0000 (15:37 +0100)
committerLukasz Stanislawski <l.stanislaws@samsung.com>
Tue, 1 Dec 2015 08:10:14 +0000 (00:10 -0800)
Change-Id: Ic2749bc8520ed85721190ec8a06b4964d5ba5e59
Signed-off-by: Kamil Lipiszko <k.lipiszko@samsung.com>
include/screen_reader_haptic.h
org.tizen.screen-reader.xml
src/navigator.c
src/screen_reader_haptic.c
src/smart_notification.c

index d3f9beb..6bc6dcf 100644 (file)
@@ -1,4 +1,4 @@
 void haptic_module_init(void);
 void haptic_module_disconnect(void);
-void haptic_vibrate_start(void);
+void haptic_vibrate_start(int duration, int feedback);
 void haptic_vibrate_stop(void);
index 99284a4..bc7e0a6 100755 (executable)
@@ -10,5 +10,8 @@
                     <operation name="http://tizen.org/appcontrol/operation/read_screen"/>
                 </app-control>
         </ui-application>
+       <privileges>
+               <privilege>http://tizen.org/privilege/haptic</privilege>
+       </privileges>
 </manifest>
 
index b5b9e66..014260a 100644 (file)
@@ -48,6 +48,9 @@
 #define TTS_MAX_TEXT_SIZE  2000
 #define GESTURE_LIMIT 10
 
+#define HAPTIC_VIBRATE_DURATION 50
+#define HAPTIC_VIBRATE_INTENSITY 50
+
 //Timeout in ms which will be used as interval for handling ongoing
 //hoved gesture updates. It is introduced to improve performance.
 //Even if user makes many mouse move events within hover gesture
@@ -1634,6 +1637,9 @@ static void _new_highlighted_obj_changed(AtspiAccessible * new_highlighted_obj,
        if (context && flat_navi_context_current_get(context) != new_highlighted_obj) {
                flat_navi_context_current_set(context, g_object_ref(new_highlighted_obj));
        }
+
+       haptic_vibrate_start(HAPTIC_VIBRATE_DURATION, HAPTIC_VIBRATE_INTENSITY);
+
 }
 
 void clear(gpointer d)
index f099cb4..028ba0e 100644 (file)
@@ -67,13 +67,13 @@ void haptic_module_disconnect(void)
  * @brief Start vibrations
  *
  */
-void haptic_vibrate_start(void)
+void haptic_vibrate_start(int duration, int feedback)
 {
        if (!handle) {
                ERROR("Haptic handle lost");
                return;
        }
-       if (!device_haptic_vibrate(handle, 1000, 100, &effect_handle)) {
+       if (!device_haptic_vibrate(handle, duration, feedback, &effect_handle)) {
                DEBUG(RED "Vibrations started!" RESET);
        } else {
                ERROR("Cannot start vibration");
index e519797..70b0a16 100644 (file)
@@ -141,7 +141,9 @@ void smart_notification_init(void)
        atspi_event_listener_register(listener, "object:scroll-start", NULL);
        atspi_event_listener_register(listener, "object:scroll-end", NULL);
 
+#ifndef SCREEN_READER_TV
        haptic_module_init();
+#endif
 
        status = EINA_TRUE;
 }
@@ -152,6 +154,9 @@ void smart_notification_init(void)
  */
 void smart_notification_shutdown(void)
 {
+#ifndef SCREEN_READER_TV
+       haptic_module_disconnect();
+#endif
        status = EINA_FALSE;
 }