xdamage
pkgmgr
livebox-service
+ notification
+ badge
)
SET(PACKAGE "${PROJECT_NAME}")
Flora License
-Version 1.0, April, 2013
+Version 1.1, April, 2013
http://floralicense.org/license/
Derivative Works; or, within a display generated by the Derivative Works,
if and wherever such third-party notices normally appear.
The contents of the NOTICE file are for informational purposes only
- and do not modify the License.
-
-You may add Your own attribution notices within Derivative Works
-that You distribute, alongside or as an addendum to the NOTICE text
-from the Work, provided that such additional attribution notices
-cannot be construed as modifying the License. You may add Your own
-copyright statement to Your modifications and may provide additional or
-different license terms and conditions for use, reproduction, or
-distribution of Your modifications, or for any such Derivative Works
-as a whole, provided Your use, reproduction, and distribution of
-the Work otherwise complies with the conditions stated in this License.
+ and do not modify the License. You may add Your own attribution notices
+ within Derivative Works that You distribute, alongside or as an addendum
+ to the NOTICE text from the Work, provided that such additional attribution
+ notices cannot be construed as modifying the License. You may add Your own
+ copyright statement to Your modifications and may provide additional or
+ different license terms and conditions for use, reproduction, or
+ distribution of Your modifications, or for any such Derivative Works
+ as a whole, provided Your use, reproduction, and distribution of
+ the Work otherwise complies with the conditions stated in this License
+ and your own copyright statement or terms and conditions do not conflict
+ the conditions stated in the License including section 3.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
Copyright [yyyy] [name of copyright owner]
- Licensed under the Flora License, Version 1.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
</request>
<permit>
<smack permit="dbus" type="rx" />
+ <smack permit="notification::db" type="rw" />
+ <smack permit="badge::db" type="rw" />
</permit>
</define>
<request>
#
# Copyright 2013 Samsung Electronics Co., Ltd
#
-# Licensed under the Flora License, Version 1.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
#
#
# Copyright 2013 Samsung Electronics Co., Ltd
#
-# Licensed under the Flora License, Version 1.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
#
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
* limitations under the License.
*/
+extern int badge_service_init(void);
+extern int badge_service_fini(void);
+
+/* End of a file */
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
extern int instance_recover_state(struct inst_info *inst);
extern int instance_need_slave(struct inst_info *inst);
-extern void instance_set_lb_info(struct inst_info *inst, int w, int h, double priority, const char *content, const char *title);
-extern void instance_set_pd_info(struct inst_info *inst, int w, int h);
+extern void instance_set_lb_info(struct inst_info *inst, double priority, const char *content, const char *title);
+extern void instance_set_lb_size(struct inst_info *inst, int w, int h);
+extern void instance_set_pd_size(struct inst_info *inst, int w, int h);
extern int instance_set_pinup(struct inst_info *inst, int pinup);
extern int instance_resize(struct inst_info *inst, int w, int h);
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
* limitations under the License.
*/
+extern int notification_service_init(void);
+extern int notification_service_fini(void);
+
+/* End of a file */
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
extern int util_unlink_files(const char *folder);
extern char *util_slavename(void);
extern const char *util_basename(const char *name);
-extern unsigned long util_free_space(const char *path);
+extern unsigned long long util_free_space(const char *path);
extern char *util_replace_string(const char *src, const char *pattern, const char *replace);
extern const char *util_uri_to_path(const char *uri);
extern void *util_timer_add(double interval, Eina_Bool (*cb)(void *data), void *data);
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
Name: data-provider-master
Summary: Master service provider for liveboxes.
-Version: 0.22.0
+Version: 0.23.0
Release: 1
Group: HomeTF/Livebox
License: Flora License
BuildRequires: pkgconfig(xdamage)
BuildRequires: pkgconfig(pkgmgr)
BuildRequires: pkgconfig(livebox-service)
+BuildRequires: pkgconfig(notification)
+BuildRequires: pkgconfig(badge)
+BuildRequires: sec-product-features
%description
Manage the 2nd stage livebox service provider and communicate with the viewer application.
%setup -q
%build
+%if 0%(test "%{?sec_build_conf_tizen_product_group}" == "baltic" && echo 1)
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DPRODUCT=baltic
+%else
cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DPRODUCT=private
+%endif
CFLAGS="${CFLAGS} -Wall -Winline -Werror" LDFLAGS="${LDFLAGS}" make %{?jobs:-j%jobs}
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
* limitations under the License.
*/
+#include <stdio.h>
+
+#include <Eina.h>
+
+#include <dlog.h>
+#include <livebox-errno.h>
+#include <packet.h>
+
+#include <badge.h>
+#include <badge_db.h>
+
+#include "service_common.h"
+#include "debug.h"
+#include "util.h"
+#include "conf.h"
+
+#define BADGE_ADDR "/tmp/.badge.service"
+
+static struct info {
+ Eina_List *context_list;
+ struct service_context *svc_ctx;
+} s_info = {
+ .context_list = NULL, /*!< \WARN: This is only used for SERVICE THREAD */
+ .svc_ctx = NULL, /*!< \WARN: This is only used for MAIN THREAD */
+};
+
+struct context {
+ struct tcb *tcb;
+ double seq;
+};
+
+struct noti_service {
+ const char *cmd;
+ void (*handler)(struct tcb *tcb, struct packet *packet, void *data);
+};
+
+/*!
+ * FUNCTIONS to handle badge
+ */
+static inline char *get_string(char *string)
+{
+ if (string == NULL) {
+ return NULL;
+ }
+ if (string[0] == '\0') {
+ return NULL;
+ }
+
+ return string;
+}
+
+/*!
+ * SERVICE HANDLER
+ */
+static void _handler_insert_badge(struct tcb *tcb, struct packet *packet, void *data)
+{
+ int ret = 0;
+ struct packet *packet_reply = NULL;
+ struct packet *packet_service = NULL;
+ char *pkgname = NULL;
+ char *writable_pkg = NULL;
+ char *caller = NULL;
+
+ if (packet_get(packet, "sss", &pkgname, &writable_pkg, &caller) == 3) {
+ pkgname = get_string(pkgname);
+ writable_pkg = get_string(writable_pkg);
+ caller = get_string(caller);
+
+ if (pkgname != NULL && writable_pkg != NULL && caller != NULL) {
+ ret = badge_db_insert(pkgname, writable_pkg, caller);
+
+ } else {
+ ret = BADGE_ERROR_INVALID_DATA;
+ }
+
+ packet_reply = packet_create_reply(packet, "i", ret);
+ if (packet_reply) {
+ service_common_unicast_packet(tcb, packet_reply);
+ packet_destroy(packet_reply);
+ }
+
+ if (ret == BADGE_ERROR_NONE) {
+ packet_service = packet_create("insert_badge", "is", ret, pkgname);
+ if (packet_service != NULL) {
+ service_common_multicast_packet(tcb, packet_service, TCB_CLIENT_TYPE_SERVICE);
+ packet_destroy(packet_service);
+ }
+ }
+ } else {
+ ErrPrint("Failed to get data from the packet");
+ }
+}
+
+static void _handler_delete_badge(struct tcb *tcb, struct packet *packet, void *data)
+{
+ int ret = 0;
+ struct packet *packet_reply = NULL;
+ struct packet *packet_service = NULL;
+ char *pkgname = NULL;
+ char *caller = NULL;
+
+ if (packet_get(packet, "ss", &pkgname, &caller) == 2) {
+ pkgname = get_string(pkgname);
+ caller = get_string(caller);
+
+ if (pkgname != NULL && caller != NULL) {
+ ret = badge_db_delete(pkgname, caller);
+
+ } else {
+ ret = BADGE_ERROR_INVALID_DATA;
+ }
+
+ packet_reply = packet_create_reply(packet, "i", ret);
+ if (packet_reply) {
+ service_common_unicast_packet(tcb, packet_reply);
+ packet_destroy(packet_reply);
+ }
+
+ if (ret == BADGE_ERROR_NONE) {
+ packet_service = packet_create("delete_badge", "is", ret, pkgname);
+ if (packet_service != NULL) {
+ service_common_multicast_packet(tcb, packet_service, TCB_CLIENT_TYPE_SERVICE);
+ packet_destroy(packet_service);
+ }
+ }
+ } else {
+ ErrPrint("Failed to get data from the packet");
+ }
+}
+
+static void _handler_set_badge_count(struct tcb *tcb, struct packet *packet, void *data)
+{
+ int ret = 0;
+ struct packet *packet_reply = NULL;
+ struct packet *packet_service = NULL;
+ char *pkgname = NULL;
+ char *caller = NULL;
+ int count = 0;
+
+ if (packet_get(packet, "ssi", &pkgname, &caller, &count) == 3) {
+ pkgname = get_string(pkgname);
+ caller = get_string(caller);
+
+ if (pkgname != NULL && caller != NULL) {
+ ret = badge_db_set_count(pkgname, caller, count);
+
+ } else {
+ ret = BADGE_ERROR_INVALID_DATA;
+ }
+
+ packet_reply = packet_create_reply(packet, "i", ret);
+ if (packet_reply) {
+ service_common_unicast_packet(tcb, packet_reply);
+ packet_destroy(packet_reply);
+ }
+
+ if (ret == BADGE_ERROR_NONE) {
+ packet_service = packet_create("set_badge_count", "isi", ret, pkgname, count);
+ if (packet_service != NULL) {
+ service_common_multicast_packet(tcb, packet_service, TCB_CLIENT_TYPE_SERVICE);
+ packet_destroy(packet_service);
+ }
+ }
+ } else {
+ ErrPrint("Failed to get data from the packet");
+ }
+}
+
+static void _handler_set_display_option(struct tcb *tcb, struct packet *packet, void *data)
+{
+ int ret = 0;
+ struct packet *packet_reply = NULL;
+ struct packet *packet_service = NULL;
+ char *pkgname = NULL;
+ char *caller = NULL;
+ int is_display = 0;
+
+ if (packet_get(packet, "ssi", &pkgname, &caller, &is_display) == 3) {
+ pkgname = get_string(pkgname);
+ caller = get_string(caller);
+
+ if (pkgname != NULL && caller != NULL) {
+ ret = badge_db_set_display_option(pkgname, caller, is_display);
+
+ } else {
+ ret = BADGE_ERROR_INVALID_DATA;
+ }
+
+ packet_reply = packet_create_reply(packet, "i", ret);
+ if (packet_reply) {
+ service_common_unicast_packet(tcb, packet_reply);
+ packet_destroy(packet_reply);
+ }
+
+ if (ret == BADGE_ERROR_NONE) {
+ packet_service = packet_create("set_disp_option", "isi", ret, pkgname, is_display);
+ if (packet_service != NULL) {
+ service_common_multicast_packet(tcb, packet_service, TCB_CLIENT_TYPE_SERVICE);
+ packet_destroy(packet_service);
+ }
+ }
+ } else {
+ ErrPrint("Failed to get data from the packet");
+ }
+}
+
+static void _handler_service_register(struct tcb *tcb, struct packet *packet, void *data)
+{
+ struct packet *packet_reply;
+ int ret;
+
+ ret = tcb_client_type_set(tcb, TCB_CLIENT_TYPE_SERVICE);
+
+ packet_reply = packet_create_reply(packet, "i", ret);
+ if (packet_reply) {
+ service_common_unicast_packet(tcb, packet_reply);
+ packet_destroy(packet_reply);
+ }
+}
+
+/*!
+ * SERVICE THREAD
+ */
+static int service_thread_main(struct tcb *tcb, struct packet *packet, void *data)
+{
+ int i = 0;
+ const char *command;
+ static struct noti_service service_req_table[] = {
+ {
+ .cmd = "insert_badge",
+ .handler = _handler_insert_badge,
+ },
+ {
+ .cmd = "delete_badge",
+ .handler = _handler_delete_badge,
+ },
+ {
+ .cmd = "set_badge_count",
+ .handler = _handler_set_badge_count,
+ },
+ {
+ .cmd = "set_disp_option",
+ .handler = _handler_set_display_option,
+ },
+ {
+ .cmd = "service_register",
+ .handler = _handler_service_register,
+ },
+ {
+ .cmd = NULL,
+ .handler = NULL,
+ },
+ };
+
+ DbgPrint("TCB: %p, Packet: %p\n", tcb, packet);
+
+ command = packet_command(packet);
+ if (!command) {
+ ErrPrint("Invalid command\n");
+ return -EINVAL;
+ }
+ DbgPrint("Command: %s, Packet type[%d]\n", command, packet_type(packet));
+
+ switch (packet_type(packet)) {
+ case PACKET_REQ:
+ /* Need to send reply packet */
+ DbgPrint("REQ: Command: [%s]\n", command);
+
+ for (i = 0; service_req_table[i].cmd; i++) {
+ if (strcmp(service_req_table[i].cmd, command))
+ continue;
+
+ service_req_table[i].handler(tcb, packet, data);
+ break;
+ }
+
+ break;
+ case PACKET_REQ_NOACK:
+ break;
+ case PACKET_ACK:
+ break;
+ default:
+ ErrPrint("Packet type is not valid[%s]\n", command);
+ return -EINVAL;
+ }
+
+ /*!
+ * return value has no meanning,
+ * it will be printed by dlogutil.
+ */
+ return 0;
+}
+
+
+/*!
+ * MAIN THREAD
+ * Do not try to do anyother operation in these functions
+ */
+HAPI int badge_service_init(void)
+{
+ if (s_info.svc_ctx) {
+ ErrPrint("Already initialized\n");
+ return LB_STATUS_ERROR_ALREADY;
+ }
+
+ s_info.svc_ctx = service_common_create(BADGE_ADDR, service_thread_main, NULL);
+ if (!s_info.svc_ctx) {
+ ErrPrint("Unable to activate service thread\n");
+ return LB_STATUS_ERROR_FAULT;
+ }
+
+ DbgPrint("Successfully initiated\n");
+ return LB_STATUS_SUCCESS;
+}
+
+HAPI int badge_service_fini(void)
+{
+ if (!s_info.svc_ctx)
+ return LB_STATUS_ERROR_INVALID;
+
+ service_common_destroy(s_info.svc_ctx);
+ DbgPrint("Successfully Finalized\n");
+ return LB_STATUS_SUCCESS;
+}
+
+/* End of a file */
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
s_info.pixmap_list = eina_list_remove(s_info.pixmap_list, buffer);
+ info = buffer->info;
+
if (destroy_gem(buffer) < 0)
ErrPrint("Failed to destroy gem buffer\n");
if (destroy_pixmap(buffer) < 0)
ErrPrint("Failed to destroy pixmap\n");
- info = buffer->info;
if (info && info->buffer == buffer)
info->buffer = NULL;
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
return LB_STATUS_ERROR_IO;
if (gettimeofday(&tv, NULL) < 0) {
+ ErrPrint("gettimeofday: %s\n", strerror(errno));
tv.tv_sec = 0;
tv.tv_usec = 0;
}
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
if (ecore_timer_interval_get(inst->update_timer) <= 1.0f)
return;
- gettimeofday(&tv, NULL);
+ if (gettimeofday(&tv, NULL) < 0) {
+ ErrPrint("gettimeofday: %s\n", strerror(errno));
+ tv.tv_sec = 0;
+ tv.tv_usec = 0;
+ }
inst->sleep_at = (double)tv.tv_sec + (double)tv.tv_usec / 1000000.0f;
}
snprintf(inst->id, len, SCHEMA_FILE "%s%s_%d_%lf.png", IMAGE_PATH, package_name(info), client_pid(inst->client), inst->timestamp);
inst->lb.auto_launch = package_auto_launch(info);
- instance_set_pd_info(inst, package_pd_width(info), package_pd_height(info));
+ instance_set_pd_size(inst, package_pd_width(info), package_pd_height(info));
inst->lb.timeout = package_timeout(info);
inst->lb.period = package_period(info);
* just increase the loaded instance counter
* And then reset jobs.
*/
- instance_set_lb_info(inst, w, h, priority, content, title);
+ instance_set_lb_size(inst, w, h);
+ instance_set_lb_info(inst, priority, content, title);
inst->state = INST_ACTIVATED;
if (package_pd_type(inst->info) == PD_TYPE_SCRIPT) {
if (inst->pd.width == 0 && inst->pd.height == 0)
- instance_set_pd_info(inst, package_pd_width(inst->info), package_pd_height(inst->info));
+ instance_set_pd_size(inst, package_pd_width(inst->info), package_pd_height(inst->info));
inst->pd.canvas.script = script_handler_create(inst,
package_pd_path(inst->info),
HAPI int instance_create_pd_buffer(struct inst_info *inst)
{
if (inst->pd.width == 0 && inst->pd.height == 0)
- instance_set_pd_info(inst, package_pd_width(inst->info), package_pd_height(inst->info));
+ instance_set_pd_size(inst, package_pd_width(inst->info), package_pd_height(inst->info));
if (!inst->pd.canvas.buffer) {
inst->pd.canvas.buffer = buffer_handler_create(inst, s_info.env_buf_type, inst->pd.width, inst->pd.height, sizeof(int));
return inst->active_update;
}
-HAPI void instance_set_lb_info(struct inst_info *inst, int w, int h, double priority, const char *content, const char *title)
+HAPI void instance_set_lb_info(struct inst_info *inst, double priority, const char *content, const char *title)
{
char *_content = NULL;
char *_title = NULL;
if (priority >= 0.0f && priority <= 1.0f)
inst->lb.priority = priority;
+}
+HAPI void instance_set_lb_size(struct inst_info *inst, int w, int h)
+{
if (inst->lb.width != w || inst->lb.height != h)
instance_send_resized_event(inst, IS_LB, w, h, LB_STATUS_SUCCESS);
inst->lb.height = h;
}
-HAPI void instance_set_pd_info(struct inst_info *inst, int w, int h)
+HAPI void instance_set_pd_size(struct inst_info *inst, int w, int h)
{
if (inst->pd.width != w || inst->pd.height != h)
instance_send_resized_event(inst, IS_PD, w, h, LB_STATUS_SUCCESS);
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
#include "critical_log.h"
#include "event.h"
#include "shortcut_service.h"
+#include "notification_service.h"
+#include "badge_service.h"
#if defined(FLOG)
FILE *__file_log_fp;
(void)util_unlink_files(SLAVE_LOG_PATH);
shortcut_service_init();
+ notification_service_init();
+ badge_service_init();
script_init();
app_create();
app_terminate();
script_fini();
+ badge_service_fini();
+ notification_service_fini();
shortcut_service_fini();
ecore_evas_shutdown();
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+#include <stdio.h>
+#include <Eina.h>
+
+#include <dlog.h>
+#include <livebox-errno.h>
+#include <packet.h>
+
+#include <notification_ipc.h>
+#include <notification_noti.h>
+#include <notification_error.h>
+
+#include "service_common.h"
+#include "debug.h"
+#include "util.h"
+#include "conf.h"
+
+#ifndef NOTIFICATION_ADDR
+#define NOTIFICATION_ADDR "/tmp/.notification.service"
+#endif
+
+#ifndef NOTIFICATION_DEL_PACKET_UNIT
+#define NOTIFICATION_DEL_PACKET_UNIT 10
+#endif
+
+static struct info {
+ Eina_List *context_list;
+ struct service_context *svc_ctx;
+} s_info = {
+ .context_list = NULL, /*!< \WARN: This is only used for SERVICE THREAD */
+ .svc_ctx = NULL, /*!< \WARN: This is only used for MAIN THREAD */
+};
+
+struct context {
+ struct tcb *tcb;
+ double seq;
+};
+
+struct noti_service {
+ const char *cmd;
+ void (*handler)(struct tcb *tcb, struct packet *packet, void *data);
+};
+
+/*!
+ * FUNCTIONS to handle notifcation
+ */
+static inline int get_priv_id(int num_deleted, int *list_deleted, int index) {
+ if (index < num_deleted) {
+ return *(list_deleted + index);
+ } else {
+ return -1;
+ }
+}
+
+static inline char *get_string(char *string)
+{
+ if (string == NULL) {
+ return NULL;
+ }
+ if (string[0] == '\0') {
+ return NULL;
+ }
+
+ return string;
+}
+
+static inline struct packet *create_packet_from_deleted_list(int op_num, int *list, int start_index) {
+ return packet_create(
+ "del_noti_multiple",
+ "iiiiiiiiiii",
+ ((op_num - start_index) > NOTIFICATION_DEL_PACKET_UNIT) ? NOTIFICATION_DEL_PACKET_UNIT : op_num - start_index,
+ get_priv_id(op_num, list, start_index),
+ get_priv_id(op_num, list, start_index + 1),
+ get_priv_id(op_num, list, start_index + 2),
+ get_priv_id(op_num, list, start_index + 3),
+ get_priv_id(op_num, list, start_index + 4),
+ get_priv_id(op_num, list, start_index + 5),
+ get_priv_id(op_num, list, start_index + 6),
+ get_priv_id(op_num, list, start_index + 7),
+ get_priv_id(op_num, list, start_index + 8),
+ get_priv_id(op_num, list, start_index + 9)
+ );
+}
+
+/*!
+ * SERVICE HANDLER
+ */
+static void _handler_insert(struct tcb *tcb, struct packet *packet, void *data)
+{
+ int ret = 0;
+ int priv_id = 0;
+ struct packet *packet_reply = NULL;
+ struct packet *packet_service = NULL;
+ notification_h noti = NULL;
+
+ noti = notification_create(NOTIFICATION_TYPE_NOTI);
+ if (noti != NULL) {
+ if (notification_ipc_make_noti_from_packet(noti, packet) == NOTIFICATION_ERROR_NONE) {
+ ret = notification_noti_insert(noti);
+ if (ret != NOTIFICATION_ERROR_NONE) {
+ ErrPrint("failed to insert a notification\n");
+ notification_free(noti);
+ return ;
+ }
+
+ notification_get_id(noti, NULL, &priv_id);
+ DbgPrint("priv_id: [%d]\n", priv_id);
+ packet_reply = packet_create_reply(packet, "ii", ret, priv_id);
+ if (packet_reply) {
+ service_common_unicast_packet(tcb, packet_reply);
+ packet_destroy(packet_reply);
+ }
+
+ packet_service = notification_ipc_make_packet_from_noti(noti, "add_noti", 2);
+ if (packet_service != NULL) {
+ service_common_multicast_packet(tcb, packet_service, TCB_CLIENT_TYPE_SERVICE);
+ packet_destroy(packet_service);
+ }
+ } else {
+ ErrPrint("Failed to create the packet");
+ }
+ notification_free(noti);
+ }
+}
+
+static void _handler_update(struct tcb *tcb, struct packet *packet, void *data)
+{
+ int ret = 0;
+ int priv_id = 0;
+ struct packet *packet_reply = NULL;
+ struct packet *packet_service = NULL;
+ notification_h noti = NULL;
+
+ noti = notification_create(NOTIFICATION_TYPE_NOTI);
+ if (noti != NULL) {
+ if (notification_ipc_make_noti_from_packet(noti, packet) == NOTIFICATION_ERROR_NONE) {
+ ret = notification_noti_update(noti);
+ if (ret != NOTIFICATION_ERROR_NONE) {
+ ErrPrint("failed to update a notification\n");
+ notification_free(noti);
+ return ;
+ }
+
+ notification_get_id(noti, NULL, &priv_id);
+ DbgPrint("priv_id: [%d]\n", priv_id);
+ packet_reply = packet_create_reply(packet, "ii", ret, priv_id);
+ if (packet_reply) {
+ service_common_unicast_packet(tcb, packet_reply);
+ packet_destroy(packet_reply);
+ }
+
+ packet_service = notification_ipc_make_packet_from_noti(noti, "update_noti", 2);
+ if (packet_service != NULL) {
+ service_common_multicast_packet(tcb, packet_service, TCB_CLIENT_TYPE_SERVICE);
+ packet_destroy(packet_service);
+ }
+ } else {
+ ErrPrint("Failed to create the packet");
+ }
+ notification_free(noti);
+ }
+}
+
+static void _handler_refresh(struct tcb *tcb, struct packet *packet, void *data)
+{
+ int ret = NOTIFICATION_ERROR_NONE;
+ struct packet *packet_reply = NULL;
+
+ packet_reply = packet_create_reply(packet, "i", ret);
+ if (packet_reply) {
+ service_common_unicast_packet(tcb, packet_reply);
+ packet_destroy(packet_reply);
+ }
+
+ service_common_multicast_packet(tcb, packet, TCB_CLIENT_TYPE_SERVICE);
+}
+
+static void _handler_delete_single(struct tcb *tcb, struct packet *packet, void *data)
+{
+ int ret = 0;
+ int priv_id = 0;
+ struct packet *packet_reply = NULL;
+ struct packet *packet_service = NULL;
+ char *pkgname = NULL;
+
+ if (packet_get(packet, "si", &pkgname, &priv_id) == 2) {
+ pkgname = get_string(pkgname);
+
+ ret = notification_noti_delete_by_priv_id(pkgname, priv_id);
+
+ DbgPrint("priv_id: [%d]\n", priv_id);
+ packet_reply = packet_create_reply(packet, "ii", ret, priv_id);
+ if (packet_reply) {
+ service_common_unicast_packet(tcb, packet_reply);
+ packet_destroy(packet_reply);
+ }
+
+ packet_service = packet_create("del_noti_single", "ii", 1, priv_id);
+ if (packet_service != NULL) {
+ service_common_multicast_packet(tcb, packet_service, TCB_CLIENT_TYPE_SERVICE);
+ packet_destroy(packet_service);
+ }
+ } else {
+ ErrPrint("Failed to get data from the packet");
+ }
+}
+
+static void _handler_delete_multiple(struct tcb *tcb, struct packet *packet, void *data)
+{
+ int ret = 0;
+ struct packet *packet_reply = NULL;
+ struct packet *packet_service = NULL;
+ char *pkgname = NULL;
+ notification_type_e type = 0;
+ int num_deleted = 0;
+ int *list_deleted = NULL;
+
+ if (packet_get(packet, "si", &pkgname, &type) == 2) {
+ pkgname = get_string(pkgname);
+ DbgPrint("pkgname: [%s] type: [%d]\n", pkgname, type);
+
+ ret = notification_noti_delete_all(type, pkgname, &num_deleted, &list_deleted);
+ DbgPrint("ret: [%d] num_deleted: [%d]\n", ret, num_deleted);
+
+ packet_reply = packet_create_reply(packet, "ii", ret, num_deleted);
+ if (packet_reply) {
+ service_common_unicast_packet(tcb, packet_reply);
+ packet_destroy(packet_reply);
+ }
+
+ if (num_deleted > 0) {
+ if (num_deleted <= NOTIFICATION_DEL_PACKET_UNIT) {
+ packet_service = create_packet_from_deleted_list(num_deleted, list_deleted, 0);
+
+ if (packet_service) {
+ service_common_multicast_packet(tcb, packet_service, TCB_CLIENT_TYPE_SERVICE);
+ packet_destroy(packet_service);
+ }
+ } else {
+ int set = 0;
+ int set_total = num_deleted / NOTIFICATION_DEL_PACKET_UNIT;
+
+ for (set = 0; set <= set_total; set++) {
+ packet_service = create_packet_from_deleted_list(num_deleted,
+ list_deleted, set * NOTIFICATION_DEL_PACKET_UNIT);
+
+ if (packet_service) {
+ service_common_multicast_packet(tcb, packet_service, TCB_CLIENT_TYPE_SERVICE);
+ packet_destroy(packet_service);
+ }
+ }
+ }
+ }
+
+ if (list_deleted != NULL) {
+ free(list_deleted);
+ list_deleted = NULL;
+ }
+ } else {
+ ErrPrint("Failed to get data from the packet");
+ }
+}
+
+static void _handler_service_register(struct tcb *tcb, struct packet *packet, void *data)
+{
+ struct packet *packet_reply;
+ int ret;
+
+ ret = tcb_client_type_set(tcb, TCB_CLIENT_TYPE_SERVICE);
+
+ packet_reply = packet_create_reply(packet, "i", ret);
+ if (packet_reply) {
+ service_common_unicast_packet(tcb, packet_reply);
+ packet_destroy(packet_reply);
+ }
+}
+
+/*!
+ * SERVICE THREAD
+ */
+static int service_thread_main(struct tcb *tcb, struct packet *packet, void *data)
+{
+ int i = 0;
+ const char *command;
+ static struct noti_service service_req_table[] = {
+ {
+ .cmd = "add_noti",
+ .handler = _handler_insert,
+ },
+ {
+ .cmd = "update_noti",
+ .handler = _handler_update,
+ },
+ {
+ .cmd = "refresh_noti",
+ .handler = _handler_refresh,
+ },
+ {
+ .cmd = "del_noti_single",
+ .handler = _handler_delete_single,
+ },
+ {
+ .cmd = "del_noti_multiple",
+ .handler = _handler_delete_multiple,
+ },
+ {
+ .cmd = "service_register",
+ .handler = _handler_service_register,
+ },
+ {
+ .cmd = NULL,
+ .handler = NULL,
+ },
+ };
+
+ DbgPrint("TCB: %p, Packet: %p\n", tcb, packet);
+
+ command = packet_command(packet);
+ if (!command) {
+ ErrPrint("Invalid command\n");
+ return -EINVAL;
+ }
+ DbgPrint("Command: %s, Packet type[%d]\n", command, packet_type(packet));
+
+ switch (packet_type(packet)) {
+ case PACKET_REQ:
+ /* Need to send reply packet */
+ DbgPrint("REQ: Command: [%s]\n", command);
+
+ for (i = 0; service_req_table[i].cmd; i++) {
+ if (strcmp(service_req_table[i].cmd, command))
+ continue;
+
+ service_req_table[i].handler(tcb, packet, data);
+ break;
+ }
+
+ break;
+ case PACKET_REQ_NOACK:
+ break;
+ case PACKET_ACK:
+ break;
+ default:
+ ErrPrint("Packet type is not valid[%s]\n", command);
+ return -EINVAL;
+ }
+
+ /*!
+ * return value has no meanning,
+ * it will be printed by dlogutil.
+ */
+ return 0;
+}
+
+
+/*!
+ * MAIN THREAD
+ * Do not try to do anyother operation in these functions
+ */
+HAPI int notification_service_init(void)
+{
+ if (s_info.svc_ctx) {
+ ErrPrint("Already initialized\n");
+ return LB_STATUS_ERROR_ALREADY;
+ }
+
+ s_info.svc_ctx = service_common_create(NOTIFICATION_ADDR, service_thread_main, NULL);
+ if (!s_info.svc_ctx) {
+ ErrPrint("Unable to activate service thread\n");
+ return LB_STATUS_ERROR_FAULT;
+ }
+
+ DbgPrint("Successfully initiated\n");
+ return LB_STATUS_SUCCESS;
+}
+
+HAPI int notification_service_fini(void)
+{
+ if (!s_info.svc_ctx)
+ return LB_STATUS_ERROR_INVALID;
+
+ service_common_destroy(s_info.svc_ctx);
+ DbgPrint("Successfully Finalized\n");
+ return LB_STATUS_SUCCESS;
+}
+
+/* End of a file */
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
struct script_port *port;
void *port_data;
+
+ Eina_List *cached_blocks;
};
+static inline void consuming_parsed_block(int lineno, struct inst_info *inst, int is_pd, struct block *block);
+
static inline struct script_port *find_port(const char *magic_id)
{
Eina_List *l;
return NULL;
}
+static inline void delete_block(struct block *block)
+{
+ DbgFree(block->file);
+ DbgFree(block->type);
+ DbgFree(block->part);
+ DbgFree(block->data);
+ DbgFree(block->option);
+ DbgFree(block->id);
+ DbgFree(block->target_id);
+ DbgFree(block);
+}
+
static void render_pre_cb(void *data, Evas *e, void *event_info)
{
struct inst_info *inst = data;
return ret;
}
+static inline void flushing_cached_block(struct script_info *info)
+{
+ struct block *block;
+
+ EINA_LIST_FREE(info->cached_blocks, block) {
+ consuming_parsed_block(-1, info->inst, (instance_pd_script(info->inst) == info), block);
+ }
+}
+
HAPI int script_handler_load(struct script_info *info, int is_pd)
{
int ret;
return LB_STATUS_ERROR_FAULT;
}
info->loaded = 1;
+ flushing_cached_block(info);
script_signal_emit(e, util_uri_to_path(instance_id(info->inst)),
is_pd ? "pd,show" : "lb,show", 0.0f, 0.0f, 0.0f, 0.0f);
} else {
HAPI int script_handler_destroy(struct script_info *info)
{
+ struct block *block;
if (!info || !info->port) {
ErrPrint("port is not valid\n");
return LB_STATUS_ERROR_INVALID;
ErrPrint("Failed to destroy port, but go ahead\n");
fb_destroy(info->fb);
+
+ EINA_LIST_FREE(info->cached_blocks, block) {
+ delete_block(block);
+ }
DbgFree(info);
return LB_STATUS_SUCCESS;
}
ErrPrint("Evas(nil) resize to %dx%d\n", w, h);
}
- if (info->w != w || info->h != h) {
- if (instance_lb_script(info->inst) == info) {
- instance_set_lb_info(info->inst, w, h, PRIORITY_NO_CHANGE, CONTENT_NO_CHANGE, TITLE_NO_CHANGE);
- } else if (instance_pd_script(info->inst) == info) {
- instance_set_pd_info(info->inst, w, h);
- } else {
- ErrPrint("Script is not known\n");
- }
+ if (instance_lb_script(info->inst) == info) {
+ instance_set_lb_size(info->inst, w, h);
+ } else if (instance_pd_script(info->inst) == info) {
+ instance_set_pd_size(info->inst, w, h);
+ } else {
+ ErrPrint("Script is not known\n");
}
info->w = w;
return LB_STATUS_SUCCESS;
}
-HAPI int script_handler_parse_desc(const char *pkgname, const char *id, const char *descfile, int is_pd)
+static inline void consuming_parsed_block(int lineno, struct inst_info *inst, int is_pd, struct block *block)
{
- struct inst_info *inst;
- FILE *fp;
- int ch;
- int lineno;
- enum state {
- UNKNOWN = 0x10,
- BLOCK_OPEN = 0x11,
- FIELD = 0x12,
- VALUE = 0x13,
- BLOCK_CLOSE = 0x14,
-
- VALUE_TYPE = 0x00,
- VALUE_PART = 0x01,
- VALUE_DATA = 0x02,
- VALUE_FILE = 0x03,
- VALUE_OPTION = 0x04,
- VALUE_ID = 0x05,
- VALUE_TARGET = 0x06,
- };
- const char *field_name[] = {
- "type",
- "part",
- "data",
- "file",
- "option",
- "id",
- "target",
- NULL
- };
- enum state state;
- register int field_idx;
- register int idx = 0;
- register int i;
- struct block *block;
- struct {
+ struct script_info *info;
+ /*!
+ * To speed up, use the static.
+ * But this will increase the memory slightly.
+ */
+ static struct {
const char *type;
int (*handler)(struct inst_info *inst, struct block *block, int is_pd);
} handlers[] = {
},
};
+ info = is_pd ? instance_pd_script(inst) : instance_lb_script(inst);
+ if (!info) {
+ ErrPrint("info is NIL (%d, %s)\n", is_pd, instance_id(inst));
+ goto free_out;
+ }
+
+ if (script_handler_is_loaded(info)) {
+ register int i = 0;
+
+ while (handlers[i].type) {
+ if (!strcasecmp(handlers[i].type, block->type)) {
+ handlers[i].handler(inst, block, is_pd);
+ break;
+ }
+ i++;
+ }
+
+ if (!handlers[i].type)
+ ErrPrint("%d: Unknown block type: %s\n", lineno, block->type);
+
+ goto free_out;
+ } else {
+ info->cached_blocks = eina_list_append(info->cached_blocks, block);
+ DbgPrint("%d: Block is cached (%p), %d, %s\n", lineno, block, eina_list_count(info->cached_blocks), instance_id(inst));
+ }
+
+ return;
+
+free_out:
+ delete_block(block);
+}
+
+HAPI int script_handler_parse_desc(const char *pkgname, const char *id, const char *descfile, int is_pd)
+{
+ struct inst_info *inst;
+ FILE *fp;
+ int ch;
+ int lineno;
+ enum state {
+ UNKNOWN = 0x10,
+ BLOCK_OPEN = 0x11,
+ FIELD = 0x12,
+ VALUE = 0x13,
+ BLOCK_CLOSE = 0x14,
+
+ VALUE_TYPE = 0x00,
+ VALUE_PART = 0x01,
+ VALUE_DATA = 0x02,
+ VALUE_FILE = 0x03,
+ VALUE_OPTION = 0x04,
+ VALUE_ID = 0x05,
+ VALUE_TARGET = 0x06,
+ };
+ const char *field_name[] = {
+ "type",
+ "part",
+ "data",
+ "file",
+ "option",
+ "id",
+ "target",
+ NULL
+ };
+ enum state state;
+ register int field_idx;
+ register int idx = 0;
+ struct block *block;
+
block = NULL;
inst = package_find_instance_by_id(pkgname, id);
if (!inst) {
return LB_STATUS_ERROR_IO;
}
+ DbgPrint("Parsing %s\n", descfile);
+
state = UNKNOWN;
field_idx = 0;
lineno = 1;
}
}
- i = 0;
- while (handlers[i].type) {
- if (!strcasecmp(handlers[i].type, block->type)) {
- handlers[i].handler(inst, block, is_pd);
- break;
- }
- i++;
- }
-
- if (!handlers[i].type)
- ErrPrint("%d: Unknown block type: %s\n", lineno, block->type);
-
- DbgFree(block->file);
- DbgFree(block->type);
- DbgFree(block->part);
- DbgFree(block->data);
- DbgFree(block->option);
- DbgFree(block->id);
- DbgFree(block->target_id);
- DbgFree(block);
- block = NULL;
-
+ consuming_parsed_block(lineno, inst, is_pd, block);
state = UNKNOWN;
break;
errout:
ErrPrint("Parse error at %d file %s\n", lineno, util_basename(descfile));
- if (block) {
- DbgFree(block->file);
- DbgFree(block->type);
- DbgFree(block->part);
- DbgFree(block->data);
- DbgFree(block->option);
- DbgFree(block->id);
- DbgFree(block->target_id);
- DbgFree(block);
- }
+ if (block)
+ delete_block(block);
fclose(fp);
return LB_STATUS_ERROR_INVALID;
}
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
if (period > 0.0f && period < MINIMUM_PERIOD)
period = MINIMUM_PERIOD;
- if (!strlen(content))
- content = DEFAULT_CONTENT;
-
inst = instance_create(client, timestamp, lb_pkgname, content, cluster, category, period, width, height);
/*!
* \note
return NULL;
}
-static struct packet *client_pd_access_value_change(pid_t pid, int handle, const struct packet *packet)
+static struct packet *client_pd_access_action_up(pid_t pid, int handle, const struct packet *packet)
{
struct packet *result;
struct client_node *client;
goto out;
}
- script_handler_update_pointer(script, x, y, -1);
- ret = script_handler_feed_event(script, LB_SCRIPT_ACCESS_VALUE_CHANGE, timestamp);
+ script_handler_update_pointer(script, x, y, 0);
+ ret = script_handler_feed_event(script, LB_SCRIPT_ACCESS_ACTION, timestamp);
+ if (ret >= 0) {
+ struct access_cbdata *cbdata;
+
+ cbdata = malloc(sizeof(*cbdata));
+ if (!cbdata) {
+ ret = LB_STATUS_ERROR_MEMORY;
+ } else {
+ cbdata->inst = instance_ref(inst);
+ cbdata->status = ret;
+
+ if (!ecore_timer_add(DELAY_TIME, lazy_access_status_cb, cbdata)) {
+ instance_unref(cbdata->inst);
+ free(cbdata);
+ ret = LB_STATUS_ERROR_FAULT;
+ } else {
+ ret = LB_STATUS_SUCCESS;
+ }
+ }
+ }
+ } else {
+ ErrPrint("Unsupported package\n");
+ ret = LB_STATUS_ERROR_INVALID;
+ }
+
+out:
+ result = packet_create_reply(packet, "i", ret);
+ if (!result)
+ ErrPrint("Failed to create a reply packet\n");
+
+ return result;
+}
+
+static struct packet *client_pd_access_action_down(pid_t pid, int handle, const struct packet *packet)
+{
+ struct packet *result;
+ struct client_node *client;
+ const char *pkgname;
+ const char *id;
+ int ret;
+ double timestamp;
+ int x;
+ int y;
+ struct inst_info *inst;
+ const struct pkg_info *pkg;
+
+ client = client_find_by_pid(pid);
+ if (!client) {
+ ErrPrint("Client %d is not exists\n", pid);
+ ret = LB_STATUS_ERROR_NOT_EXIST;
+ goto out;
+ }
+
+ ret = packet_get(packet, "ssdii", &pkgname, &id, ×tamp, &x, &y);
+ if (ret != 5) {
+ ErrPrint("Invalid parameter\n");
+ ret = LB_STATUS_ERROR_INVALID;
+ goto out;
+ }
+
+ /*!
+ * \NOTE:
+ * Trust the package name which are sent by the client.
+ * The package has to be a livebox package name.
+ */
+ inst = package_find_instance_by_id(pkgname, id);
+ if (!inst) {
+ ErrPrint("Instance[%s] is not exists\n", id);
+ ret = LB_STATUS_ERROR_NOT_EXIST;
+ goto out;
+ }
+
+ pkg = instance_package(inst);
+ if (!pkg) {
+ ErrPrint("Package[%s] info is not found\n", pkgname);
+ ret = LB_STATUS_ERROR_FAULT;
+ goto out;
+ }
+
+ if (package_is_fault(pkg)) {
+ /*!
+ * \note
+ * If the package is registered as fault module,
+ * slave has not load it, so we don't need to do anything at here!
+ */
+ DbgPrint("Package[%s] is faulted\n", pkgname);
+ ret = LB_STATUS_ERROR_FAULT;
+ } else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
+ struct buffer_info *buffer;
+ struct slave_node *slave;
+ // struct packet *packet;
+
+ buffer = instance_pd_buffer(inst);
+ if (!buffer) {
+ ErrPrint("Instance[%s] has no buffer\n", id);
+ ret = LB_STATUS_ERROR_FAULT;
+ goto out;
+ }
+
+ slave = package_slave(pkg);
+ if (!slave) {
+ ErrPrint("Package[%s] has no slave\n", pkgname);
+ ret = LB_STATUS_ERROR_INVALID;
+ goto out;
+ }
+
+ /*
+ packet = packet_create_noack("pd_mouse_enter", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
+ if (!packet) {
+ ErrPrint("Failed to create a packet[%s]\n", pkgname);
+ ret = LB_STATUS_ERROR_FAULT;
+ goto out;
+ }
+ */
+
+ packet_ref((struct packet *)packet);
+ ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
+ } else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) {
+ struct script_info *script;
+ Evas *e;
+
+ script = instance_pd_script(inst);
+ if (!script) {
+ ret = LB_STATUS_ERROR_FAULT;
+ goto out;
+ }
+
+ e = script_handler_evas(script);
+ if (!e) {
+ ret = LB_STATUS_ERROR_FAULT;
+ goto out;
+ }
+
+ script_handler_update_pointer(script, x, y, 1);
+ ret = script_handler_feed_event(script, LB_SCRIPT_ACCESS_ACTION, timestamp);
if (ret >= 0) {
struct access_cbdata *cbdata;
return result;
}
-static struct packet *client_lb_access_value_change(pid_t pid, int handle, const struct packet *packet)
+static struct packet *client_lb_access_action_up(pid_t pid, int handle, const struct packet *packet)
{
struct packet *result;
struct client_node *client;
goto out;
}
- script_handler_update_pointer(script, x, y, -1);
- ret = script_handler_feed_event(script, LB_SCRIPT_ACCESS_VALUE_CHANGE, timestamp);
+ script_handler_update_pointer(script, x, y, 0);
+ ret = script_handler_feed_event(script, LB_SCRIPT_ACCESS_ACTION, timestamp);
+ if (ret >= 0) {
+ struct access_cbdata *cbdata;
+
+ cbdata = malloc(sizeof(*cbdata));
+ if (!cbdata) {
+ ret = LB_STATUS_ERROR_MEMORY;
+ } else {
+ cbdata->inst = instance_ref(inst);
+ cbdata->status = ret;
+
+ if (!ecore_timer_add(DELAY_TIME, lazy_access_status_cb, cbdata)) {
+ instance_unref(cbdata->inst);
+ free(cbdata);
+ ret = LB_STATUS_ERROR_FAULT;
+ } else {
+ ret = LB_STATUS_SUCCESS;
+ }
+ }
+ }
+ } else {
+ ErrPrint("Unsupported package\n");
+ ret = LB_STATUS_ERROR_INVALID;
+ }
+
+out:
+ result = packet_create_reply(packet, "i", ret);
+ if (!result)
+ ErrPrint("Failed to create a reply packet\n");
+
+ return result;
+}
+
+static struct packet *client_lb_access_action_down(pid_t pid, int handle, const struct packet *packet)
+{
+ struct packet *result;
+ struct client_node *client;
+ const char *pkgname;
+ const char *id;
+ int ret;
+ double timestamp;
+ struct inst_info *inst;
+ const struct pkg_info *pkg;
+ int x;
+ int y;
+
+ client = client_find_by_pid(pid);
+ if (!client) {
+ ErrPrint("Client %d is not exist\n", pid);
+ ret = LB_STATUS_ERROR_NOT_EXIST;
+ goto out;
+ }
+
+ ret = packet_get(packet, "ssdii", &pkgname, &id, ×tamp, &x, &y);
+ if (ret != 5) {
+ ErrPrint("Parameter is not matched\n");
+ ret = LB_STATUS_ERROR_INVALID;
+ goto out;
+ }
+
+ inst = package_find_instance_by_id(pkgname, id);
+ if (!inst) {
+ ErrPrint("Instance[%s] is not exists\n", id);
+ ret = LB_STATUS_ERROR_NOT_EXIST;
+ goto out;
+ }
+
+ pkg = instance_package(inst);
+ if (!pkg) {
+ ErrPrint("Package[%s] info is not exists\n", pkgname);
+ ret = LB_STATUS_ERROR_FAULT;
+ goto out;
+ }
+
+ if (package_is_fault(pkg)) {
+ ret = LB_STATUS_ERROR_FAULT;
+ } else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
+ struct buffer_info *buffer;
+ struct slave_node *slave;
+
+ buffer = instance_lb_buffer(inst);
+ if (!buffer) {
+ ErrPrint("Instance[%s] has no buffer\n", id);
+ ret = LB_STATUS_ERROR_FAULT;
+ goto out;
+ }
+
+ slave = package_slave(pkg);
+ if (!slave) {
+ ErrPrint("Slave is not exists\n");
+ ret = LB_STATUS_ERROR_INVALID;
+ goto out;
+ }
+
+ packet_ref((struct packet *)packet);
+ ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
+ /*!
+ * Enen if it fails to send packet,
+ * The packet will be unref'd
+ * So we don't need to check the ret value.
+ */
+ } else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) {
+ struct script_info *script;
+ Evas *e;
+
+ script = instance_lb_script(inst);
+ if (!script) {
+ ErrPrint("Instance has no script\n");
+ ret = LB_STATUS_ERROR_FAULT;
+ goto out;
+ }
+
+ e = script_handler_evas(script);
+ if (!e) {
+ ErrPrint("Script has no evas\n");
+ ret = LB_STATUS_ERROR_INVALID;
+ goto out;
+ }
+
+ script_handler_update_pointer(script, x, y, 1);
+ ret = script_handler_feed_event(script, LB_SCRIPT_ACCESS_ACTION, timestamp);
if (ret >= 0) {
struct access_cbdata *cbdata;
* Because this callback is called by the requests of clients.
* It means. some clients wants to handle this instances ;)
*/
- inst = instance_create(NULL, timestamp, pkgname, DEFAULT_CONTENT, c_name, s_name, DEFAULT_PERIOD, 0, 0);
+ inst = instance_create(NULL, timestamp, pkgname, "", c_name, s_name, DEFAULT_PERIOD, 0, 0);
if (!inst)
ErrPrint("Failed to create a new instance\n");
} else {
} else {
char *filename;
+ instance_set_lb_info(inst, priority, content_info, title);
+
switch (package_lb_type(instance_package(inst))) {
case LB_TYPE_SCRIPT:
script_handler_resize(instance_lb_script(inst), w, h);
* \check
* text format (inst)
*/
- instance_set_lb_info(inst, w, h, priority, content_info, title);
+ instance_set_lb_size(inst, w, h);
instance_lb_updated_by_instance(inst);
break;
}
}
break;
case PD_TYPE_TEXT:
- instance_set_pd_info(inst, 0, 0);
+ instance_set_pd_size(inst, 0, 0);
case PD_TYPE_BUFFER:
instance_pd_updated(pkgname, id, descfile);
break;
ret = buffer_handler_load(info);
if (ret == 0) {
- instance_set_lb_info(inst, w, h, PRIORITY_NO_CHANGE, CONTENT_NO_CHANGE, TITLE_NO_CHANGE);
+ instance_set_lb_size(inst, w, h);
+ instance_set_lb_info(inst, PRIORITY_NO_CHANGE, CONTENT_NO_CHANGE, TITLE_NO_CHANGE);
id = buffer_handler_id(info);
DbgPrint("Buffer handler ID: %s\n", id);
} else {
ret = buffer_handler_load(info);
if (ret == 0) {
- instance_set_pd_info(inst, w, h);
+ instance_set_pd_size(inst, w, h);
id = buffer_handler_id(info);
DbgPrint("Buffer handler ID: %s\n", id);
} else {
*/
if (!ret) {
id = buffer_handler_id(info);
- instance_set_lb_info(inst, w, h, PRIORITY_NO_CHANGE, CONTENT_NO_CHANGE, TITLE_NO_CHANGE);
+ instance_set_lb_size(inst, w, h);
+ instance_set_lb_info(inst, PRIORITY_NO_CHANGE, CONTENT_NO_CHANGE, TITLE_NO_CHANGE);
}
}
}
*/
if (!ret) {
id = buffer_handler_id(info);
- instance_set_pd_info(inst, w, h);
+ instance_set_pd_size(inst, w, h);
}
}
}
.handler = client_pd_access_activate,
},
{
- .cmd = "pd_access_value_change",
- .handler = client_pd_access_value_change,
+ .cmd = "pd_access_action_up",
+ .handler = client_pd_access_action_up,
+ },
+ {
+ .cmd = "pd_access_action_down",
+ .handler = client_pd_access_action_down,
},
{
.cmd = "pd_access_unhighlight",
.handler = client_lb_access_activate,
},
{
- .cmd = "lb_access_value_change",
- .handler = client_lb_access_value_change,
+ .cmd = "lb_access_action_up",
+ .handler = client_lb_access_action_up,
+ },
+ {
+ .cmd = "lb_access_action_down",
+ .handler = client_lb_access_action_down,
},
{
.cmd = "lb_access_unhighlight",
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
struct tcb *tcb;
int fd;
char evt_ch;
- Eina_List *l;
- Eina_List *n;
struct packet_info *packet_info;
DbgPrint("Server thread is activated\n");
* This only should be happenes while terminating the master daemon process.
*/
CRITICAL_SECTION_BEGIN(&svc_ctx->packet_list_lock);
- EINA_LIST_FOREACH_SAFE(svc_ctx->packet_list, l, n, packet_info) {
+ EINA_LIST_FREE(svc_ctx->packet_list, packet_info) {
ret = read(svc_ctx->evt_pipe[PIPE_READ], &evt_ch, sizeof(evt_ch));
DbgPrint("Flushing pipe: %d (%c)\n", ret, evt_ch);
- svc_ctx->packet_list = eina_list_remove(svc_ctx->packet_list, packet_info);
ret = svc_ctx->service_thread_main(packet_info->tcb, packet_info->packet, svc_ctx->service_thread_data);
if (ret < 0)
ErrPrint("Service thread returns: %d\n", ret);
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
slave_set_reactivation(slave, 0);
slave_set_reactivate_instances(slave, 0);
- if (gettimeofday(&slave->activated_at, NULL) < 0)
+ if (gettimeofday(&slave->activated_at, NULL) < 0) {
ErrPrint("Failed to get time of day: %s\n", strerror(errno));
+ slave->activated_at.tv_sec = 0;
+ slave->activated_at.tv_usec = 0;
+ }
if (slave->activate_timer) {
ecore_timer_del(slave->activate_timer);
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
-#include <sys/statvfs.h>
+#include <sys/vfs.h>
#include <sys/types.h>
#include <dirent.h>
#include <ctype.h>
return length <= 0 ? name : (name + length + (name[length] == '/'));
}
-HAPI unsigned long util_free_space(const char *path)
+/*!
+ * Return size of stroage in MegaBytes unit.
+ */
+HAPI unsigned long long util_free_space(const char *path)
{
- struct statvfs st;
- unsigned long space;
+ struct statfs st;
+ unsigned long long space;
- if (statvfs(path, &st) < 0) {
+ if (statfs(path, &st) < 0) {
ErrPrint("statvfs: %s\n", strerror(errno));
return 0lu;
}
- space = st.f_bsize * st.f_bfree;
- DbgPrint("Available size: %lu, f_bsize: %lu, f_bfree: %lu\n", space, st.f_bsize, st.f_bfree);
+ space = (unsigned long long)st.f_bsize * (unsigned long long)st.f_bavail;
+ DbgPrint("Available size: %llu, f_bsize: %lu, f_bavail: %lu\n", space, st.f_bsize, st.f_bavail);
/*!
* \note
* Must have to check the overflow
unsigned long long curtime;
unsigned long long _period;
unsigned long long remain;
- unsigned int sec;
- unsigned int usec;
double ret;
- gettimeofday(&tv, NULL);
- curtime = (unsigned long long)tv.tv_sec * 1000000llu + (unsigned long long)tv.tv_usec;
+ if (period == 0.0f) {
+ DbgPrint("Period is ZERO\n");
+ return 0.0f;
+ }
+
+ if (gettimeofday(&tv, NULL) < 0){
+ ErrPrint("gettimeofday: %s\n", strerror(errno));
+ return period;
+ }
- sec = (unsigned int)period;
- usec = (period - sec) * 1000000;
- _period = (unsigned long long)sec * 1000000llu + usec;
+ curtime = (unsigned long long)tv.tv_sec * 1000000llu + (unsigned long long)tv.tv_usec;
+ _period = (unsigned long long)(period * (double)1000000);
+ if (_period == 0llu) {
+ ErrPrint("%lf <> %llu\n", period, _period);
+ return period;
+ }
remain = curtime % _period;
- sec = (unsigned int)(remain / 1000000llu);
- usec = (unsigned int)(remain % 1000000llu);
-
- ret = (double)sec + (double)usec / 1000000.0f;
+ ret = (double)remain / (double)1000000;
+ DbgPrint("curtime: %llu, _period: %llu, remain: %llu, ret: %lf, result: %lf\n", curtime, _period, remain, ret, period - ret);
return period - ret;
}
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.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
*