return rw_mount;
}
+static void process_request(app_control_h app_control, char *request)
+{
+ char* mode = NULL;
+ char* type = NULL;
+
+ if (strcmp(request, "sync") == 0) {
+ bool param_error = false;
+ if (app_control_get_extra_data(app_control, "mode", &mode) != APP_CONTROL_ERROR_NONE) {
+ STLOGE("No given mode");
+ param_error = true;
+ }
+
+ if (app_control_get_extra_data(app_control, "type", &type) != APP_CONTROL_ERROR_NONE) {
+ STLOGE("No given type");
+ param_error = true;
+ }
+
+ STLOGI("[sync request] mode : %s, type : %s", mode, type);
+ if (param_error)
+ goto cleanup;
+
+ if (mode && type) {
+ if (!is_init_sap()) {
+ initialize_sap();
+ request_all_sticker_data(mode, type);
+ }
+ }
+ }
+ else if (strcmp(request, "oobe") == 0) {
+ initialize_sap();
+ request_sticker_feature();
+ }
+ else {
+ STLOGW("Unknown command : %s", request);
+ if (!is_init_sap()) {
+ service_app_exit();
+ }
+ }
+
+cleanup:
+ if (NULL != mode)
+ free(mode);
+
+ if (NULL != type)
+ free(type);
+}
+
static void app_control(app_control_h app_control, void *data)
{
/* Handle the launch request. */
char* request = NULL;
- char* mode = NULL;
- char* type = NULL;
char* operation = NULL;
char* event_value = NULL;
char* uri = NULL;
{
if (string(event_value) == "connected")
{
+ STLOGI("The charger state is connected");
if (!is_init_sap()) {
if (check_sync_time_condition()) {
if (check_battery_condition()) {
request_auto_sync();
}
else {
+ STLOGI("The status of battery is low");
if (!get_job_progress()) {
STLOGD("exit");
service_app_exit();
}
}
else if (strcmp(operation, APP_CONTROL_OPERATION_DEFAULT) == 0) {
- // sync request
res = app_control_get_extra_data(app_control, "request", &request);
+ STLOGD("get extra data result : %d, request : %s", res, request);
if (APP_CONTROL_ERROR_NONE == res && NULL != request) {
- if (strcmp(request, "sync") == 0) {
- bool param_error = false;
- if (app_control_get_extra_data(app_control, "mode", &mode) != APP_CONTROL_ERROR_NONE) {
- STLOGE("No given mode");
- param_error = true;
- }
-
- if (app_control_get_extra_data(app_control, "type", &type) != APP_CONTROL_ERROR_NONE) {
- STLOGE("No given type");
- param_error = true;
- }
-
- STLOGI("[sync request] mode : %s, type : %s", mode, type);
- if (param_error)
- goto cleanup;
-
- if (mode && type) {
- if (!is_init_sap()) {
- initialize_sap();
- request_all_sticker_data(mode, type);
- }
- }
- }
- else if (strcmp(request, "oobe") == 0) {
- initialize_sap();
- request_sticker_feature();
- }
- else {
- STLOGW("Unknown command : %s", request);
- if (!is_init_sap()) {
- service_app_exit();
- }
- }
- } // end of request
+ process_request(app_control, request);
+ }
else {
STLOGD("booting");
#ifdef VCONFKEY_STICKER_SUPPORTED_FEATURE
if (NULL != request)
free(request);
-
- if (NULL != mode)
- free(mode);
-
- if (NULL != type)
- free(type);
}
static void app_terminate(void *data)