.log/
.scap/
.scra-ir/
+.svace-dir/
output/
Build/
#!/bin/bash
+set -o errexit
+trap 'echo "Aborting due to errexit on line $LINENO. Exit code: $?" >&2' ERR
+set -o errtrace
+set -e -o pipefail
ARCH=arm
ROOTSTRAP=iot-headed-5.0-device.core
ROOTSTRAP_PRIVATE=mobile-5.0-device.core.private
REL=Debug
-exit_on_error()
-{
- if [ $1 != 0 ]; then
- echo $2
- exit 1
- fi
-}
-
require_command()
{
- command -v $1 &> /dev/null
- if [ $? != 0 ]; then
+ if [ ! "$(command -v "$1")" ]; then
echo "Command not found: '$1', please install and add executable to your PATH"
exit 1
fi
clean()
{
- cd $1
+ cd "$1"
tizen clean
cd -
}
build()
{
- exit_on_error $?
- tizen build-native -C "$REL" -a "$ARCH" -r "$ROOTSTRAP" -- $1
- exit_on_error $?
+ tizen build-native -C "$REL" -a "$ARCH" -r "$ROOTSTRAP" -- "$1"
}
build_private()
{
- exit_on_error $?
- tizen build-native -C "$REL" -a "$ARCH" -r "$ROOTSTRAP_PRIVATE" -- $1
- exit_on_error $?
+ tizen build-native -C "$REL" -a "$ARCH" -r "$ROOTSTRAP_PRIVATE" -- "$1"
}
package()
{
- tizen package -t tpk -- $1/$REL
- exit_on_error $?
+ tizen package -t tpk -- "$1/$REL"
}
require_command tizen
-
+clean oobe-common
clean oobe-language
clean oobe-country
clean oobe-terms
clean oobe-wifi
clean oobe-setup
+clean oobe-terms-service
+clean oobe-easy-setup
+build_private oobe-common
build_private oobe-language
build_private oobe-country
-build_private oobe-easy-setup
build_private oobe-terms
build_private oobe-wifi
build_private oobe-setup
+build_private oobe-terms-service
+build_private oobe-easy-setup
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (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
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __ALARM_H__
+#define __ALARM_H__
+
+void alarm_schedule(int period_seconds, const char* app_id, const char* extra_data);
+
+#endif /* __ALARM_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (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
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __HTTP_GET_H__
+#define __HTTP_GET_H__
+#include <stdbool.h>
+
+int http_get_text(const char *url, char **response);
+
+#endif /* __HTTP_GET_H__ */
#ifndef __OOBE_COMMON_H__
#define __OOBE_COMMON_H__
-#include "utils.h"
+#include "http-get.h"
+#include "log.h"
+#include "terms_data.h"
+#include "terms.h"
#include "utils_view.h"
-#include <stdbool.h>
+#include "utils.h"
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "oobe-common"
#ifdef __cplusplus
extern "C" {
#ifdef __cplusplus
}
#endif
-#endif // __OOBE_COMMON_H__
\ No newline at end of file
+#endif // __OOBE_COMMON_H__
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (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
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __OOBE_H__
+#define __OOBE_H__
+
+#include <stdbool.h>
+
+#ifdef __cplusplus
+extern C {
+#endif
+
+void oobe_set_done();
+bool oobe_get_done();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __OOBE_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (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
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __TERMS_H__
+#define __TERMS_H__
+#include <stdbool.h>
+
+#ifdef __cplusplus
+extern C {
+#endif
+
+// moved from oobe-terms
+bool terms_latest_exist(void);
+void terms_latest_init(void);
+
+bool terms_accept(int version);
+
+// common
+int terms_get_latest_version();
+
+// moved from oobe-terms-service
+void terms_read_server_url(void);
+
+int terms_get_accepted_version();
+int terms_get_pooling_interval();
+
+void terms_download_latest(int version);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __TERMS_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (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
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __TERMS_DATA_H__
+#define __TERMS_DATA_H__
+#include <stdbool.h>
+
+#define LATEST_TERMS_JSON_FILENAME "latest_terms.json"
+#define ACCEPTED_TERMS_JSON_FILENAME "accepted_terms.json"
+
+struct term {
+ const char *title;
+ bool is_required;
+ bool is_accepted;
+ const char *content;
+};
+
+struct terms_data {
+ int latest_version;
+ int check_interval;
+ const char *language;
+ const char *region;
+ int terms_count;
+ struct term *terms;
+};
+
+struct terms_data* terms_data_create_from_file(const char *file_name);
+struct terms_data* terms_data_create_from_text(const char *json);
+void terms_data_destroy(struct terms_data* terms);
+
+#endif /* __DATA_H__ */
type = staticLib
profile = iot-headed-5.0
-USER_SRCS = src/oobe-common.c
+USER_SRCS = src/*.c
USER_DEFS =
USER_INC_DIRS = inc
USER_OBJS =
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (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
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "log.h"
+#include "oobe-common.h"
+#include <app_alarm.h>
+
+void alarm_schedule(int period_seconds, const char* app_id, const char* extra_data)
+{
+ struct tm date;
+ app_control_h app_control = NULL;
+ int alarm_id = -1;
+
+ int ret = app_control_create(&app_control);
+ if (ret != ALARM_ERROR_NONE) {
+ LOGE("app_control_create [%d: %s]", ret, get_error_message(ret));
+ return;
+ }
+
+ ret = app_control_set_operation(app_control, APP_CONTROL_OPERATION_DEFAULT);
+ if (ret != ALARM_ERROR_NONE) {
+ LOGE("app_control_set_operation [%d: %s]", ret, get_error_message(ret));
+ return;
+ }
+
+ ret = app_control_set_app_id(app_control, app_id);
+ if (ret != ALARM_ERROR_NONE) {
+ LOGE("app_control_set_app_id [%d: %s]", ret, get_error_message(ret));
+ return;
+ }
+
+ ret = alarm_get_current_time(&date);
+ date.tm_sec += period_seconds;
+ if (ret != ALARM_ERROR_NONE) {
+ LOGE("alarm_get_current_time [%d: %s]", ret, get_error_message(ret));
+ return;
+ }
+
+ ret = alarm_schedule_once_at_date(app_control, &date, &alarm_id);
+ if (ret != ALARM_ERROR_NONE) {
+ LOGE("alarm_schedule_once_at_date [%d: %s]", ret, get_error_message(ret));
+ return;
+ }
+
+ ret = alarm_get_scheduled_date(alarm_id, &date);
+ if (ret != ALARM_ERROR_NONE) {
+ LOGE("alarm_get_scheduled_date [%d: %s]", ret, get_error_message(ret));
+ return;
+ }
+
+ char datetime[100];
+ snprintf(datetime, 100, "%d.%d.%d@%d:%d:%d", (1900+date.tm_year), (1+date.tm_mon), date.tm_mday, date.tm_hour, date.tm_min, date.tm_sec);
+ LOGD("alarm scheduled alarm_id: %d, app_id: %s, date: %s (after %d sec)", alarm_id, app_id, datetime, period_seconds);
+}
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (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
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "http-get.h"
+#include "oobe-common.h"
+#include <log.h>
+#include <stdlib.h>
+#include <curl/curl.h>
+#include <json-glib/json-glib.h>
+
+#define HTTP_GET_TIMEOUT 7L
+
+struct MemoryStruct {
+ char *memory;
+ size_t size;
+};
+
+static size_t _write_cb(void *contents, size_t size, size_t nmemb, void *userp) {
+ size_t realsize = size * nmemb;
+ struct MemoryStruct *mem = (struct MemoryStruct *) userp;
+
+ char *ptr = realloc(mem->memory, mem->size + realsize + 1);
+ if (ptr == NULL) {
+ /* out of memory! */
+ LOGE("not enough memory (realloc returned NULL)\n");
+ return 0;
+ }
+
+ mem->memory = ptr;
+ memcpy(&(mem->memory[mem->size]), contents, realsize);
+ mem->size += realsize;
+ mem->memory[mem->size] = 0;
+
+ return realsize;
+}
+
+int http_get_text(const char *url, char **response) {
+ int result = -1;
+ *response = NULL;
+ CURL *curl;
+ curl_global_init(CURL_GLOBAL_DEFAULT);
+ curl = curl_easy_init();
+ if (curl) {
+ struct MemoryStruct chunk = { malloc(1), 0 };
+ curl_easy_setopt(curl, CURLOPT_URL, url);
+ curl_easy_setopt(curl, CURLOPT_TIMEOUT, HTTP_GET_TIMEOUT);
+ curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, _write_cb);
+ curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void * )&chunk);
+ CURLcode res = curl_easy_perform(curl);
+ if (res == CURLE_OK) {
+ *response = chunk.memory;
+ result = chunk.size;
+ } else {
+ LOGE("curl_easy_perform() failed: %s\n", curl_easy_strerror(res));
+ free(chunk.memory);
+ }
+ curl_easy_cleanup(curl);
+ }
+ curl_global_cleanup();
+ if(*response==NULL)
+ LOGE("response is null");
+ return result;
+}
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (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
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "oobe.h"
+#include "log.h"
+#include "utils.h"
+#include <glib.h>
+
+#define OOBE_DONE_FILEPATH "oobe_done"
+
+void oobe_set_done()
+{
+ GError *error = NULL;
+ char filepath[PATH_MAX];
+ utils_get_app_data_path(OOBE_DONE_FILEPATH, filepath, PATH_MAX);
+
+ if (g_file_set_contents(filepath, "", 0, &error) == false) {
+ LOGE("could not create file [%s] error code: %d", error->code);
+ g_error_free(error);
+ }
+}
+
+bool oobe_get_done()
+{
+ char filepath[PATH_MAX];
+ utils_get_app_data_path(OOBE_DONE_FILEPATH, filepath, PATH_MAX);
+
+ return g_file_test(filepath, G_FILE_TEST_EXISTS);
+}
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (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
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "terms.h"
+#include "oobe-common.h"
+#include "log.h"
+#include <stdlib.h>
+#include <json-glib/json-glib.h>
+#include <stdio.h>
+#include "utils.h"
+#include "terms_data.h"
+#include "http-get.h"
+#define LOG_TAG "oobe-setup"
+
+// moved from oobe-terms -----
+#define TERMS_INITIAL_PATH "data/initial_terms.json"
+
+bool terms_latest_exist() {
+ bool terms_exist = false;
+ static char file[PATH_MAX] = {0,};
+ if(file[0] == 0) {
+ utils_get_app_data_path(LATEST_TERMS_JSON_FILENAME, file, PATH_MAX);
+ }
+
+ struct terms_data* terms = terms_data_create_from_file(file);
+ if (terms != NULL) {
+ terms_data_destroy(terms);
+ terms_exist = true;
+ }
+ return terms_exist;
+}
+
+void terms_latest_init() {
+ char source[PATH_MAX];
+ utils_get_app_resource_path(TERMS_INITIAL_PATH, source, PATH_MAX);
+ char destination[PATH_MAX];
+ utils_get_app_data_path(LATEST_TERMS_JSON_FILENAME, destination, PATH_MAX);
+
+ if (utils_copy_file(source, destination)) {
+ LOGD("Copied initial terms successfully");
+ } else {
+ LOGW("Could not copy initial terms.");
+ }
+}
+
+static int _get_version(const char* file) {
+ int result = -1;
+ struct terms_data* terms = terms_data_create_from_file(file);
+ if (terms != NULL) {
+ result = terms->latest_version;
+ terms_data_destroy(terms);
+ } else {
+ LOGW("cannot get version from [%s]", file);
+ }
+ return result;
+}
+
+static int _terms_get_accepted_version() {
+ static char file[PATH_MAX] = {0,};
+ if(file[0] == 0)
+ utils_get_app_data_path(ACCEPTED_TERMS_JSON_FILENAME, file, PATH_MAX);
+ return _get_version(file);
+}
+
+int terms_get_latest_version() {
+ static char file[PATH_MAX] = {0,};
+ if(file[0] == 0)
+ utils_get_app_data_path(LATEST_TERMS_JSON_FILENAME, file, PATH_MAX);
+ return _get_version(file);
+}
+
+bool terms_accept(int version) {
+ bool result = false;
+ int latest_version = terms_get_latest_version();
+ int accepted_version = _terms_get_accepted_version();
+
+ if(version == latest_version && accepted_version <= latest_version) {
+ char accepted[PATH_MAX];
+ utils_get_app_data_path(ACCEPTED_TERMS_JSON_FILENAME, accepted, PATH_MAX);
+ char latest[PATH_MAX];
+ utils_get_app_data_path(LATEST_TERMS_JSON_FILENAME, latest, PATH_MAX);
+
+ result = utils_copy_file(latest, accepted);
+ }
+
+ LOGD("accept terms version %d [%s]", version, result ? "success" : "failed");
+ return result;
+}
+
+// moved from oobe-terms-service ----------------------------------------------
+#define DEFAULT_POOLING_INTERVAL 10
+#define REST_API_QUERY_ARGS "?current_version=%d"
+#define REST_API_URL_PATH "data/terms_server_url"
+
+static char* rest_api_url = NULL;
+
+void terms_read_server_url(void) {
+ if(rest_api_url == NULL) {
+ gsize size;
+ GError *error = NULL;
+ static char path[PATH_MAX];
+ utils_get_app_resource_path(REST_API_URL_PATH, path, PATH_MAX);
+ if (g_file_get_contents(path, &rest_api_url, &size, &error) == false) {
+ LOGW("cannot read terms server url from [%s]", path);
+ g_error_free(error);
+ }
+ }
+}
+
+int terms_get_accepted_version() {
+ static char file[PATH_MAX] = {0,};
+ if(file[0] == 0)
+ utils_get_app_data_path(ACCEPTED_TERMS_JSON_FILENAME, file, PATH_MAX);
+ return _get_version(file);
+}
+
+int terms_get_pooling_interval() {
+ int result = DEFAULT_POOLING_INTERVAL;
+ static char file[PATH_MAX] = {0,};
+ if(file[0] == 0) {
+ utils_get_app_data_path(LATEST_TERMS_JSON_FILENAME, file, PATH_MAX);
+ }
+
+ struct terms_data* terms = terms_data_create_from_file(file);
+ if (terms != NULL) {
+ result = terms->check_interval;
+ terms_data_destroy(terms);
+ } else {
+ LOGW("default pooling interval [%d] cannot read from [%s]", result, file);
+ }
+ return result;
+}
+
+static int _terms_download(const char* url, char **response, int *total_time_msec)
+{
+ gint64 download_start_time, download_end_time;
+
+ download_start_time = g_get_monotonic_time();
+ int status = http_get_text(url, response);
+ download_end_time = g_get_monotonic_time();
+
+ if (total_time_msec != NULL)
+ *total_time_msec = (download_end_time - download_start_time) / 1000;
+
+ return status;
+}
+
+void terms_download_latest(int version) {
+ static char url[PATH_MAX] = {0,};
+ if(url[0] == 0) {
+ terms_read_server_url();
+ snprintf(url, PATH_MAX, "%s"REST_API_QUERY_ARGS, rest_api_url, version);
+ }
+ static char file[PATH_MAX] = {0,};
+ if(file[0] == 0) {
+ utils_get_app_data_path(LATEST_TERMS_JSON_FILENAME, file, PATH_MAX);
+ }
+ LOGD("terms download started [%s]", url);
+
+ char *http_response;
+ int total_time_msec = -1;
+ int http_result = _terms_download(url, &http_response, &total_time_msec);
+
+ if (http_result > -1)
+ {
+ LOGD("terms download success [%d msec]", total_time_msec);
+
+ struct terms_data* terms = terms_data_create_from_text(http_response);
+ if (terms == NULL)
+ {
+ LOGW("invalid terms");
+ } else {
+ LOGD("terms downloaded version: %d, terms count: %d", terms->latest_version, terms->terms_count);
+ bool new_terms = terms->latest_version > version && terms->terms_count > 0;
+ if (new_terms) {
+ if (utils_save_to_file(file, http_response)) {
+ LOGD("new terms saved to file");
+ } else {
+ LOGW("new terms not saved to file");
+ }
+ }
+ terms_data_destroy(terms);
+ }
+ } else {
+ LOGW("terms download failed [%d msec]", total_time_msec);
+ }
+
+ free(http_response);
+}
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (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
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "terms_data.h"
+#include "oobe-common.h"
+#include "log.h"
+#include <json-glib/json-glib.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <strings.h>
+#include <system_settings.h>
+#include <stdbool.h>
+
+static char* locale = NULL;
+
+static void _update_current_locale();
+static struct terms_data* _deserialize_terms_data(JsonNode *root);
+static void _on_deserialize_terms(JsonArray *array, guint index, JsonNode *element, gpointer user_data);
+static JsonNode *_parse_json_string(JsonParser *parser, const char *json);
+
+struct terms_data* terms_data_create_from_file(const char *file_name) {
+ struct terms_data* result = NULL;
+ char *json = NULL;
+ gsize size;
+ GError *error = NULL;
+
+ if (g_file_test(file_name, G_FILE_TEST_EXISTS)) {
+ if (g_file_get_contents(file_name, &json, &size, &error)) {
+ result = terms_data_create_from_text(json);
+ free(json);
+ } else {
+ LOGE("cannot read file [%s] error code: %d", file_name, error->code);
+ g_error_free(error);
+ }
+ } else {
+ LOGE("File does not exist (%s).", file_name);
+ }
+
+ return result;
+}
+
+struct terms_data* terms_data_create_from_text(const char *json) {
+ struct terms_data* result = NULL;
+ JsonParser *parser = json_parser_new();
+ JsonNode *root = _parse_json_string(parser, json);
+ JsonArray *root_array = json_node_get_array(root);
+ if (root_array == NULL) {
+ result = _deserialize_terms_data(root);
+ } else {
+ _update_current_locale();
+ json_array_foreach_element(root_array, _on_deserialize_terms, &result);
+ if(result == NULL) {
+ LOGD("There is no desired language avaliable. Trying to get the first one");
+ result = _deserialize_terms_data(json_array_get_element(root_array, 0));
+ }
+ }
+ g_object_unref(parser);
+ return result;
+}
+
+void terms_data_destroy(struct terms_data* terms) {
+ if (terms != NULL) {
+ if (terms->region != NULL)
+ free((void*) terms->region);
+ if (terms->language != NULL)
+ free((void*) terms->language);
+ if (terms->terms != NULL) {
+ for (int i = 0; i < terms->terms_count; i++) {
+ if (terms->terms[i].title != NULL)
+ free((void*) terms->terms[i].title);
+ if (terms->terms[i].content != NULL)
+ free((void*) terms->terms[i].content);
+ }
+ free(terms->terms);
+ }
+ free(terms);
+ }
+}
+
+static JsonNode *_parse_json_string(JsonParser *parser, const char *json) {
+ GError *err = NULL;
+ if (!json_parser_load_from_data(parser, json, -1, &err)) {
+ LOGE("Function \"json_parser_load_from_data()\" failed with message: %s",
+ err->message);
+ g_error_free(err);
+ return NULL;
+ }
+ return json_parser_get_root(parser);
+}
+
+static const char *_get_string_by_key(JsonObject *entry, const char *key) {
+ char *result = NULL;
+ if (json_object_has_member(entry, key)) {
+ const char *json_string = (const char *) json_object_get_string_member(
+ entry, key);
+ int length = 1 + strlen(json_string);
+ result = malloc(length);
+ strncpy(result, json_string, length);
+ } else {
+ LOGD("json has no member: %s", key);
+ }
+ return result;
+}
+
+static bool _get_boolean_by_key(JsonObject *entry, const char *key) {
+ if (json_object_has_member(entry, key))
+ return json_object_get_boolean_member(entry, key);
+ else
+ return FALSE;
+}
+
+static void _on_deserialize_term_detail(JsonArray *array, guint index,
+ JsonNode *element, gpointer user_data) {
+ struct term *details = (struct term *) user_data;
+ JsonObject *entry = json_node_get_object(element);
+
+ details[index].is_required = _get_boolean_by_key(entry, "is_required");
+ details[index].title = _get_string_by_key(entry, "title");
+ details[index].content = _get_string_by_key(entry, "content");
+
+ details[index].is_accepted = false;
+}
+
+static void _deserialize_terms_details(JsonObject *entry, struct terms_data *result) {
+ JsonArray *json_array = json_object_get_array_member(entry, "terms");
+ if (json_array != NULL ) {
+ result->terms_count = json_array_get_length(json_array);
+ if(result->terms_count > 0) {
+ result->terms = malloc(sizeof(struct term) * result->terms_count);
+ json_array_foreach_element(json_array, _on_deserialize_term_detail,
+ result->terms);
+ } else {
+ LOGE("json has no terms details");
+ }
+ } else {
+ LOGD("json has no terms details");
+ result->terms_count = 0;
+ result->terms = NULL;
+ }
+}
+
+struct terms_data* _deserialize_terms_data(JsonNode *root) {
+ struct terms_data* result = NULL;
+ JsonObject *entry = json_node_get_object(root);
+ if (entry != NULL ) {
+ if(json_object_has_member(entry, "latest_version")
+ && json_object_has_member(entry, "check_interval")) {
+ result = malloc(sizeof(struct terms_data));
+ result->latest_version = json_object_get_int_member(entry, "latest_version");
+ result->check_interval = json_object_get_int_member(entry, "check_interval");
+ result->language = _get_string_by_key(entry, "language");
+ result->region = _get_string_by_key(entry, "region");
+
+ _deserialize_terms_details(entry, result);
+ } else {
+ LOGE("Json has no latest_version or check_interval defined");
+ }
+ }
+ else {
+ LOGE("Json has no data");
+ }
+ return result;
+}
+
+static void _on_deserialize_terms(JsonArray *array, guint index,
+ JsonNode *element, gpointer user_data) {
+ struct terms_data **terms_data = (struct terms_data **) user_data;
+ if(*terms_data==NULL && locale != NULL) {
+ const char *language = _get_string_by_key(json_node_get_object(element), "language");
+ if(language != NULL) {
+ if(strcasecmp(language, locale)==0) {
+ *terms_data = _deserialize_terms_data(element);
+ }
+ free((char*)language);
+ } else {
+ LOGE("Cannot parse language or current locale not set. Json language: %s, locale: %s", language, locale);
+ }
+ }
+}
+
+static void _update_current_locale() {
+ free(locale);
+ system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &locale);
+ LOGD("current locale %s", locale);
+}
*/
#include "utils_view.h"
+#include "oobe-common.h"
#include "utils.h"
#include "log.h"
#include <app.h>
elm_win_indicator_mode_set(win, ELM_WIN_INDICATOR_SHOW);
elm_win_indicator_opacity_set(win, ELM_WIN_INDICATOR_OPAQUE);
elm_win_autodel_set(win, EINA_TRUE);
+ elm_win_layer_set(win, 6);
evas_object_smart_callback_add(win, "delete,request", _delete_win_request_cb, NULL);
USER_LIBS =
# User Objects
-USER_OBJS =
+USER_OBJS = ../oobe-common/Debug/liboobe-common.a
# User Includes
## C Compiler
-USER_C_INC_DIRS = inc
+USER_C_INC_DIRS = inc ../oobe-common/inc
USER_INC_FILES =
## C++ Compiler
USER_CPP_INC_DIRS =
<listOptionValue builtIn="false" value="DEPRECATION_WARNING"/>
<listOptionValue builtIn="false" value="_DEBUG"/>
</option>
- <option id="gnu.cpp.compiler.option.dialect.std.2027193221" name="Language standard" superClass="gnu.cpp.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.cpp.compiler.dialect.c++1y" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.dialect.std.2027193221" name="Language standard" superClass="gnu.cpp.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.cpp.compiler.dialect.default" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.dialect.flags.151802037" name="Other dialect flags" superClass="gnu.cpp.compiler.option.dialect.flags" useByScannerDiscovery="true" value="-std=c++14" valueType="string"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.402767253" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool command="clang" id="org.tizen.nativecore.tool.sbi.gnu.c.compiler.1141856070" name="C Compiler" superClass="org.tizen.nativecore.tool.sbi.gnu.c.compiler">
</option>
<option id="gnu.c.compiler.option.include.paths.1229709013" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
- <listOptionValue builtIn="false" value="/home/k.wieclaw/workspace/chair-setup/oobe-easy-setup/inc/services/${SDK_ARCH}"/>
</option>
<option id="sbi.gnu.c.compiler.option.frameworks.core.1236930439" name="Tizen-Frameworks" superClass="sbi.gnu.c.compiler.option.frameworks.core" useByScannerDiscovery="false" valueType="userObjs">
<listOptionValue builtIn="false" value="Native_API"/>
--- /dev/null
+
+# Add pre/post build process
+PREBUILD_DESC =
+PREBUILD_COMMAND =
+POSTBUILD_DESC =
+POSTBUILD_COMMAND =
+
+# Project Name
APPNAME = oobe-easy-setup
+# Project Type
type = app
+
+# Project Profile
profile = iot-headed-5.0
-USER_SRCS = src/**.cpp ses-cpp/src/**.cpp api-cpp/src/**.cpp
-USER_DEFS =
-USER_INC_DIRS = inc api-cpp/src ses-cpp/src
-USER_OBJS =
-USER_LIBS = st_thing_master_api samsung_account
-USER_EDCS = res/edje/*.edc
\ No newline at end of file
+# C/CPP Sources
+USER_SRCS = api-cpp/src/tizen/network/wifi/SpecificScan.cpp api-cpp/src/tizen/network/softap/Manager.cpp api-cpp/src/tizen/network/bluetooth/AdvertiserLE.cpp api-cpp/src/tizen/network/bluetooth/DeviceInfo.cpp ses-cpp/src/ses/smartthings/thing/SmartThingsThingExceptions.cpp api-cpp/src/tizen/network/softap/Client.cpp api-cpp/src/tizen/application/ServiceApp.cpp src/views/ViewPin.cpp api-cpp/src/tizen/application/UiApp.cpp src/views/ViewError.cpp api-cpp/src/tizen/ThreadUtils.cpp ses-cpp/src/ses/smartthings/thing/Master.cpp src/ViewManager.cpp src/views/ViewAutoConfiguration.cpp src/OobeEasySetupApp.cpp api-cpp/src/tizen/Logger.cpp src/views/ViewAdertisement.cpp api-cpp/src/tizen/application/Resource.cpp src/ViewEventAdapter.cpp api-cpp/src/tizen/network/wifi/Ap.cpp api-cpp/src/tizen/network/bluetooth/DiscoveryInfo.cpp api-cpp/src/tizen/peripheral/gpio/Pin.cpp api-cpp/src/tizen/network/bluetooth/Manager.cpp api-cpp/src/tizen/peripheral/spi/SpiException.cpp ses-cpp/src/ses/smartthings/thing/ApList.cpp ses-cpp/src/ses/smartthings/thing/CloudInfo.cpp src/TestUIViewEventAdapter.cpp src/views/ViewConnectedToSoftAP.cpp src/EasySetupEventAdapter.cpp ses-cpp/src/ses/smartthings/thing/ApInfo.cpp src/AppUtils.cpp api-cpp/src/tizen/application/AppException.cpp api-cpp/src/tizen/network/bluetooth/Adapter.cpp src/connectivity/TizenHomeAP.cpp src/StateManager.cpp api-cpp/src/tizen/network/wifi/Manager.cpp api-cpp/src/tizen/network/bluetooth/Exceptions.cpp api-cpp/src/tizen/network/wifi/Exception.cpp api-cpp/src/tizen/peripheral/gpio/GpioException.cpp api-cpp/src/tizen/timer/TimerException.cpp src/ViewEventObserver.cpp ses-cpp/src/ses/smartthings/thing/DeviceProvInfo.cpp api-cpp/src/tizen/application/AppControl.cpp api-cpp/src/tizen/key_manager/KeyManager.cpp src/views/ViewStart.cpp src/connectivity/TizenSoftAP.cpp api-cpp/src/tizen/Strings.cpp api-cpp/src/tizen/peripheral/spi/Spi.cpp src/OobeEasySetupMain.cpp src/EasySetup.cpp src/popups/PopupSkip.cpp api-cpp/src/tizen/timer/Timer.cpp
+
+# EDC Sources
+USER_EDCS =
+
+# PO Sources
+USER_POS = res/po/en_US.po res/po/pl_PL.po
+
+# User Defines
+USER_DEFS =
+USER_CPP_DEFS = TIZEN_DEPRECATION DEPRECATION_WARNING
+
+# User Undefines
+USER_UNDEFS =
+USER_CPP_UNDEFS =
+
+# User Libraries
+USER_LIBS = st_thing_master_api
+
+# User Objects
+USER_OBJS =
+
+# User Includes
+## C Compiler
+USER_C_INC_DIRS =
+USER_INC_FILES =
+## C++ Compiler
+USER_CPP_INC_DIRS = inc api-cpp/src ses-cpp/src inc/services/arm
+USER_CPP_INC_FILES =
+
+USER_INC_DIRS = $(USER_C_INC_DIRS) $(USER_CPP_INC_DIRS)
+
+# User Library Path
+USER_LIB_DIRS = lib
+
+# EDC Resource Path
+USER_EDCS_IMAGE_DIRS = ${OUTPUT_DIR} edje/images
+USER_EDCS_SOUND_DIRS = ${OUTPUT_DIR} edje/sounds
+USER_EDCS_FONT_DIRS = ${OUTPUT_DIR} edje/fonts
+
+# EDC Flags
+USER_EXT_EDC_KEYS = EDC0
+
+USER_EXT_EDC0_EDCS = res/edje/connected_to_softap.edc res/edje/pin.edc res/edje/advertisement.edc res/edje/error.edc res/edje/oobe_button.edc res/edje/start.edc res/edje/auto_configuration.edc
+USER_EXT_EDC0_EDCS_IMAGE_DIRS = ${OUTPUT_DIR} edje/images
+USER_EXT_EDC0_EDCS_SOUND_DIRS = ${OUTPUT_DIR} edje/sounds
+USER_EXT_EDC0_EDCS_FONT_DIRS = ${OUTPUT_DIR} edje/fonts
+
+# Resource Filter
+USER_RES_INCLUDE =
+USER_RES_EXCLUDE =
+
elm_win_conformant_set(_win, EINA_TRUE);
elm_win_indicator_mode_set(_win, ELM_WIN_INDICATOR_HIDE);
elm_win_autodel_set(_win, EINA_TRUE);
+ elm_win_layer_set(_win, 6);
evas_object_smart_callback_add(_win, "delete,request", _win_delete_request_cb, NULL);
elm_language_set(language);
free(language);
}
-}
\ No newline at end of file
+}
USER_LIBS =
# User Objects
-USER_OBJS =
+USER_OBJS = ../oobe-common/Debug/liboobe-common.a
# User Includes
## C Compiler
-USER_C_INC_DIRS = inc
+USER_C_INC_DIRS = inc ../oobe-common/inc
USER_INC_FILES =
## C++ Compiler
USER_CPP_INC_DIRS =
# EDC Flags
USER_EXT_EDC_KEYS = EDC0
-USER_EXT_EDC0_EDCS = res/edje/*.edc
+USER_EXT_EDC0_EDCS = res/edje/oobe-language.edc
USER_EXT_EDC0_EDCS_IMAGE_DIRS = ${OUTPUT_DIR} edje/images
USER_EXT_EDC0_EDCS_SOUND_DIRS = ${OUTPUT_DIR} edje/sounds
USER_EXT_EDC0_EDCS_FONT_DIRS = ${OUTPUT_DIR} edje/fonts
#include <Elementary.h>
#include <system_settings.h>
#include <efl_extension.h>
+#include <log.h>
#ifdef LOG_TAG
#undef LOG_TAG
#define LOG_TAG "oobe-setup"
#if !defined(PACKAGE)
-#define PACKAGE "org.tizen.oobe-setup"
+#define PACKAGE "org.tizen.oobe"
#endif
void language_show(void);
USER_LIBS =
# User Objects
-USER_OBJS =
+USER_OBJS = ../oobe-common/Debug/liboobe-common.a
# User Includes
## C Compiler
-USER_C_INC_DIRS = inc
+USER_C_INC_DIRS = inc ../oobe-common/inc
USER_INC_FILES =
## C++ Compiler
USER_CPP_INC_DIRS =
--- /dev/null
+# This PO file is automatically generated by PO File Editor of Tizen Studio
+# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES CAN BE OVERWRITTEN
+
+msgid "DONE"
+msgstr "DONE"
+
--- /dev/null
+# This PO file is automatically generated by PO File Editor of Tizen Studio
+# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES CAN BE OVERWRITTEN
+
+msgid "DONE"
+msgstr "Zamknij"
+
#include "view.h"
#include <app.h>
#include <app-control.h>
+#include "alarm.h"
#include "oobe.h"
+#include "log.h"
+
+static void ac_reply_cb(const char *reply) {}
void done_show()
{
oobe_set_done();
view_show_done();
+
+ app_control_launch_app("org.tizen.oobe-terms", ac_reply_cb);
}
#include "oobe-setup.h"
#include "view.h"
#include "app-control.h"
+#include <utils_view.h>
#include <log.h>
-#include <oobe-common.h>
+#include <terms.h>
+#include "oobe.h"
static bool app_create(void *user_data)
{
if (!caller)
{
- language_show();
+ if(oobe_get_done())
+ {
+ terms_show();
+ ui_app_exit();
+ }
+ else
+ {
+ language_show();
+ }
}
else
{
{
easy_setup_show();
}
+ free(caller);
}
}
}
return ret;
-}
+}
\ No newline at end of file
Evas_Object *button_done = elm_button_add(s_info.layout_main);
elm_object_style_set(button_done, "middle");
- elm_object_text_set(button_done, "DONE");
+ elm_object_text_set(button_done, _("DONE"));
evas_object_smart_callback_add(button_done, "clicked", _button_done_clicked_cb, NULL);
elm_layout_content_set(s_info.layout_main, "done", button_done);
</ui-application>
<privileges>
<privilege>http://tizen.org/privilege/appmanager.launch</privilege>
+ <privilege>http://tizen.org/privilege/alarm.get</privilege>
+ <privilege>http://tizen.org/privilege/alarm.set</privilege>
</privileges>
</manifest>
USER_LIBS =
# User Objects
-USER_OBJS =
+USER_OBJS = ../oobe-common/Debug/liboobe-common.a
# User Includes
## C Compiler
-USER_C_INC_DIRS = inc
+USER_C_INC_DIRS = inc ../oobe-common/inc
USER_INC_FILES =
## C++ Compiler
USER_CPP_INC_DIRS =
<project>oobe-terms-service</project>
</projects>
<buildSpec>
+ <buildCommand>
+ <name>org.tizen.nativecore.apichecker.apicheckerbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<arguments>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+ <nature>org.tizen.nativecore.apichecker.apicheckernature</nature>
</natures>
<filteredResources>
<filter>
USER_LIBS =
# User Objects
-USER_OBJS =
+USER_OBJS = ../oobe-common/Debug/liboobe-common.a
# User Includes
## C Compiler
-USER_C_INC_DIRS = inc
+USER_C_INC_DIRS = inc ../oobe-common/inc
USER_INC_FILES =
## C++ Compiler
USER_CPP_INC_DIRS =
+[
{
"latest_version": 1,
"check_interval": 11,
+ "language":"en_US",
"terms": [
{
"title": "Terms and Conditions",
"content": "pp lorem ipsum"
}
]
+},
+{
+ "latest_version": 1,
+ "check_interval": 11,
+ "language":"pl_PL",
+ "terms": [
+ {
+ "title": "Regulamin",
+ "is_required": true,
+ "content": "tnc lorem ipsum pl"
+ },
+ {
+ "title": "Polityka prywatności",
+ "is_required": true,
+ "content": "pp lorem ipsum pl"
+ }
+ ]
}
+]
\ No newline at end of file
--- /dev/null
+http://106.116.47.121:5001/latest_version
\ No newline at end of file
#include "oobe-terms.h"
#include "view.h"
-#include <log.h>
#include "app-control.h"
-#include "terms.h"
+#include <alarm.h>
+#include <oobe.h>
+#include <log.h>
+#include <terms.h>
#include <oobe-common.h>
+#include <terms_data.h>
static bool is_foreground = false;
+static void _verify_terms();
+static void _schedule_next_check_terms();
static void _button_clicked_cb(const char* action);
static bool app_create(void *user_data)
view_destroy();
}
+static bool _is_caller_oobe_setup(app_control_h app_control) {
+ bool result = 0;
+ char* value = NULL;
+ app_control_get_extra_data(app_control, "caller", &value);
+ if (value && !strcmp(value, "oobe-setup"))
+ result = true;
+ free(value);
+ return result;
+}
+
static void app_control(app_control_h app_control, void *user_data)
{
- // do not show view again if it is already shown
// TODO check if there is a new version downloaded -> then show popup, and update terms list
if (is_foreground) {
- if(terms->latest_version == terms_get_latest_version()) {
+ if (terms->latest_version == terms_get_latest_version()) {
LOGD("App already in the foreground");
+ _schedule_next_check_terms();
return;
} else {
LOGD("Recreating view with newer terms");
if (terms_latest_exist() == false)
terms_latest_init();
- char* value = NULL;
- app_control_get_extra_data(app_control, "caller", &value);
-
- if (value) {
- if(!strcmp(value, "oobe-setup")) {
+ if (oobe_get_done()) {
+ LOGD("Verifying terms");
+ _verify_terms();
+ } else {
+ if (_is_caller_oobe_setup(app_control)) {
view_create(Normal, NULL);
- } else if(!strcmp(value, "oobe-terms-service")) {
- // TODO: replace view_create with view_create_settings
- view_create(Reagree, NULL);
+ } else {
+ LOGD("Cannot start without proper caller name");
+ ui_app_exit();
}
- } else {
- LOGD("Cannot start without proper caller name");
- return;
}
-
app_control_save_reply_handler(app_control);
}
ui_app_exit();
}
}
+
+static bool _check_for_new_terms() {
+ bool needs_acceptance = false;
+ LOGD("*** CHECK FOR NEW TERMS ***");
+
+ bool oobe_done = oobe_get_done();
+ if (oobe_done) {
+ int accepted_version = terms_get_accepted_version();
+ int latest_version = terms_get_latest_version();
+ LOGI("accepted version: %d, latest version: %d", accepted_version, latest_version);
+
+ if(accepted_version <= 0) {
+ if (latest_version <= 0)
+ LOGW("there are neither latest nor accepted terms");
+ else
+ needs_acceptance = true;
+ } else {
+ terms_download_latest(accepted_version);
+
+ latest_version = terms_get_latest_version();
+ LOGI("latest version: %d", latest_version);
+ if (latest_version <= 0 )
+ LOGW("there is no file with latest terms or access is denied");
+ else if (accepted_version < latest_version)
+ needs_acceptance = true;
+ }
+ } else {
+ LOGD("OOBE is not done yet. Skipping terms check.");
+ }
+ return needs_acceptance;
+}
+
+static void _schedule_next_check_terms() {
+ int interval = terms_get_pooling_interval();
+ alarm_schedule(interval, PACKAGE, "reagree");
+ LOGD("scheduled next check for new terms in %d sec", interval);
+}
+
+static void _verify_terms() {
+ LOGD("oobe terms run in verify mode");
+ _schedule_next_check_terms();
+ if(_check_for_new_terms()) {
+ view_create(Reagree, NULL);
+ }
+ else {
+ ui_app_exit();
+ }
+}
*/
#include "view.h"
-#include "terms.h"
#include "oobe-terms.h"
-#include <log.h>
#include "view-defines.h"
-#include <glib.h>
-#include <utils.h>
+#include <terms.h>
+#include <terms_data.h>
+#include <log.h>
#include <oobe-common.h>
+#include <utils.h>
+#include <glib.h>
static struct view_info {
Evas_Object *win;
static void _terms_list_load(char *terms_path)
{
- terms = terms_create_from_file(terms_path);
-
- Elm_Genlist_Item_Class *agree_all_class = elm_genlist_item_class_new();
- agree_all_class->item_style = "terms_agree";
- agree_all_class->func.text_get = _agree_all_text_get;
- agree_all_class->func.content_get = _agree_all_content_get;
-
- Elm_Genlist_Item_Class *agree_one_class = elm_genlist_item_class_new();
- agree_one_class->item_style = "terms_agree";
- agree_one_class->func.text_get = _agree_one_text_get;
- agree_one_class->func.content_get = _agree_one_content_get;
-
- int items_to_accept = 0;
- for (int i = 0; i < terms->terms_count; ++i)
- {
- if (terms->terms[i].is_required)
- ++items_to_accept;
- }
+ terms = terms_data_create_from_file(terms_path);
+ if(terms != NULL) {
+ Elm_Genlist_Item_Class *agree_all_class = elm_genlist_item_class_new();
+ agree_all_class->item_style = "terms_agree";
+ agree_all_class->func.text_get = _agree_all_text_get;
+ agree_all_class->func.content_get = _agree_all_content_get;
+
+ Elm_Genlist_Item_Class *agree_one_class = elm_genlist_item_class_new();
+ agree_one_class->item_style = "terms_agree";
+ agree_one_class->func.text_get = _agree_one_text_get;
+ agree_one_class->func.content_get = _agree_one_content_get;
+
+ int items_to_accept = 0;
+ for (int i = 0; i < terms->terms_count; ++i)
+ {
+ if (terms->terms[i].is_required)
+ ++items_to_accept;
+ }
- if (items_to_accept > 1)
- elm_genlist_item_append(s_info.gen_list, agree_all_class, &terms_all, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
+ if (items_to_accept > 1)
+ elm_genlist_item_append(s_info.gen_list, agree_all_class, &terms_all, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
- for (int i = 0; i < terms->terms_count; ++i)
- elm_genlist_item_append(s_info.gen_list, agree_one_class, terms->terms + i, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
+ for (int i = 0; i < terms->terms_count; ++i)
+ elm_genlist_item_append(s_info.gen_list, agree_one_class, terms->terms + i, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
- elm_genlist_item_class_free(agree_all_class);
- elm_genlist_item_class_free(agree_one_class);
+ elm_genlist_item_class_free(agree_all_class);
+ elm_genlist_item_class_free(agree_one_class);
- int items_count = elm_genlist_items_count(s_info.gen_list);
- if (items_count > 3)
- elm_object_signal_emit(s_info.layout_terms, "show_list_bg", "");
+ int items_count = elm_genlist_items_count(s_info.gen_list);
+ if (items_count > 3)
+ elm_object_signal_emit(s_info.layout_terms, "show_list_bg", "");
+ } else {
+ LOGE("terms was not loaded correctly");
+ }
}
static void _button_view_details_clicked_cb(void *data, Evas_Object *obj, void *event_info)
USER_LIBS =
# User Objects
-USER_OBJS =
+USER_OBJS = ../oobe-common/Debug/liboobe-common.a
# User Includes
## C Compiler
-USER_C_INC_DIRS = inc
+USER_C_INC_DIRS = inc ../oobe-common/inc
USER_INC_FILES =
## C++ Compiler
USER_CPP_INC_DIRS =
# software and documents. This publication and the contents here of are subject
# to change without notice.
#
+# run: /pathToSam/sam_cli.sh sam_cli.cfg
################################
# Project Name
################################
-SAM_PRJ_NAME="OOBE-HEADED"
+SAM_PRJ_NAME="OOBE-Chair"
################################