/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd
*
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://floralicense.org/license/
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
#include <service_app.h>
#include <system_settings.h>
#include <Elementary.h>
+#include <dlog.h>
#include "$(appName).h"
#include "data.h"
-/*
- * @brief Hook to take necessary actions before main event loop starts
+/**
+ * @brief Hook to take necessary actions before main event loop starts.
* Initialize the service's data.
* If this function returns true, the main loop of the sertvice starts.
* If this function returns false, the service is terminated.
*/
-static bool app_create(void *user_data)
+static bool srv_create(void *user_data)
{
return true;
}
-/*
- * @brief This callback function is called when another application
+/**
+ * @brief This callback function is called when another application.
* sends the launch request to the service.
*/
-static void app_control(app_control_h app_control, void *user_data)
+static void srv_control(app_control_h app_control, void *user_data)
{
/* Handle the launch request. */
}
-/*
- * @brief This callback function is called once after the main loop
+/**
+ * @brief This callback function is called once after the main loop.
* of the service exits.
*/
-static void app_terminate(void *user_data)
+static void srv_terminate(void *user_data)
{
/* Release all resources. */
}
-/*
- * @brief This function will be called when the language is changed.
- */
-static void service_lang_changed(app_event_info_h event_info, void *user_data)
-{
- char *locale = NULL;
-
- system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &locale);
-
- if (locale != NULL) {
- elm_language_set(locale);
- free(locale);
- }
- return;
-}
-
-/*
+/**
* @brief Main function of the service.
*/
int main(int argc, char *argv[])
service_app_lifecycle_callback_s event_callback = {0, };
app_event_handler_h handlers[5] = {NULL, };
- event_callback.create = app_create;
- event_callback.terminate = app_terminate;
- event_callback.app_control = app_control;
+ event_callback.create = srv_create;
+ event_callback.terminate = srv_terminate;
+ event_callback.app_control = srv_control;
/*
* If you want to handling more events,
- * Please check the service's lifecycle guide.
+ * please check the service's lifecycle guide.
*/
service_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, service_lang_changed, NULL);