+static Eina_Bool app_restart_timer_func(void *user_data)
+{
+ CServicePlugin *plugin = static_cast<CServicePlugin*>(user_data);
+ if (plugin) {
+ CServiceMain* service_main = plugin->get_service_main();
+ if (service_main) {
+ ma_service_state_e service_state = service_main->get_current_service_state();
+ if (service_state != MA_SERVICE_STATE_UTTERANCE) {
+ MAS_LOGE("[SUCCESS] Restarting service");
+ service_main->app_restart();
+ }
+ }
+ }
+
+ return ECORE_CALLBACK_RENEW;
+}
+
+void CServicePlugin::stop_app_restart_timer()
+{
+ if (mAppRestartTimer) {
+ ecore_timer_del(mAppRestartTimer);
+ mAppRestartTimer = nullptr;
+ }
+}
+
+void CServicePlugin::start_app_restart_timer()
+{
+ stop_app_restart_timer();
+ mAppRestartTimer = ecore_timer_add(1.0f, app_restart_timer_func, this);
+}
+