iUpdate change log and spec for wrt-plugins-tizen_0.4.40
authorDongjin Choi <milkelf.choi@samsung.com>
Thu, 6 Jun 2013 14:59:56 +0000 (23:59 +0900)
committerDongjin Choi <milkelf.choi@samsung.com>
Thu, 6 Jun 2013 14:59:56 +0000 (23:59 +0900)
[model] REDWOOD
[binary_type] PDA
[customer] OPEN

[Systeminfo] Add 'inputKeyBack', 'inputKeyOption' attribute, remove SYSTEM_INFO_KEY_DEVICE_UUID key

[team] WebAPI
[request] N/A
[horizontal_expansion] N/A

UnitTest passed in 2.2 RC1 R2

packaging/wrt-plugins-tizen.spec
src/CMakeLists.txt
src/Log/CMakeLists.txt [deleted file]
src/Log/JSTizenLog.cpp [deleted file]
src/Log/JSTizenLog.h [deleted file]
src/Log/config.xml [deleted file]
src/Log/plugin_initializer.cpp [deleted file]
src/Systeminfo/JSDeviceCapabilitiesInfo.cpp
src/Systeminfo/JSDeviceCapabilitiesInfo.h
src/Systeminfo/SysteminfoPropertyInfo.h

index 8a9dc48..0a02448 100755 (executable)
@@ -1,7 +1,7 @@
 Name:       wrt-plugins-tizen
 Summary:    JavaScript plugins for WebRuntime
-Version:    0.4.39
-Release:    1
+Version:    0.4.40
+Release:    0
 Group:      Development/Libraries
 License:    Apache License, Version 2.0
 Source0:    %{name}-%{version}.tar.gz
index 7e0c62f..5f0f009 100755 (executable)
@@ -51,7 +51,6 @@ add_plugin(
        Callhistory
        Systeminfo
        NFC
-       Log
        Filesystem
        Alarm
        Power
diff --git a/src/Log/CMakeLists.txt b/src/Log/CMakeLists.txt
deleted file mode 100644 (file)
index 9113ab1..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-SET(TARGET_NAME ${log_target})
-SET(DESTINATION_NAME ${log_dest})
-
-set(SRCS_DEVICEINTERACTION
-       JSTizenLog.cpp
-       plugin_initializer.cpp
-
-)
-
-set(SRCS
-       ${SRCS_DEVICEINTERACTION}
-)
-
-include_directories(
-       ${INCLUDE_COMMON}
-       ${INCLUDES_PLATFORM_IMPLEMENTATION_HAPTICS}
-       ${INCLUDES_PLATFORM_IMPLEMENTATION_POWER}
-)
-
-add_library(${TARGET_NAME} SHARED ${SRCS})
-
-target_link_libraries(${TARGET_NAME}
-       ${LIBS_COMMON}
-)
-
-INSTALL(TARGETS ${TARGET_NAME} LIBRARY DESTINATION ${DESTINATION_LIB_PREFIX}/${DESTINATION_NAME})
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/config.xml DESTINATION ${DESTINATION_LIB_PREFIX}/${DESTINATION_NAME})
-INSTALL(
-       DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ DESTINATION ${DESTINATION_HEADER_PREFIX}/log
-       FILES_MATCHING PATTERN "*.h" PATTERN "CMakeFiles" EXCLUDE
-)
\ No newline at end of file
diff --git a/src/Log/JSTizenLog.cpp b/src/Log/JSTizenLog.cpp
deleted file mode 100755 (executable)
index 69bb0fd..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * 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. 
- */
-
-
-/**
- * @file        JSTizenLog
- * @author      Sang-tai Kim(sangtai.kim@samsung.com)
- * @version     0.1
- */
-
-#include <CommonsJavaScript/Converter.h>
-#include <CommonsJavaScript/Validator.h>
-#include <CommonsJavaScript/JSCallbackManager.h>
-#include <CommonsJavaScript/JSUtils.h>
-#include <CommonsJavaScript/JSDOMExceptionFactory.h>
-#include <CommonsJavaScript/Utils.h>
-
-#include "JSTizenLog.h"
-
-#include <dlog.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "TIZEN"
-
-#define EXCEPTION_COLOR    "\033[1;31;40m"  //bold and red
-#define ASSERT_COLOR       "\033[1;31;40m"  //bold and red
-
-#define GREEN_COLOR        "\033[0;32;40m"  //normal and green
-#define NORMAL_COLOR       "\033[0m"        //system default
-#define RED_COLOR          "\033[0;31;40m"  //normal and red
-#define YELLOW_COLOR       "\033[0;33m"     //normal and yellow
-#define BLUE_COLOR         "\033[0;34m"     //normal and blue
-#define MAGENTA_COLOR      "\033[0;35;40m"  //normal and magenta
-#define CYAN_COLOR         "\033[0;36;40m"  //normal and cyan
-
-#define TIZEN_DEBUG(FM,ARG...)   {LOGD("%s[%s]%s" FM, GREEN_COLOR,  __FUNCTION__, NORMAL_COLOR, ##ARG);}
-#define TIZEN_INFO(FM,ARG...)    {LOGI("%s[%s]%s" FM, CYAN_COLOR,   __FUNCTION__, NORMAL_COLOR, ##ARG);}
-#define TIZEN_WANING(FM,ARG...)  {LOGW("%s[%s]%s" FM, YELLOW_COLOR, __FUNCTION__, NORMAL_COLOR, ##ARG);}
-#define TIZEN_ERROR(FM,ARG...)   {LOGE("%s[%s]%s" FM, RED_COLOR,    __FUNCTION__, NORMAL_COLOR, ##ARG);}
-
-namespace DeviceAPI {
-namespace Log {
-
-using namespace WrtDeviceApis::Commons;
-using namespace WrtDeviceApis;
-
-JSClassDefinition JSTizenLog::m_classInfo =
-{
-    0,
-    kJSClassAttributeNone,
-    "log",
-    0,
-    NULL,
-    m_function,
-    initialize,
-    finalize,
-    NULL, //hasProperty,
-    NULL, //getProperty,
-    NULL, //setProperty,
-    NULL, //DeleteProperty,
-    NULL, //GetPropertyNames,
-    NULL, //CallAsFunction,
-    NULL, //CallAsConstructor,
-    NULL, //HasInstance,
-    NULL, //ConvertToType
-};
-
-const JSClassRef JSTizenLog::getClassRef() {
-    if (!m_jsClassRef) {
-        m_jsClassRef = JSClassCreate(&m_classInfo);
-    }
-    return m_jsClassRef;
-}
-
-const JSClassDefinition* JSTizenLog::getClassInfo() {
-    return &m_classInfo;
-}
-
-JSStaticFunction JSTizenLog::m_function[] = {
-    { "debug",    JSTizenLog::logDebug,   kJSPropertyAttributeNone},
-    { "info",     JSTizenLog::logInfo,    kJSPropertyAttributeNone},
-    { "warning",  JSTizenLog::logWarning, kJSPropertyAttributeNone},
-    { "error",    JSTizenLog::logError,   kJSPropertyAttributeNone},
-    { 0, 0, 0 }
-};
-
-JSClassRef JSTizenLog::m_jsClassRef =
-  JSClassCreate(JSTizenLog::getClassInfo());
-
-
-void JSTizenLog::initialize(JSContextRef context, JSObjectRef object) {
-//    TIZEN_DEBUG("<<<");
-}
-
-void JSTizenLog::finalize(JSObjectRef object) {
-//    TIZEN_DEBUG("<<<");
-}
-
-JSValueRef JSTizenLog::logDebug(JSContextRef context, JSObjectRef object,
-               JSObjectRef thisObject, size_t argc, const JSValueRef argv[],
-               JSValueRef* exception) {
-
-       CommonsJavaScript::Converter converter(context);
-       std::string pattern = converter.toString(argv[0]);
-
-       TIZEN_DEBUG("[%s]", pattern.c_str());
-
-       return JSValueMakeUndefined(context);
-}
-
-JSValueRef JSTizenLog::logInfo(JSContextRef context, JSObjectRef object,
-               JSObjectRef thisObject, size_t argc, const JSValueRef argv[],
-               JSValueRef* exception) {
-
-       CommonsJavaScript::Converter converter(context);
-       std::string pattern = converter.toString(argv[0]);
-
-       TIZEN_INFO("[%s]", pattern.c_str());
-
-       return JSValueMakeUndefined(context);
-}
-
-JSValueRef JSTizenLog::logWarning(JSContextRef context, JSObjectRef object,
-               JSObjectRef thisObject, size_t argc, const JSValueRef argv[],
-               JSValueRef* exception) {
-
-       CommonsJavaScript::Converter converter(context);
-       std::string pattern = converter.toString(argv[0]);
-
-       TIZEN_WANING("[%s]", pattern.c_str());
-
-       return JSValueMakeUndefined(context);
-}
-
-JSValueRef JSTizenLog::logError(JSContextRef context, JSObjectRef object,
-               JSObjectRef thisObject, size_t argc, const JSValueRef argv[],
-               JSValueRef* exception) {
-
-       CommonsJavaScript::Converter converter(context);
-       std::string pattern = converter.toString(argv[0]);
-
-       TIZEN_ERROR("[%s]", pattern.c_str());
-
-       return JSValueMakeUndefined(context);
-}
-
-} // Log
-} // DeviceAPI
diff --git a/src/Log/JSTizenLog.h b/src/Log/JSTizenLog.h
deleted file mode 100644 (file)
index 0eba518..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * 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. 
- */
-
-
-/**
- * @file        JSTizenLog.h
- * @author      Sang-tai Kim(sangtai.kim@samsung.com)
- * @version     0.1
- */
-
-
-#ifndef _JS_TIZEN_LOG_H_
-#define _JS_TIZEN_LOG_H_
-
-#include <JavaScriptCore/JavaScript.h>
-
-namespace DeviceAPI {
-namespace Log {
-
-class DeviceController;
-
-/**
- * @class JSTizenLog
- * @brief This class is javascript extenstion
- *
- */
-class JSTizenLog
-{
-public:
-    static const JSClassDefinition* getClassInfo();
-
-    /**
-     * Gets class definition reference.
-     * @remarks New instance of JSClassRef is created (only once) if none was
-     * @remarks set before.
-     * @return Class reference.
-     */
-    static const JSClassRef getClassRef();
-
-private:
-    /**
-     * The callback invoked when an object is first created.
-     */
-    static void initialize(JSContextRef context, JSObjectRef object);
-
-    /**
-     * The callback invoked when an object is finalized.
-     */
-    static void finalize(JSObjectRef object);
-
-    /**
-     * This structure describes a statically declared function.
-     */
-    static JSStaticFunction m_function[];
-
-    /**
-     * This structure contains properties and callbacks that define a type of object.
-     */
-    static JSClassDefinition m_classInfo;
-
-    /**
-     * Class definition reference.
-     */
-
-    static JSClassRef m_jsClassRef;
-
-    static JSValueRef logDebug(JSContextRef context,
-                             JSObjectRef object,
-                             JSObjectRef thisObject,
-                             size_t argc,
-                             const JSValueRef argv[],
-                             JSValueRef* exception);
-
-    static JSValueRef logInfo(JSContextRef context,
-                                 JSObjectRef object,
-                                 JSObjectRef thisObject,
-                                 size_t argc,
-                                 const JSValueRef argv[],
-                                 JSValueRef* exception);
-
-    static JSValueRef logWarning(JSContextRef context,
-                                 JSObjectRef object,
-                                 JSObjectRef thisObject,
-                                 size_t argc,
-                                 const JSValueRef argv[],
-                                 JSValueRef* exception);
-
-    static JSValueRef logError(JSContextRef context,
-                                 JSObjectRef object,
-                                 JSObjectRef thisObject,
-                                 size_t argc,
-                                 const JSValueRef argv[],
-                                 JSValueRef* exception);
-
-};
-
-}
-
-}
-
-#endif //  _JS_TIZEN_LOG_H_
diff --git a/src/Log/config.xml b/src/Log/config.xml
deleted file mode 100644 (file)
index 3b24833..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" ?>
-<!DOCTYPE plugin-properties SYSTEM "/usr/etc/tizen-apis/config.dtd">
-<plugin-properties>
-    <library-name>libwrt-plugins-tizen-log.so</library-name>
-    <feature-install-uri>device.install.uri</feature-install-uri>
-    <feature-key-cn>SAMSUNG plugin group</feature-key-cn>
-    <feature-root-cn>SAMSUNG certificate authority</feature-root-cn>
-    <feature-root-fingerprint>AAAABBBBCCCCDDDEEEE0000</feature-root-fingerprint>
-
-    <feature-set name="http://tizen.org/privilege/log">
-        <api-feature-ref name="http://tizen.org/privilege/log"/>
-    </feature-set>
-
-    <api-feature>
-        <name>http://tizen.org/privilege/log</name>
-        <Object name="log">
-            <Function name="debug"/>
-            <Function name="info"/>
-            <Function name="warning"/>
-            <Function name="error"/>
-        </Object>
-    </api-feature>
-</plugin-properties>
diff --git a/src/Log/plugin_initializer.cpp b/src/Log/plugin_initializer.cpp
deleted file mode 100644 (file)
index 3bdebcb..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * 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 <Commons/plugin_initializer_def.h>
-#include "JSTizenLog.h"
-#include <Logger.h>
-
-#define WRT_JS_EXTENSION_OBJECT_TIZEN "tizen"
-
-namespace DeviceAPI {
-namespace Log {
-
-void on_widget_start_callback(int widgetId)
-{
-    LoggerD("[TizenLog] on_widget_start_callback ("<<widgetId<<")");
-}
-
-void on_widget_stop_callback(int widgetId)
-{
-    LoggerD("[TizenLog] on_widget_stop_callback ("<<widgetId<<")");
-}
-
-PLUGIN_ON_WIDGET_START(on_widget_start_callback)
-PLUGIN_ON_WIDGET_STOP(on_widget_stop_callback)
-
-PLUGIN_CLASS_MAP_BEGIN
-    PLUGIN_CLASS_MAP_ADD_CLASS(WRT_JS_EXTENSION_OBJECT_TIZEN, "log",
-      (js_class_template_getter)DeviceAPI::Log::JSTizenLog::getClassRef, NULL)
-PLUGIN_CLASS_MAP_END
-
-} // Log
-} // DeviceAPI
index 53c02f4..4b324e9 100755 (executable)
@@ -103,6 +103,8 @@ const char* DEVICE_CAPABILITIES_VISION_QRCODE_RECOGNITION = "visionQrcodeRecogni
 const char* DEVICE_CAPABILITIES_VISION_FACE_RECOGNITION = "visionFaceRecognition";
 const char* DEVICE_CAPABILITIES_SECURE_ELEMENT = "secureElement";
 const char* DEVICE_CAPABILITIES_NATIVE_OSP_COMPATIBLE = "nativeOspCompatible";
+const char* DEVICE_CAPABILITIES_INPUT_KEY_BACK = "inputKeyBack";
+const char* DEVICE_CAPABILITIES_INPUT_KEY_OPTION = "inputKeyMenu";
 } 
 
 JSClassRef JSDeviceCapabilitiesInfo::m_classRef = NULL;
@@ -195,6 +197,8 @@ JSStaticValue JSDeviceCapabilitiesInfo::m_properties[] = {
     { DEVICE_CAPABILITIES_VISION_FACE_RECOGNITION, getProperty, NULL, kJSPropertyAttributeReadOnly },
     { DEVICE_CAPABILITIES_SECURE_ELEMENT, getProperty, NULL, kJSPropertyAttributeReadOnly },
     { DEVICE_CAPABILITIES_NATIVE_OSP_COMPATIBLE, getProperty, NULL, kJSPropertyAttributeReadOnly },
+    { DEVICE_CAPABILITIES_INPUT_KEY_BACK, getProperty, NULL, kJSPropertyAttributeReadOnly },
+    { DEVICE_CAPABILITIES_INPUT_KEY_OPTION, getProperty, NULL, kJSPropertyAttributeReadOnly },
     { 0, 0, 0, 0 }
 };
 
@@ -578,14 +582,6 @@ JSValueRef JSDeviceCapabilitiesInfo::getProperty(JSContextRef context, JSObjectR
             }
             return convert.toJSValueRef(deviceCapabilitiesInfo->sipVoip);
         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_DUID)) {
-            char* duid = NULL;
-            if (system_info_get_value_string(SYSTEM_INFO_KEY_DEVICE_UUID, &duid) == SYSTEM_INFO_ERROR_NONE) {
-                if (duid) {
-                    LoggerD("duid : " << duid);
-                    deviceCapabilitiesInfo->duid = duid;
-                    free(duid);
-                }
-            }
             return convert.toJSValueRef(deviceCapabilitiesInfo->duid);
         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_SPEECH_ROCOGNITION)) {
             bool speechRecognition = false;
@@ -787,6 +783,18 @@ JSValueRef JSDeviceCapabilitiesInfo::getProperty(JSContextRef context, JSObjectR
             deviceCapabilitiesInfo->nativeOspCompatible = getRegistry("platform.native.osp_compatible");
             LoggerD("nativeOspCompatible : " << deviceCapabilitiesInfo->nativeOspCompatible);  
             return convert.toJSValueRef(deviceCapabilitiesInfo->nativeOspCompatible);
+        } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_INPUT_KEY_BACK)) {
+            bool inputKeyBack = false;
+            if(system_info_get_platform_bool("tizen.org/feature/input.keys.back", &inputKeyBack) == SYSTEM_INFO_ERROR_NONE) {
+                deviceCapabilitiesInfo->inputKeyBack = inputKeyBack;
+            }
+            return convert.toJSValueRef(deviceCapabilitiesInfo->inputKeyBack);
+        } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_INPUT_KEY_OPTION)) {
+            bool inputKeyMenu = false;
+            if(system_info_get_platform_bool("tizen.org/feature/input.keys.menu", &inputKeyMenu) == SYSTEM_INFO_ERROR_NONE) {
+                deviceCapabilitiesInfo->inputKeyMenu = inputKeyMenu;
+            }
+            return convert.toJSValueRef(deviceCapabilitiesInfo->inputKeyMenu);
         }
     }
     Catch(Exception)
index b36584c..113d90b 100755 (executable)
@@ -39,7 +39,6 @@ class JSDeviceCapabilitiesInfo
     static JSValueRef getProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception);
     static bool isExist(const char* path);
     static bool getRegistry(std::string key);
-    
 
     static JSStaticValue m_properties[];
     static JSClassRef m_classRef;
index a6c3dc1..a91613e 100755 (executable)
@@ -104,6 +104,8 @@ struct DeviceCapabilitiesProperties
     bool            visionFaceRecognition;
     bool            secureElement;
     bool            nativeOspCompatible;
+    bool            inputKeyBack;
+    bool            inputKeyMenu;
 
     DeviceCapabilitiesProperties() :
         bluetooth(false),
@@ -172,7 +174,9 @@ struct DeviceCapabilitiesProperties
         visionQrcodeRecognition(false),
         visionFaceRecognition(false),
         secureElement(false),
-        nativeOspCompatible(false)
+        nativeOspCompatible(false),
+        inputKeyBack(true),
+        inputKeyMenu(true)
         {
         }
 };