static void onButtonPressed(const char *signal, Evas_Object *button, void *eventInfo);
static Eina_Bool onButtonActivated(Evas_Object *button, Evas_Object *obj,
Elm_Access_Action_Info *accessInfo);
+ static Eina_Bool onFeedbackTimer(void *data);
Evas_Object *m_DismissButton;
Evas_Object *m_SnoozeButton;
Ecore_Timer *m_Timer;
player_h m_Player;
+ Ecore_Timer *m_FeedbackTimer;
Common::Model::Alarm m_Alarm;
};
}
class OperationAlertController : public App::OperationController
{
+public:
+ virtual ~OperationAlertController() override;
private:
+ virtual void onCreate() override;
virtual void onRequest(const char *operation, app_control_h request) override;
};
#include "Utils/Logger.h"
#include "AlertLayout.h"
+#include <feedback.h>
+
#define SNOOZE_MAX_COUNT 3
#define ALERT_MAX_TIME 60
+#define FEEDBACK_TIME 1.0
#define DEFAULT_SOUND_PATH "/opt/share/settings/Alarms/Alarms_on_call.ogg"
using namespace Alert;
AlertView::AlertView(Common::Model::Alarm alarm)
: m_DismissButton(nullptr), m_SnoozeButton(nullptr),
- m_Timer(nullptr), m_Player(createPlayer()),
+ m_Timer(nullptr), m_Player(createPlayer()), m_FeedbackTimer(nullptr),
m_Alarm(std::move(alarm))
{
}
COLOR_BUTTON_SNOOZE, 0);
m_Timer = ecore_timer_add(ALERT_MAX_TIME, makeCallback(&AlertView::onCancel), this);
+
return layout;
}
if (isCurrent) {
player_start(m_Player);
+ m_FeedbackTimer = ecore_timer_add(FEEDBACK_TIME, onFeedbackTimer, this);
} else {
player_stop(m_Player);
+ ecore_timer_del(m_FeedbackTimer);
+ m_FeedbackTimer = nullptr;;
if (!elm_win_focus_get(findParent<Ui::Window>()->getEvasObject())) {
onCancel();
}
elm_layout_signal_emit(button, SIGNAL_BUTTON_PRESS, "");
return EINA_TRUE;
}
+
+Eina_Bool AlertView::onFeedbackTimer(void *data)
+{
+ feedback_play(FEEDBACK_PATTERN_WAKEUP);
+ return ECORE_CALLBACK_RENEW;
+}
#include "App/AppControlUtils.h"
#include "Ui/Navigator.h"
+#include "Ui/Window.h"
+
+#include <efl_util.h>
+#include <feedback.h>
using namespace Common::Model;
+OperationAlertController::~OperationAlertController()
+{
+ efl_util_set_window_screen_mode(getWindow()->getEvasObject(), EFL_UTIL_SCREEN_MODE_DEFAULT);
+ feedback_deinitialize();
+}
+
+void OperationAlertController::onCreate()
+{
+ feedback_initialize();
+ efl_util_set_window_screen_mode(getWindow()->getEvasObject(), EFL_UTIL_SCREEN_MODE_ALWAYS_ON);
+}
+
void OperationAlertController::onRequest(const char *operation, app_control_h request)
{
int id = App::getIntExtraData(request, APP_CONTROL_DATA_ID);
</ui-application>
<privileges>
<privilege>http://tizen.org/privilege/datasharing</privilege>
+ <privilege>http://tizen.org/privilege/haptic</privilege>
+ <privilege>http://tizen.org/privilege/display</privilege>
</privileges>
</manifest>