From e08574531a0ba5dac7bbaad8e2c630614ba2d4d8 Mon Sep 17 00:00:00 2001 From: Piotr Kosko Date: Fri, 12 May 2017 09:09:58 +0200 Subject: [PATCH 01/16] [Filesystem] SVACE issue fix Change-Id: I3f8d221154225a45462e8e1e931031f4ef0bb772 Signed-off-by: Piotr Kosko --- src/filesystem/filesystem_manager.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/filesystem/filesystem_manager.cc b/src/filesystem/filesystem_manager.cc index 6039be1..43f7462 100644 --- a/src/filesystem/filesystem_manager.cc +++ b/src/filesystem/filesystem_manager.cc @@ -498,7 +498,7 @@ void FilesystemManager::GetCanonicalPath(const std::string& path, int tmpErrno; if (!canonicalPath) { tmpErrno = errno; - LoggerE("Cannot get realpath of %s. Error: %s!", path.c_str(), strerror(tmpErrno)); + LoggerE("Cannot get realpath of %s. Error: %s!", path.c_str(), GetErrorString(tmpErrno).c_str()); error_cb(FilesystemError::Other); } -- 2.7.4 From 02ecea2776f9807a6e6f8d0fa0ac9cec5b2f0440 Mon Sep 17 00:00:00 2001 From: Piotr Kosko Date: Wed, 17 May 2017 10:53:56 +0200 Subject: [PATCH 02/16] [version] 1.83 Change-Id: Ib1ddf07b8fc019d0145271fa6728f674060f3073 --- packaging/webapi-plugins.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/webapi-plugins.spec b/packaging/webapi-plugins.spec index 1cae2de..48dd7ee 100644 --- a/packaging/webapi-plugins.spec +++ b/packaging/webapi-plugins.spec @@ -10,7 +10,7 @@ %define crosswalk_extensions_path %{_libdir}/%{crosswalk_extensions} Name: webapi-plugins -Version: 1.82 +Version: 1.83 Release: 0 License: Apache-2.0 and BSD-3-Clause and MIT Group: Development/Libraries -- 2.7.4 From 6fc2be29662e7b327e9435519d5ed4f8b3c1ba0a Mon Sep 17 00:00:00 2001 From: Tomasz Marciniak Date: Thu, 18 May 2017 10:37:21 +0200 Subject: [PATCH 03/16] [Feedback] Error codes adjusted to the documentation. [Verification] Code compiles. TCT pass rate 100% (TW1) Change-Id: I38fc1ad18b445253c0e87366c6c2841ebd54f13e Signed-off-by: Tomasz Marciniak --- src/feedback/feedback_manager.cc | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/feedback/feedback_manager.cc b/src/feedback/feedback_manager.cc index 91e0e09..57f3e0c 100644 --- a/src/feedback/feedback_manager.cc +++ b/src/feedback/feedback_manager.cc @@ -133,18 +133,23 @@ common::PlatformResult FeedbackManager::isPatternSupported(const std::string &pa const std::string &type, bool* patternStatus) { LoggerD("Entered"); + auto &pattern_e = m_feedbackMapsPtr->getPatternFromMap(pattern); auto &type_e = m_feedbackMapsPtr->getTypeFromMap(type); + if (m_feedbackMapsPtr->isPatternSupportChecked(pattern_e, type_e)) { *patternStatus = m_feedbackMapsPtr->isPatternSupported(pattern_e, type_e); return PlatformResult(ErrorCode::NO_ERROR); } + int ret = feedback_is_supported_pattern(type_e, pattern_e, patternStatus); if (ret != FEEDBACK_ERROR_NONE) { LoggerE("isPatternSupported failed: %d", ret); - return CodeToResult(ret, getFeedbackErrorMessage(ret).c_str()); + return CodeToResult(FEEDBACK_ERROR_NOT_SUPPORTED, "Pattern not supported"); } + m_feedbackMapsPtr->setPatternSupport(pattern_e, type_e, *patternStatus); + return PlatformResult(ErrorCode::NO_ERROR); } @@ -156,9 +161,11 @@ common::PlatformResult FeedbackManager::play(const std::string &pattern, const s } else { bool patternSupport = false; auto result = isPatternSupported(pattern, type, &patternSupport); + if (!result) { return result; } + if (patternSupport) { ret = feedback_play_type(m_feedbackMapsPtr->getTypeFromMap(type), m_feedbackMapsPtr->getPatternFromMap(pattern)); @@ -166,41 +173,45 @@ common::PlatformResult FeedbackManager::play(const std::string &pattern, const s return CodeToResult(FEEDBACK_ERROR_NOT_SUPPORTED, "Not supported device"); } } + if (ret != FEEDBACK_ERROR_NONE) { LoggerE("play failed: %d", ret); return CodeToResult(ret, getFeedbackErrorMessage(ret).c_str()); } + return PlatformResult(ErrorCode::NO_ERROR); } common::PlatformResult FeedbackManager::stop() { LoggerD("Entered"); + int ret = feedback_stop(); if(ret != FEEDBACK_ERROR_NONE && ret != FEEDBACK_ERROR_NOT_SUPPORTED) { LoggerE("stop failed: %d", ret); return CodeToResult(ret, getFeedbackErrorMessage(ret).c_str()); - } + } + return PlatformResult(ErrorCode::NO_ERROR); } PlatformResult FeedbackManager::CodeToResult(const int errorCode, const std::string& message) { LoggerD("Entered"); + switch(errorCode) { - case FEEDBACK_ERROR_INVALID_PARAMETER: - return LogAndCreateResult(ErrorCode::INVALID_VALUES_ERR, message); - case FEEDBACK_ERROR_OPERATION_FAILED: - return LogAndCreateResult(ErrorCode::SECURITY_ERR, message); case FEEDBACK_ERROR_NOT_SUPPORTED: return LogAndCreateResult(ErrorCode::NOT_SUPPORTED_ERR, message); + case FEEDBACK_ERROR_INVALID_PARAMETER: + case FEEDBACK_ERROR_OPERATION_FAILED: case FEEDBACK_ERROR_NOT_INITIALIZED: default: - return LogAndCreateResult(ErrorCode::UNKNOWN_ERR, message); + return LogAndCreateResult(ErrorCode::ABORT_ERR, message); } } const std::string FeedbackManager::getFeedbackErrorMessage(const int error_code) { LoggerD("Error code : %d", error_code); + switch(error_code) { case FEEDBACK_ERROR_OPERATION_FAILED: return "Operation not permitted"; @@ -211,7 +222,7 @@ const std::string FeedbackManager::getFeedbackErrorMessage(const int error_code) case FEEDBACK_ERROR_NOT_INITIALIZED: return "Not initialized"; default: - return "UnknownError"; + return "Abort Error"; } } -- 2.7.4 From afffe626d143eaabfc9062e14ef9cb4f409310f9 Mon Sep 17 00:00:00 2001 From: Tomasz Marciniak Date: Thu, 18 May 2017 10:37:21 +0200 Subject: [PATCH 04/16] [Feedback] Error codes adjusted to the documentation. [Verification] Code compiles. TCT pass rate 100% (TW1) Change-Id: I38fc1ad18b445253c0e87366c6c2841ebd54f13e Signed-off-by: Tomasz Marciniak --- src/feedback/feedback_manager.cc | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/feedback/feedback_manager.cc b/src/feedback/feedback_manager.cc index 91e0e09..57f3e0c 100644 --- a/src/feedback/feedback_manager.cc +++ b/src/feedback/feedback_manager.cc @@ -133,18 +133,23 @@ common::PlatformResult FeedbackManager::isPatternSupported(const std::string &pa const std::string &type, bool* patternStatus) { LoggerD("Entered"); + auto &pattern_e = m_feedbackMapsPtr->getPatternFromMap(pattern); auto &type_e = m_feedbackMapsPtr->getTypeFromMap(type); + if (m_feedbackMapsPtr->isPatternSupportChecked(pattern_e, type_e)) { *patternStatus = m_feedbackMapsPtr->isPatternSupported(pattern_e, type_e); return PlatformResult(ErrorCode::NO_ERROR); } + int ret = feedback_is_supported_pattern(type_e, pattern_e, patternStatus); if (ret != FEEDBACK_ERROR_NONE) { LoggerE("isPatternSupported failed: %d", ret); - return CodeToResult(ret, getFeedbackErrorMessage(ret).c_str()); + return CodeToResult(FEEDBACK_ERROR_NOT_SUPPORTED, "Pattern not supported"); } + m_feedbackMapsPtr->setPatternSupport(pattern_e, type_e, *patternStatus); + return PlatformResult(ErrorCode::NO_ERROR); } @@ -156,9 +161,11 @@ common::PlatformResult FeedbackManager::play(const std::string &pattern, const s } else { bool patternSupport = false; auto result = isPatternSupported(pattern, type, &patternSupport); + if (!result) { return result; } + if (patternSupport) { ret = feedback_play_type(m_feedbackMapsPtr->getTypeFromMap(type), m_feedbackMapsPtr->getPatternFromMap(pattern)); @@ -166,41 +173,45 @@ common::PlatformResult FeedbackManager::play(const std::string &pattern, const s return CodeToResult(FEEDBACK_ERROR_NOT_SUPPORTED, "Not supported device"); } } + if (ret != FEEDBACK_ERROR_NONE) { LoggerE("play failed: %d", ret); return CodeToResult(ret, getFeedbackErrorMessage(ret).c_str()); } + return PlatformResult(ErrorCode::NO_ERROR); } common::PlatformResult FeedbackManager::stop() { LoggerD("Entered"); + int ret = feedback_stop(); if(ret != FEEDBACK_ERROR_NONE && ret != FEEDBACK_ERROR_NOT_SUPPORTED) { LoggerE("stop failed: %d", ret); return CodeToResult(ret, getFeedbackErrorMessage(ret).c_str()); - } + } + return PlatformResult(ErrorCode::NO_ERROR); } PlatformResult FeedbackManager::CodeToResult(const int errorCode, const std::string& message) { LoggerD("Entered"); + switch(errorCode) { - case FEEDBACK_ERROR_INVALID_PARAMETER: - return LogAndCreateResult(ErrorCode::INVALID_VALUES_ERR, message); - case FEEDBACK_ERROR_OPERATION_FAILED: - return LogAndCreateResult(ErrorCode::SECURITY_ERR, message); case FEEDBACK_ERROR_NOT_SUPPORTED: return LogAndCreateResult(ErrorCode::NOT_SUPPORTED_ERR, message); + case FEEDBACK_ERROR_INVALID_PARAMETER: + case FEEDBACK_ERROR_OPERATION_FAILED: case FEEDBACK_ERROR_NOT_INITIALIZED: default: - return LogAndCreateResult(ErrorCode::UNKNOWN_ERR, message); + return LogAndCreateResult(ErrorCode::ABORT_ERR, message); } } const std::string FeedbackManager::getFeedbackErrorMessage(const int error_code) { LoggerD("Error code : %d", error_code); + switch(error_code) { case FEEDBACK_ERROR_OPERATION_FAILED: return "Operation not permitted"; @@ -211,7 +222,7 @@ const std::string FeedbackManager::getFeedbackErrorMessage(const int error_code) case FEEDBACK_ERROR_NOT_INITIALIZED: return "Not initialized"; default: - return "UnknownError"; + return "Abort Error"; } } -- 2.7.4 From 3c44b8fe425f22c41bea2c54ce04de60e29135e4 Mon Sep 17 00:00:00 2001 From: Pawel Wasowski Date: Thu, 18 May 2017 11:50:31 +0200 Subject: [PATCH 05/16] [Filesystem] Add validation of decoded UTF-8 characters _utf8_decode function used to throw a RangeError exception, when an invalid UTF-8 sequence was converted to a Unicode code point. Byte sequences, invalid in terms of UTF-8, are now substituted with an Unicode replacement character. [Verification] TCT tct-filesystem-tizen-tests and tct-file-cordova-tests pass rate on a Z400 mobile device is 100%. Decoding was tested manually against numerous problematic byte sequences. Change-Id: If8aefd3434a1b96ead11e36a1db1ddee4f2c3904 Signed-off-by: Pawel Wasowski --- src/filesystem/js/base64.js | 76 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 65 insertions(+), 11 deletions(-) diff --git a/src/filesystem/js/base64.js b/src/filesystem/js/base64.js index edd4513..4074d48 100755 --- a/src/filesystem/js/base64.js +++ b/src/filesystem/js/base64.js @@ -126,35 +126,89 @@ var Base64 = { return utfarray; }, + + /* + * This function validates read characters. Non-standard UTF-8 characters are substituted with + * a replacement symbol. + * + * Used validation check cases are described in http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt, + * by Markus Kuhn, distributed under CC-BY 4.0 license (https://creativecommons.org/licenses/by/4.0/legalcode). + */ + _utf8_decode: function(utfarray) { var str = ''; - var i = 0, c = 0, c1 = 0, c2 = 0, c3 = 0; + var i = 0, c = 0, c1 = 0, c2 = 0, c3 = 0, charCode = 0; + var INVALID_CHARACTER = String.fromCharCode(0xFFFD); while (i < utfarray.length) { - c = utfarray[i]; if (c < 128) { str += String.fromCharCode(c); i++; - } - else if ((c >= 192) && (c < 224)) { + } else if ((c >= 194) && (c < 224) && (utfarray[i + 1] & 0x80)) { c1 = utfarray[i + 1]; - str += String.fromCharCode(((c & 31) << 6) | (c1 & 63)); + charCode = ((c & 31) << 6) | (c1 & 63); + /* + * Below condition is true, if the sequence could be encoded in less than 2 bytes. + * Such a byte series is invalid in terms of UTF-8. + * This and similar, longer, sequences will be refered to as "overlong sequence". + */ + if (!(charCode & 0xFF80)) { + str += INVALID_CHARACTER; + } else { + str += String.fromCharCode(charCode); + } + i += 2; - } - else if((c >= 224) && (c < 240)) { + } else if ((c >= 224) && (c < 240) && (utfarray[i + 1] & 0x80) && (utfarray[i + 2] & 0x80)) { c1 = utfarray[i + 1]; c2 = utfarray[i + 2]; - str += String.fromCharCode(((c & 15) << 12) | ((c1 & 63) << 6) | (c2 & 63)); + charCode = ((c & 15) << 12) | ((c1 & 63) << 6) | (c2 & 63); + + if (!(charCode & 0xF800) //overlong sequence test + /* + * Below test checks, if the character is an UTF-16 surrogate halve, + * UTF-16 surrogate halves are invalid Unicode codepoints. + */ + || (0xD800 <= charCode && charCode <=0xDFFF)) { + str += INVALID_CHARACTER; + } else { + str += String.fromCharCode(charCode); + } + i += 3; - } - else {//support 4 bytes characters e.g. Emojis + } else if ((c >= 240) && (c < 245) & (utfarray[i + 1] & 0x80) && (utfarray[i + 2] & 0x80) && (utfarray[i + 3] & 0x80)) { c1 = utfarray[i + 1]; c2 = utfarray[i + 2]; c3 = utfarray[i + 3]; - str += String.fromCodePoint(((c & 7) << 18) | ((c1 & 63) << 12) | ((c2 & 63) << 6) | (c3 & 63)); + charCode = ((c & 7) << 18) | ((c1 & 63) << 12) | ((c2 & 63) << 6) | (c3 & 63); + + if (!(charCode & 0x1F0000)) { //overlong sequence test + str += INVALID_CHARACTER; + } else { + str += String.fromCharCode(charCode); + } i += 4; + /* + * Below condition is true if a continuation byte appeared without a proper leading byte + */ + } else if ((c & 0x80) && (~c & 0x40)) { + str += INVALID_CHARACTER; + i++; + } else { + /* + * One or more continuation bytes are missing + * OR 'c' is a prohibited byte in terms of UTF-8 standard. + */ + str += INVALID_CHARACTER; + + /* + * All following continuation bytes are skipped. + */ + do { + i++; + } while((utfarray[i] & 0x80) && (~utfarray[i] & 0x40)); } } -- 2.7.4 From 1bd2aeb95e97cded73f308ec47daaf845eb2ab07 Mon Sep 17 00:00:00 2001 From: Pawel Wasowski Date: Thu, 18 May 2017 11:50:31 +0200 Subject: [PATCH 06/16] [Filesystem] Add validation of decoded UTF-8 characters _utf8_decode function used to throw a RangeError exception, when an invalid UTF-8 sequence was converted to a Unicode code point. Byte sequences, invalid in terms of UTF-8, are now substituted with an Unicode replacement character. [Verification] TCT tct-filesystem-tizen-tests and tct-file-cordova-tests pass rate on a Z400 mobile device is 100%. Decoding was tested manually against numerous problematic byte sequences. Change-Id: If8aefd3434a1b96ead11e36a1db1ddee4f2c3904 Signed-off-by: Pawel Wasowski (cherry picked from commit 3c44b8fe425f22c41bea2c54ce04de60e29135e4) --- src/filesystem/js/base64.js | 76 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 65 insertions(+), 11 deletions(-) diff --git a/src/filesystem/js/base64.js b/src/filesystem/js/base64.js index edd4513..4074d48 100755 --- a/src/filesystem/js/base64.js +++ b/src/filesystem/js/base64.js @@ -126,35 +126,89 @@ var Base64 = { return utfarray; }, + + /* + * This function validates read characters. Non-standard UTF-8 characters are substituted with + * a replacement symbol. + * + * Used validation check cases are described in http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt, + * by Markus Kuhn, distributed under CC-BY 4.0 license (https://creativecommons.org/licenses/by/4.0/legalcode). + */ + _utf8_decode: function(utfarray) { var str = ''; - var i = 0, c = 0, c1 = 0, c2 = 0, c3 = 0; + var i = 0, c = 0, c1 = 0, c2 = 0, c3 = 0, charCode = 0; + var INVALID_CHARACTER = String.fromCharCode(0xFFFD); while (i < utfarray.length) { - c = utfarray[i]; if (c < 128) { str += String.fromCharCode(c); i++; - } - else if ((c >= 192) && (c < 224)) { + } else if ((c >= 194) && (c < 224) && (utfarray[i + 1] & 0x80)) { c1 = utfarray[i + 1]; - str += String.fromCharCode(((c & 31) << 6) | (c1 & 63)); + charCode = ((c & 31) << 6) | (c1 & 63); + /* + * Below condition is true, if the sequence could be encoded in less than 2 bytes. + * Such a byte series is invalid in terms of UTF-8. + * This and similar, longer, sequences will be refered to as "overlong sequence". + */ + if (!(charCode & 0xFF80)) { + str += INVALID_CHARACTER; + } else { + str += String.fromCharCode(charCode); + } + i += 2; - } - else if((c >= 224) && (c < 240)) { + } else if ((c >= 224) && (c < 240) && (utfarray[i + 1] & 0x80) && (utfarray[i + 2] & 0x80)) { c1 = utfarray[i + 1]; c2 = utfarray[i + 2]; - str += String.fromCharCode(((c & 15) << 12) | ((c1 & 63) << 6) | (c2 & 63)); + charCode = ((c & 15) << 12) | ((c1 & 63) << 6) | (c2 & 63); + + if (!(charCode & 0xF800) //overlong sequence test + /* + * Below test checks, if the character is an UTF-16 surrogate halve, + * UTF-16 surrogate halves are invalid Unicode codepoints. + */ + || (0xD800 <= charCode && charCode <=0xDFFF)) { + str += INVALID_CHARACTER; + } else { + str += String.fromCharCode(charCode); + } + i += 3; - } - else {//support 4 bytes characters e.g. Emojis + } else if ((c >= 240) && (c < 245) & (utfarray[i + 1] & 0x80) && (utfarray[i + 2] & 0x80) && (utfarray[i + 3] & 0x80)) { c1 = utfarray[i + 1]; c2 = utfarray[i + 2]; c3 = utfarray[i + 3]; - str += String.fromCodePoint(((c & 7) << 18) | ((c1 & 63) << 12) | ((c2 & 63) << 6) | (c3 & 63)); + charCode = ((c & 7) << 18) | ((c1 & 63) << 12) | ((c2 & 63) << 6) | (c3 & 63); + + if (!(charCode & 0x1F0000)) { //overlong sequence test + str += INVALID_CHARACTER; + } else { + str += String.fromCharCode(charCode); + } i += 4; + /* + * Below condition is true if a continuation byte appeared without a proper leading byte + */ + } else if ((c & 0x80) && (~c & 0x40)) { + str += INVALID_CHARACTER; + i++; + } else { + /* + * One or more continuation bytes are missing + * OR 'c' is a prohibited byte in terms of UTF-8 standard. + */ + str += INVALID_CHARACTER; + + /* + * All following continuation bytes are skipped. + */ + do { + i++; + } while((utfarray[i] & 0x80) && (~utfarray[i] & 0x40)); } } -- 2.7.4 From 88bd2531ef7af65bfc236c980bf0bfec452c4c66 Mon Sep 17 00:00:00 2001 From: Szymon Jastrzebski Date: Fri, 19 May 2017 12:58:22 +0200 Subject: [PATCH 07/16] [SystemInfo] Throwing NOT_SUPPORTED_ERR added [Verification] TCT SystemInfo passed 100% (TM1, TW1, TV) Signed-off-by: Szymon Jastrzebski Change-Id: I18753fcf052b954dd3f88839db58616b137bfd3b --- src/systeminfo/systeminfo_api.js | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/src/systeminfo/systeminfo_api.js b/src/systeminfo/systeminfo_api.js index 21bef45..38e48da 100644 --- a/src/systeminfo/systeminfo_api.js +++ b/src/systeminfo/systeminfo_api.js @@ -46,6 +46,17 @@ var SystemInfoPropertyId = { ADS : 'ADS' }; +var SystemInfoPropertyIdToFeature = { + BATTERY : 'http://tizen.org/feature/battery', + CAMERA_FLASH : 'http://tizen.org/feature/camera.back.flash', + CELLULAR_NETWORK : 'http://tizen.org/feature/network.telephony', + DISPLAY : 'http://tizen.org/feature/screen', + ETHERNET_NETWORK : 'http://tizen.org/feature/network.ethernet', + SIM : 'http://tizen.org/feature/network.telephony', + NET_PROXY_NETWORK : 'http://tizen.org/feature/network.net_proxy', + WIFI_NETWORK : 'http://tizen.org/feature/network.wifi' +}; + //class SystemInfoDeviceCapability //////////////////////////////////////////////////// function SystemInfoDeviceCapability(data) { Object.defineProperties(this, { @@ -800,6 +811,15 @@ var _createPropertyArray = function (property, data) { return propertyArray; }; +var _checkPropertySupported = function(property){ + if (SystemInfoPropertyIdToFeature[property]) { + var supported = tizen.systeminfo.getCapability(SystemInfoPropertyIdToFeature[property]); + if (!supported) { + return false; + } + } + return true; +}; var getPropertyFunction = function(cppLabel, objectCreateFunction) { return function() { @@ -828,6 +848,16 @@ var getPropertyFunction = function(cppLabel, objectCreateFunction) { if (!propObject) { throw new WebAPIException(WebAPIException.TYPE_MISMATCH_ERR, 'Property with id: ' + args.property + ' is not supported.'); } + + if (_checkPropertySupported(args.property) === false) { + setTimeout(function() { + native_.callIfPossible(args.errorCallback, + new WebAPIException(WebAPIException.NOT_SUPPORTED_ERR, + 'Property with id: ' + args.property + ' is not supported.')); + }, 0); + return; + } + var callback = function(result) { if (native_.isFailure(result)) { setTimeout(function() { @@ -1339,6 +1369,15 @@ var getListenerFunction = function (isArray) { } ]); + if (_checkPropertySupported(args.property) === false) { + setTimeout(function() { + native_.callIfPossible(args.errorCallback, + new WebAPIException(WebAPIException.NOT_SUPPORTED_ERR, + 'Property with id: ' + args.property + ' is not supported.')); + }, 0); + return; + } + var listener = { callback : args.successCallback, isArrayType : isArray, -- 2.7.4 From 63e80d97ebb2660611d4e55af51203088a808a3a Mon Sep 17 00:00:00 2001 From: Lukasz Bardeli Date: Wed, 24 May 2017 08:14:00 +0200 Subject: [PATCH 08/16] [Iotcon] fix for iotcon, pass information about representation [verification] Code compiles without error Passrate 1 run 1 block, second run 100% Change-Id: I2cfc09dd6244a2664dc901ba6ecc3bd151574f60 Signed-off-by: Lukasz Bardeli --- src/iotcon/iotcon_api.js | 4 ++++ src/iotcon/iotcon_server_manager.cc | 9 +++++++-- src/iotcon/iotcon_server_manager.h | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/iotcon/iotcon_api.js b/src/iotcon/iotcon_api.js index 9290d32..bd3f32d 100644 --- a/src/iotcon/iotcon_api.js +++ b/src/iotcon/iotcon_api.js @@ -464,7 +464,11 @@ var _setRequestListener = function(id, args_listener) { callArgs.id = id; var listener = function(result) { + if(!result.data.request.representation && result.data.uriPath) { + result.data.request.representation = new tizen.Representation(result.data.uriPath); + } var request = new Request(result.data.id, result.data.request); + switch (converter.toString(result.data.type, false)) { case RequestType.GET: native.callIfPossible(args_listener.onget, request); diff --git a/src/iotcon/iotcon_server_manager.cc b/src/iotcon/iotcon_server_manager.cc index be41a71..107343a 100644 --- a/src/iotcon/iotcon_server_manager.cc +++ b/src/iotcon/iotcon_server_manager.cc @@ -114,7 +114,11 @@ void IotconServerManager::RequestHandler(iotcon_resource_h resource, } obj.insert(std::make_pair(kRequest, request_val)); - + std::map::iterator it; + it = that->uri_map_.find(resource); + if (it != that->uri_map_.end()) { + obj.insert(std::make_pair(kUriPath, picojson::value(it->second.c_str()))); + } // create response iotcon_response_h response = nullptr; result = IotconUtils::ConvertIotconError(iotcon_response_create(request, &response)); @@ -177,6 +181,7 @@ TizenResult IotconServerManager::CreateResource(const std::string& uri_path, // storing ResourceInfo into map res_pointer->id = GetNextId(); resource_map_.insert(std::make_pair(res_pointer->id, res_pointer)); + uri_map_.insert(std::make_pair(res_pointer->handle, uri_path)); return TizenSuccess(); } @@ -214,7 +219,7 @@ common::TizenResult IotconServerManager::DestroyResource(long long id) { } resource_map_.erase(id); - + uri_map_.erase(resource->handle); return TizenSuccess(); } diff --git a/src/iotcon/iotcon_server_manager.h b/src/iotcon/iotcon_server_manager.h index 7b9d347..f800e0a 100644 --- a/src/iotcon/iotcon_server_manager.h +++ b/src/iotcon/iotcon_server_manager.h @@ -56,6 +56,7 @@ class IotconServerManager { iotcon_request_h request, void *user_data); ResourceInfoMap resource_map_; + std::map uri_map_; }; } // namespace iotcon -- 2.7.4 From 32ca956b952617273fe49d50d3eebbfbeea4e763 Mon Sep 17 00:00:00 2001 From: Piotr Kosko Date: Wed, 24 May 2017 09:28:31 +0200 Subject: [PATCH 09/16] Revert "Merge "[SystemInfo] Throwing NOT_SUPPORTED_ERR added" into tizen_3.0" This reverts commit 419840dd69b04b96c04d7e1eadc0b00638416d2b, reversing changes made to 1bd2aeb95e97cded73f308ec47daaf845eb2ab07. Change-Id: I1ce726dccc97afd5d5d2423e85a053db4bedbd50 --- packaging/webapi-plugins.spec | 1346 +++++--------------- src/alarm/alarm.gyp | 3 - src/alarm/alarm_api.js | 94 +- src/alarm/alarm_instance.cc | 4 - src/alarm/alarm_manager.cc | 327 +---- src/alarm/alarm_manager.h | 2 - src/alarm/alarm_utils.cc | 33 - src/alarm/alarm_utils.h | 11 - src/application/application.gyp | 10 +- src/application/application_api.js | 158 --- src/application/application_instance.cc | 37 - src/application/application_instance.h | 3 - src/application/application_manager.cc | 229 +--- src/application/application_manager.h | 11 - src/bluetooth/bluetooth.gyp | 1 - src/common/common.gyp | 2 +- src/convergence/convergence_instance.cc | 14 +- .../convergence_remote_app_control_service.cc | 1 - src/convergence/convergence_service.cc | 5 + src/convergence/convergence_service.h | 3 +- src/convergence/convergence_utils.cc | 1 - src/humanactivitymonitor/gesture_manager.cc | 413 ------ src/humanactivitymonitor/gesture_manager.h | 60 - src/humanactivitymonitor/humanactivitymonitor.gyp | 2 - .../humanactivitymonitor_api.js | 179 --- .../humanactivitymonitor_instance.cc | 68 +- .../humanactivitymonitor_instance.h | 8 - src/nfc/nfc.gyp | 2 +- src/notification/notification.gyp | 6 - src/notification/notification_api.js | 36 - src/notification/notification_instance.cc | 33 - src/notification/notification_instance.h | 4 - src/notification/notification_manager.cc | 60 - src/notification/notification_manager.h | 4 - src/notification/status_notification.cc | 97 +- src/notification/status_notification.h | 13 +- src/preference/preference.gyp | 2 +- src/push/push.gyp | 2 +- src/systeminfo/systeminfo.gyp | 3 + src/systeminfo/systeminfo_api.js | 49 - src/systeminfo/systeminfo_device_capability.cc | 69 +- src/systeminfo/systeminfo_properties_manager.cc | 63 +- 42 files changed, 473 insertions(+), 2995 deletions(-) delete mode 100644 src/humanactivitymonitor/gesture_manager.cc delete mode 100644 src/humanactivitymonitor/gesture_manager.h diff --git a/packaging/webapi-plugins.spec b/packaging/webapi-plugins.spec index 10d57c0..48dd7ee 100644 --- a/packaging/webapi-plugins.spec +++ b/packaging/webapi-plugins.spec @@ -1,5 +1,7 @@ %bcond_with wayland +%{!?profile:%define profile tv} + %define _manifestdir %{TZ_SYS_RW_PACKAGES} %define _desktop_icondir %{TZ_SYS_SHARE}/icons/default/small @@ -8,351 +10,366 @@ %define crosswalk_extensions_path %{_libdir}/%{crosswalk_extensions} Name: webapi-plugins -Version: 1.84 +Version: 1.83 Release: 0 License: Apache-2.0 and BSD-3-Clause and MIT Group: Development/Libraries Summary: Tizen Web APIs implemented Source0: %{name}-%{version}.tar.gz +%ifarch %{arm} aarch64 +# ARM +%define tizen_is_emulator 0 +%else +# I586 +%define tizen_is_emulator 1 +%endif + +%if "%{_repository}" == "arm64-wayland" +# 64bit +%define tizen_is_arm64 1 +%else +# 32bit +%define tizen_is_arm64 0 +%endif + #################################################################### # Common Profile : artik # #################################################################### - -%define tizen_common_privilege_engine CYNARA - -%define tizen_common_feature_account_support 0 -%define tizen_common_feature_alarm_support 1 -%define tizen_common_feature_app_control_settings_support 1 -%define tizen_common_feature_application_support 1 -%define tizen_common_feature_archive_support 0 -%define tizen_common_feature_badge_support 0 -%define tizen_common_feature_bluetooth_support 1 -%define tizen_common_feature_bookmark_support 0 -%define tizen_common_feature_calendar_support 0 -%define tizen_common_feature_contact_support 0 -%define tizen_common_feature_content_support 1 -%define tizen_common_feature_datacontrol_support 0 -%define tizen_common_feature_datasync_support 0 -%define tizen_common_feature_download_support 1 -%define tizen_common_feature_exif_support 1 -%define tizen_common_feature_feedback_support 0 -%define tizen_common_feature_filesystem_support 1 -%define tizen_common_feature_fm_radio_support 0 -%define tizen_common_feature_ham_support 0 -%define tizen_common_feature_iotcon_support 0 -%define tizen_common_feature_location_batch 0 -%define tizen_common_feature_key_manager_support 0 -%define tizen_common_feature_media_controller_support 0 -%define tizen_common_feature_media_key_support 0 -%define tizen_common_feature_message_port_support 1 -%define tizen_common_feature_messaging_support 0 -%define tizen_common_feature_nfc_emulation_support 0 -%define tizen_common_feature_nfc_support 0 -%define tizen_common_feature_notification_support 0 -%define tizen_common_feature_package_support 1 -%define tizen_common_feature_player_util_support 0 -%define tizen_common_feature_power_support 0 -%define tizen_common_feature_preference_support 0 -%define tizen_common_feature_push_support 0 -%define tizen_common_feature_se_support 0 -%define tizen_common_feature_sensor_support 0 -%define tizen_common_feature_sound_support 1 -%define tizen_common_feature_system_info_support 1 -%define tizen_common_feature_system_setting_support 0 -%define tizen_common_feature_telephony_support 0 -%define tizen_common_feature_time_support 1 -%define tizen_common_feature_web_setting_support 0 -%define tizen_common_feature_widget_service_support 0 -%define tizen_common_feature_wi_fi_support 1 -%define tizen_common_feature_inputdevice_support 0 -%define tizen_common_feature_callhistory_support 0 -%define tizen_common_feature_nbs_support 0 -%define tizen_common_feature_tvinputdevice_support 0 - +%if "%{?profile}" == "common" + +%define tizen_privilege_engine CYNARA + +%define tizen_feature_account_support 0 +%define tizen_feature_alarm_support 1 +%define tizen_feature_app_control_settings_support 1 +%define tizen_feature_application_support 1 +%define tizen_feature_archive_support 0 +%define tizen_feature_badge_support 0 +%define tizen_feature_bluetooth_support 1 +%define tizen_feature_bookmark_support 0 +%define tizen_feature_calendar_support 0 +%define tizen_feature_contact_support 0 +%define tizen_feature_content_support 1 +%define tizen_feature_datacontrol_support 0 +%define tizen_feature_datasync_support 0 +%define tizen_feature_download_support 1 +%define tizen_feature_exif_support 1 +%define tizen_feature_feedback_support 0 +%define tizen_feature_filesystem_support 1 +%define tizen_feature_fm_radio_support 0 +%define tizen_feature_ham_support 0 +%define tizen_feature_iotcon_support 0 +%define tizen_feature_location_batch 0 +%define tizen_feature_key_manager_support 0 +%define tizen_feature_media_controller_support 0 +%define tizen_feature_media_key_support 0 +%define tizen_feature_message_port_support 1 +%define tizen_feature_messaging_support 0 +%define tizen_feature_nfc_emulation_support 0 +%define tizen_feature_nfc_support 0 +%define tizen_feature_notification_support 0 +%define tizen_feature_package_support 1 +%define tizen_feature_player_util_support 0 +%define tizen_feature_power_support 0 +%define tizen_feature_preference_support 0 +%define tizen_feature_push_support 0 +%define tizen_feature_se_support 0 +%define tizen_feature_sensor_support 0 +%define tizen_feature_sound_support 1 +%define tizen_feature_system_info_support 1 +%define tizen_feature_system_setting_support 0 +%define tizen_feature_telephony_support 0 +%define tizen_feature_time_support 1 +%define tizen_feature_web_setting_support 0 +%define tizen_feature_widget_service_support 0 +%define tizen_feature_wi_fi_support 1 +%define tizen_feature_inputdevice_support 0 +%define tizen_feature_callhistory_support 0 +%define tizen_feature_nbs_support 0 +%define tizen_feature_tvinputdevice_support 0 + +%endif # tizen_profile_common #################################################################### # Mobile Profile : TM1(32bit), Redwood(SM-Z910F), KIRAN(Z130H) # # TM2(64bit) #################################################################### +%if "%{?profile}" == "mobile" + +%define tizen_privilege_engine CYNARA + +%define tizen_feature_account_support 1 +%define tizen_feature_alarm_support 1 +%define tizen_feature_app_control_settings_support 1 +%define tizen_feature_application_support 1 +%define tizen_feature_archive_support 1 +%define tizen_feature_badge_support 1 +%if 0%{?tizen_is_emulator} +%define tizen_feature_bluetooth_support 0 +%else +%define tizen_feature_bluetooth_support 1 +%endif +%define tizen_feature_bookmark_support 1 +%define tizen_feature_calendar_support 1 +%define tizen_feature_contact_support 1 +%define tizen_feature_content_support 1 +%define tizen_feature_datacontrol_support 1 +%define tizen_feature_datasync_support 0 +%define tizen_feature_download_support 1 +%define tizen_feature_exif_support 1 +%define tizen_feature_feedback_support 1 +%define tizen_feature_filesystem_support 1 -%define tizen_mobile_privilege_engine CYNARA - -%define tizen_mobile_feature_account_support 1 -%define tizen_mobile_feature_alarm_support 1 -%define tizen_mobile_feature_app_control_settings_support 1 -%define tizen_mobile_feature_application_support 1 -%define tizen_mobile_feature_archive_support 1 -%define tizen_mobile_feature_badge_support 1 -%define tizen_mobile_feature_bluetooth_support 1 -%define tizen_mobile_feature_bookmark_support 1 -%define tizen_mobile_feature_calendar_support 1 -%define tizen_mobile_feature_contact_support 1 -%define tizen_mobile_feature_content_support 1 -%define tizen_mobile_feature_datacontrol_support 1 -%define tizen_mobile_feature_datasync_support 0 -%define tizen_mobile_feature_download_support 1 -%define tizen_mobile_feature_exif_support 1 -%define tizen_mobile_feature_feedback_support 1 -%define tizen_mobile_feature_filesystem_support 1 - -%ifarch aarch64 -%define tizen_mobile_feature_fm_radio_support 0 +# FM radio feature +%if 0%{?tizen_is_emulator} +%define tizen_feature_fm_radio_support 1 +%else +%if 0%{?tizen_is_arm64} +%define tizen_feature_fm_radio_support 0 %else -%define tizen_mobile_feature_fm_radio_support 1 +%define tizen_feature_fm_radio_support 1 +%endif %endif -%define tizen_mobile_feature_ham_support 0 - -%define tizen_mobile_feature_iotcon_support 1 -%define tizen_mobile_feature_location_batch 0 -%define tizen_mobile_feature_key_manager_support 1 -%define tizen_mobile_feature_media_controller_support 1 - -%define tizen_mobile_feature_media_key_support 1 - -%define tizen_mobile_feature_message_port_support 1 -%define tizen_mobile_feature_messaging_support 1 - -%define tizen_mobile_feature_nfc_emulation_support 0 -%define tizen_mobile_feature_nfc_support 0 +%if 0%{?tizen_is_emulator} +%define tizen_feature_ham_support 1 +%else +%define tizen_feature_ham_support 0 +%endif +%define tizen_feature_iotcon_support 1 +%define tizen_feature_location_batch 0 +%define tizen_feature_key_manager_support 1 +%define tizen_feature_media_controller_support 1 +%if 0%{?tizen_is_emulator} +%define tizen_feature_media_key_support 0 +%else +%define tizen_feature_media_key_support 1 +%endif +%define tizen_feature_message_port_support 1 +%define tizen_feature_messaging_support 1 -%define tizen_mobile_feature_notification_support 1 -%define tizen_mobile_feature_package_support 1 -%define tizen_mobile_feature_player_util_support 1 -%define tizen_mobile_feature_power_support 1 -%define tizen_mobile_feature_preference_support 1 -%define tizen_mobile_feature_push_support 1 +%if 0%{?tizen_is_emulator} +%define tizen_feature_nfc_emulation_support 0 +%define tizen_feature_nfc_support 1 +%else +%define tizen_feature_nfc_emulation_support 0 +%define tizen_feature_nfc_support 0 +%endif +%define tizen_feature_notification_support 1 +%define tizen_feature_package_support 1 +%define tizen_feature_player_util_support 1 +%define tizen_feature_power_support 1 +%define tizen_feature_preference_support 1 +%define tizen_feature_push_support 1 # secure element feature -%ifarch aarch64 -%define tizen_mobile_feature_se_support 0 +%if 0%{?tizen_is_emulator} +%define tizen_feature_se_support 0 +%else +%if 0%{?tizen_is_arm64} +%define tizen_feature_se_support 0 %else -%define tizen_mobile_feature_se_support 1 +%define tizen_feature_se_support 1 +%endif %endif -%define tizen_mobile_feature_sensor_support 1 -%define tizen_mobile_feature_sound_support 1 -%define tizen_mobile_feature_system_info_support 1 -%define tizen_mobile_feature_system_setting_support 1 +%define tizen_feature_sensor_support 1 +%define tizen_feature_sound_support 1 +%define tizen_feature_system_info_support 1 +%define tizen_feature_system_setting_support 1 # telephony feature -%ifarch aarch64 -%define tizen_mobile_feature_telephony_support 0 -%define tizen_mobile_feature_callhistory_support 0 -%define tizen_mobile_feature_nbs_support 0 +%if 0%{?tizen_is_emulator} +%define tizen_feature_telephony_support 1 %else -%define tizen_mobile_feature_telephony_support 1 -%define tizen_mobile_feature_callhistory_support 1 -%define tizen_mobile_feature_nbs_support 1 +%if 0%{?tizen_is_arm64} +%define tizen_feature_telephony_support 0 +%else +%define tizen_feature_telephony_support 1 +%endif %endif -%define tizen_mobile_feature_time_support 1 -%define tizen_mobile_feature_web_setting_support 1 -%define tizen_mobile_feature_widget_service_support 1 - -%define tizen_mobile_feature_wi_fi_support 1 +%define tizen_feature_time_support 1 +%define tizen_feature_web_setting_support 1 +%define tizen_feature_widget_service_support 1 +%if 0%{?tizen_is_emulator} +%define tizen_feature_wi_fi_support 0 +%else +%define tizen_feature_wi_fi_support 1 +%endif +%define tizen_feature_inputdevice_support 1 -%define tizen_mobile_feature_inputdevice_support 1 +%if 0%{?tizen_feature_telephony_support} +%define tizen_feature_callhistory_support 1 +%define tizen_feature_nbs_support 1 +%else +%define tizen_feature_callhistory_support 0 +%define tizen_feature_nbs_support 0 +%endif -%define tizen_mobile_feature_tvinputdevice_support 0 +%define tizen_feature_tvinputdevice_support 0 -%define tizen_mobile_feature_convergence_support 1 +%define tizen_feature_convergence_support 1 +%endif # tizen_profile_mobile #################################################################### # Wearable Profile : B2 / TW1 # #################################################################### +%if "%{?profile}" == "wearable" -%define tizen_wearable_privilege_engine CYNARA +%define tizen_privilege_engine CYNARA # Account API is optional in Tizen Wearable Profile. -%define tizen_wearable_feature_account_support 0 +%define tizen_feature_account_support 0 -%define tizen_wearable_feature_alarm_support 1 -%define tizen_wearable_feature_app_control_settings_support 1 -%define tizen_wearable_feature_application_support 1 +%define tizen_feature_alarm_support 1 +%define tizen_feature_app_control_settings_support 1 +%define tizen_feature_application_support 1 # Archive API is optional in Tizen Wearable Profile. -%define tizen_wearable_feature_archive_support 1 +%define tizen_feature_archive_support 1 # Badge API is mandatory in Tizen Wearable Profile. -%define tizen_wearable_feature_badge_support 1 +%define tizen_feature_badge_support 1 -%define tizen_wearable_feature_bluetooth_support 1 +%if 0%{?tizen_is_emulator} +%define tizen_feature_bluetooth_support 0 +%else +%define tizen_feature_bluetooth_support 1 +%endif # Bookmark API is optional in Tizen Wearable Profile. -%define tizen_wearable_feature_bookmark_support 0 +%define tizen_feature_bookmark_support 0 # Calendar API is mandatory in Tizen Wearable Profile. -%define tizen_wearable_feature_calendar_support 0 -%define tizen_wearable_feature_contact_support 0 -%define tizen_wearable_feature_content_support 1 -%define tizen_wearable_feature_datacontrol_support 1 -%define tizen_wearable_feature_datasync_support 0 -%define tizen_wearable_feature_download_support 1 -%define tizen_wearable_feature_exif_support 1 -%define tizen_wearable_feature_feedback_support 1 -%define tizen_wearable_feature_filesystem_support 1 -%define tizen_wearable_feature_fm_radio_support 0 -%define tizen_wearable_feature_ham_support 1 -%define tizen_wearable_feature_iotcon_support 1 -%define tizen_wearable_feature_location_batch 0 -%define tizen_wearable_feature_media_controller_support 1 +%define tizen_feature_calendar_support 0 +%define tizen_feature_contact_support 0 +%define tizen_feature_content_support 1 +%define tizen_feature_datacontrol_support 1 +%define tizen_feature_datasync_support 0 +%define tizen_feature_download_support 1 +%define tizen_feature_exif_support 1 +%define tizen_feature_feedback_support 1 +%define tizen_feature_filesystem_support 1 +%define tizen_feature_fm_radio_support 0 +%define tizen_feature_ham_support 1 +%define tizen_feature_iotcon_support 1 +%define tizen_feature_location_batch 0 +%define tizen_feature_media_controller_support 1 # MediayKey API is optional in Tizen Wearable Profile. # tizen.org/feature/network.bluetooth.audio.media is required for MediayKey API -%define tizen_wearable_feature_media_key_support 1 -%define tizen_wearable_feature_key_manager_support 1 -%define tizen_wearable_feature_message_port_support 1 -%define tizen_wearable_feature_messaging_support 0 -%define tizen_wearable_feature_nfc_emulation_support 0 -%define tizen_wearable_feature_nfc_support 1 -%define tizen_wearable_feature_notification_support 1 -%define tizen_wearable_feature_package_support 1 -%define tizen_wearable_feature_player_util_support 1 -%define tizen_wearable_feature_power_support 1 -%define tizen_wearable_feature_preference_support 1 -%define tizen_wearable_feature_push_support 1 -%define tizen_wearable_feature_se_support 1 -%define tizen_wearable_feature_sensor_support 1 -%define tizen_wearable_feature_sound_support 1 -%define tizen_wearable_feature_system_info_support 1 -%define tizen_wearable_feature_system_setting_support 1 +%if 0%{?tizen_is_emulator} +%define tizen_feature_media_key_support 0 +%else +%define tizen_feature_media_key_support 1 +%endif +%define tizen_feature_key_manager_support 1 +%define tizen_feature_message_port_support 1 +%define tizen_feature_messaging_support 0 +%define tizen_feature_nfc_emulation_support 0 +%define tizen_feature_nfc_support 1 +%define tizen_feature_notification_support 1 +%define tizen_feature_package_support 1 +%define tizen_feature_player_util_support 1 +%define tizen_feature_power_support 1 +%define tizen_feature_preference_support 1 +%define tizen_feature_push_support 1 +%if 0%{?tizen_is_emulator} +%define tizen_feature_se_support 0 +%else +%define tizen_feature_se_support 1 +%endif +%define tizen_feature_sensor_support 1 +%define tizen_feature_sound_support 1 +%define tizen_feature_system_info_support 1 +%define tizen_feature_system_setting_support 1 +%if 0%{?tizen_is_emulator} +%define tizen_feature_telephony_support 1 +%else +%define tizen_feature_telephony_support 0 +%endif +%define tizen_feature_time_support 1 +%define tizen_feature_web_setting_support 0 +%define tizen_feature_widget_service_support 1 +%define tizen_feature_wi_fi_support 1 +%define tizen_feature_inputdevice_support 1 +%define tizen_feature_tvinputdevice_support 0 #- telephony related APIs # CallHistory API is optional in Tizen Wearable Profile. # NetworkBearerSelection API is optional in Tizen Wearable Profile. -%define tizen_wearable_feature_telephony_support 0 -%define tizen_wearable_feature_callhistory_support 0 -%define tizen_wearable_feature_nbs_support 0 - -%define tizen_wearable_feature_time_support 1 -%define tizen_wearable_feature_web_setting_support 0 -%define tizen_wearable_feature_widget_service_support 1 -%define tizen_wearable_feature_wi_fi_support 1 -%define tizen_wearable_feature_inputdevice_support 1 -%define tizen_wearable_feature_tvinputdevice_support 0 +%if 0%{?tizen_feature_telephony_support} +%define tizen_feature_callhistory_support 1 +%define tizen_feature_nbs_support 1 +%else +%define tizen_feature_callhistory_support 0 +%define tizen_feature_nbs_support 0 +%endif -%define tizen_wearable_feature_convergence_support 1 +%define tizen_feature_convergence_support 1 +%endif # tizen_profile_wearable #################################################################### # TV Profile # #################################################################### - -%define tizen_tv_privilege_engine CYNARA - -%define tizen_tv_feature_account_support 0 -%define tizen_tv_feature_alarm_support 1 -%define tizen_tv_feature_app_control_settings_support 0 -%define tizen_tv_feature_application_support 1 -%define tizen_tv_feature_archive_support 1 -%define tizen_tv_feature_badge_support 0 -%define tizen_tv_feature_bluetooth_support 0 -%define tizen_tv_feature_bookmark_support 0 -%define tizen_tv_feature_calendar_support 0 -%define tizen_tv_feature_callhistory_support 0 -%define tizen_tv_feature_contact_support 0 -%define tizen_tv_feature_content_support 1 -%define tizen_tv_feature_datacontrol_support 1 -%define tizen_tv_feature_datasync_support 0 -%define tizen_tv_feature_download_support 1 -%define tizen_tv_feature_exif_support 1 -%define tizen_tv_feature_feedback_support 0 -%define tizen_tv_feature_filesystem_support 1 -%define tizen_tv_feature_fm_radio_support 0 -%define tizen_tv_feature_ham_support 0 -%define tizen_tv_feature_iotcon_support 1 -%define tizen_tv_feature_key_manager_support 1 -%define tizen_tv_feature_media_controller_support 0 -%define tizen_tv_feature_media_key_support 1 -%define tizen_tv_feature_message_port_support 1 -%define tizen_tv_feature_messaging_support 0 -%define tizen_tv_feature_nbs_support 0 -%define tizen_tv_feature_nfc_emulation_support 0 -%define tizen_tv_feature_nfc_support 0 -%define tizen_tv_feature_notification_support 0 -%define tizen_tv_feature_package_support 1 -%define tizen_tv_feature_player_util_support 0 -%define tizen_tv_feature_power_support 0 -%define tizen_tv_feature_preference_support 0 -%define tizen_tv_feature_push_support 1 -%define tizen_tv_feature_se_support 0 -%define tizen_tv_feature_sensor_support 0 -%define tizen_tv_feature_sound_support 0 -%define tizen_tv_feature_system_info_support 1 -%define tizen_tv_feature_system_setting_support 0 -%define tizen_tv_feature_telephony_support 0 -%define tizen_tv_feature_time_support 1 -%define tizen_tv_feature_web_setting_support 1 -%define tizen_tv_feature_widget_service_support 0 -%define tizen_tv_feature_wi_fi_support 1 -%define tizen_tv_feature_inputdevice_support 0 -%define tizen_tv_feature_tvinputdevice_support 1 -%define tizen_tv_feature_convergence_support 1 - -# common, or "unified (undefined)" -%define unified_build 1 -# GBM Product Build Optimization. Not for 4.0 Public Unified Build. -%if "%{?profile}" == "tv" || "%{?profile}" == "mobile" || "%{?profile}" == "wearable" || "%{?profile}" == "ivi" -%define unified_build 0 -%endif - -# GBM Product Build Optimization. Not for 4.0 Public Unified Build. -%if "%{?profile}" == "tv" || "%{?profile}" == "mobile" || "%{?profile}" == "wearable" || "%{?profile}" == "common" -%define tizen_privilege_engine %{expand:%tizen_%{?profile}_privilege_engine} - -%define tizen_feature_account_support %{expand:%tizen_%{?profile}_feature_account_support} -%define tizen_feature_alarm_support %{expand:%tizen_%{?profile}_feature_alarm_support} -%define tizen_feature_app_control_settings_support %{expand:%tizen_%{?profile}_feature_app_control_settings_support} -%define tizen_feature_application_support %{expand:%tizen_%{?profile}_feature_application_support} -%define tizen_feature_archive_support %{expand:%tizen_%{?profile}_feature_archive_support} -%define tizen_feature_badge_support %{expand:%tizen_%{?profile}_feature_badge_support} -%define tizen_feature_bluetooth_support %{expand:%tizen_%{?profile}_feature_bluetooth_support} -%define tizen_feature_bookmark_support %{expand:%tizen_%{?profile}_feature_bookmark_support} -%define tizen_feature_calendar_support %{expand:%tizen_%{?profile}_feature_calendar_support} -%define tizen_feature_contact_support %{expand:%tizen_%{?profile}_feature_contact_support} -%define tizen_feature_content_support %{expand:%tizen_%{?profile}_feature_content_support} -%define tizen_feature_datacontrol_support %{expand:%tizen_%{?profile}_feature_datacontrol_support} -%define tizen_feature_datasync_support %{expand:%tizen_%{?profile}_feature_datasync_support} -%define tizen_feature_download_support %{expand:%tizen_%{?profile}_feature_download_support} -%define tizen_feature_exif_support %{expand:%tizen_%{?profile}_feature_exif_support} -%define tizen_feature_feedback_support %{expand:%tizen_%{?profile}_feature_feedback_support} -%define tizen_feature_filesystem_support %{expand:%tizen_%{?profile}_feature_filesystem_support} -%define tizen_feature_fm_radio_support %{expand:%tizen_%{?profile}_feature_fm_radio_support} -%define tizen_feature_ham_support %{expand:%tizen_%{?profile}_feature_ham_support} -%define tizen_feature_iotcon_support %{expand:%tizen_%{?profile}_feature_iotcon_support} -%define tizen_feature_location_batch %{expand:%tizen_%{?profile}_feature_location_batch} -%define tizen_feature_key_manager_support %{expand:%tizen_%{?profile}_feature_key_manager_support} -%define tizen_feature_media_controller_support %{expand:%tizen_%{?profile}_feature_media_controller_support} -%define tizen_feature_media_key_support %{expand:%tizen_%{?profile}_feature_media_key_support} -%define tizen_feature_message_port_support %{expand:%tizen_%{?profile}_feature_message_port_support} -%define tizen_feature_messaging_support %{expand:%tizen_%{?profile}_feature_messaging_support} -%define tizen_feature_nfc_emulation_support %{expand:%tizen_%{?profile}_feature_nfc_emulation_support} -%define tizen_feature_nfc_support %{expand:%tizen_%{?profile}_feature_nfc_support} -%define tizen_feature_notification_support %{expand:%tizen_%{?profile}_feature_notification_support} -%define tizen_feature_package_support %{expand:%tizen_%{?profile}_feature_package_support} -%define tizen_feature_player_util_support %{expand:%tizen_%{?profile}_feature_player_util_support} -%define tizen_feature_power_support %{expand:%tizen_%{?profile}_feature_power_support} -%define tizen_feature_preference_support %{expand:%tizen_%{?profile}_feature_preference_support} -%define tizen_feature_push_support %{expand:%tizen_%{?profile}_feature_push_support} -%define tizen_feature_se_support %{expand:%tizen_%{?profile}_feature_se_support} -%define tizen_feature_sensor_support %{expand:%tizen_%{?profile}_feature_sensor_support} -%define tizen_feature_sound_support %{expand:%tizen_%{?profile}_feature_sound_support} -%define tizen_feature_system_info_support %{expand:%tizen_%{?profile}_feature_system_info_support} -%define tizen_feature_system_setting_support %{expand:%tizen_%{?profile}_feature_system_setting_support} -%define tizen_feature_telephony_support %{expand:%tizen_%{?profile}_feature_telephony_support} -%define tizen_feature_time_support %{expand:%tizen_%{?profile}_feature_time_support} -%define tizen_feature_web_setting_support %{expand:%tizen_%{?profile}_feature_web_setting_support} -%define tizen_feature_widget_service_support %{expand:%tizen_%{?profile}_feature_widget_service_support} -%define tizen_feature_wi_fi_support %{expand:%tizen_%{?profile}_feature_wi_fi_support} -%define tizen_feature_inputdevice_support %{expand:%tizen_%{?profile}_feature_inputdevice_support} -%define tizen_feature_callhistory_support %{expand:%tizen_%{?profile}_feature_callhistory_support} -%define tizen_feature_nbs_support %{expand:%tizen_%{?profile}_feature_nbs_support} -%define tizen_feature_tvinputdevice_support %{expand:%tizen_%{?profile}_feature_tvinputdevice_support} -%define tizen_feature_convergence_support %{expand:%tizen_%{?profile}_feature_convergence_support} -%endif +%if "%{?profile}" == "tv" + +%define tizen_privilege_engine CYNARA + +%define tizen_feature_account_support 0 +%define tizen_feature_alarm_support 1 +%define tizen_feature_app_control_settings_support 0 +%define tizen_feature_application_support 1 +%define tizen_feature_archive_support 1 +%define tizen_feature_badge_support 0 +%define tizen_feature_bluetooth_support 0 +%define tizen_feature_bookmark_support 0 +%define tizen_feature_calendar_support 0 +%define tizen_feature_callhistory_support 0 +%define tizen_feature_contact_support 0 +%define tizen_feature_content_support 1 +%define tizen_feature_datacontrol_support 1 +%define tizen_feature_datasync_support 0 +%define tizen_feature_download_support 1 +%define tizen_feature_exif_support 1 +%define tizen_feature_feedback_support 0 +%define tizen_feature_filesystem_support 1 +%define tizen_feature_fm_radio_support 0 +%define tizen_feature_ham_support 0 +%define tizen_feature_iotcon_support 1 +%define tizen_feature_key_manager_support 1 +%define tizen_feature_media_controller_support 0 +%define tizen_feature_media_key_support 1 +%define tizen_feature_message_port_support 1 +%define tizen_feature_messaging_support 0 +%define tizen_feature_nbs_support 0 +%define tizen_feature_nfc_emulation_support 0 +%define tizen_feature_nfc_support 0 +%define tizen_feature_notification_support 0 +%define tizen_feature_package_support 1 +%define tizen_feature_player_util_support 0 +%define tizen_feature_power_support 0 +%define tizen_feature_preference_support 0 +%define tizen_feature_push_support 1 +%define tizen_feature_se_support 0 +%define tizen_feature_sensor_support 0 +%define tizen_feature_sound_support 0 +%define tizen_feature_system_info_support 1 +%define tizen_feature_system_setting_support 0 +%define tizen_feature_telephony_support 0 +%define tizen_feature_time_support 1 +%define tizen_feature_web_setting_support 1 +%define tizen_feature_widget_service_support 0 +%define tizen_feature_wi_fi_support 1 +%define tizen_feature_inputdevice_support 0 +%define tizen_feature_tvinputdevice_support 1 +%define tizen_feature_convergence_support 1 + +%endif # tizen_profile_tv BuildRequires: pkgconfig(security-privilege-manager) BuildRequires: ninja @@ -384,7 +401,7 @@ BuildRequires: pkgconfig(capi-network-bluetooth) BuildRequires: pkgconfig(capi-network-wifi-manager) BuildRequires: pkgconfig(tapi) BuildRequires: pkgconfig(libpcrecpp) -BuildRequires: pkgconfig(capi-appfw-app-common) +BuildRequires: pkgconfig(capi-appfw-application) BuildRequires: pkgconfig(capi-appfw-app-manager) BuildRequires: pkgconfig(capi-appfw-package-manager) BuildRequires: pkgconfig(capi-content-media-content) @@ -405,236 +422,142 @@ BuildRequires: pkgconfig(wayland-client) BuildRequires: pkgconfig(security-privilege-checker) %endif -%if "%{?tizen_privilege_engine}" == "CYNARA" || "%{?unified_build}" == "1" +%if "%{?tizen_privilege_engine}" == "CYNARA" BuildRequires: pkgconfig(cynara-client) BuildRequires: pkgconfig(libsmack) %endif -%if "%{?tizen_feature_account_support}" == "1" || "%{?unified_build}" == "1" +%if 0%{?tizen_feature_account_support} BuildRequires: pkgconfig(accounts-svc) %endif -%if "%{?tizen_feature_alarm_support}" == "1" || "%{?unified_build}" == "1" -BuildRequires: pkgconfig(capi-appfw-app-control) -BuildRequires: pkgconfig(capi-appfw-application) +%if 0%{?tizen_feature_alarm_support} BuildRequires: pkgconfig(capi-appfw-alarm) BuildRequires: pkgconfig(alarm-service) %endif -%if "%{?tizen_feature_application_support}" == "1" || "%{?unified_build}" == "1" -BuildRequires: pkgconfig(capi-appfw-app-control) -BuildRequires: pkgconfig(capi-appfw-event) - -%if "%{?unified_build}" == "1" || "%{?profile}" == "mobile" -BuildRequires: pkgconfig(capi-context) -%endif - -%endif - -%if "%{?tizen_feature_bluetooth_support}" == "1" || "%{?unified_build}" == "1" -BuildRequires: pkgconfig(capi-appfw-app-control) -%endif - -%if "%{?tizen_feature_bookmark_support}" == "1" || "%{?unified_build}" == "1" +%if 0%{?tizen_feature_bookmark_support} BuildRequires: pkgconfig(capi-web-bookmark) BuildRequires: pkgconfig(bookmark-adaptor) %endif -%if "%{?tizen_feature_datacontrol_support}" == "1" || "%{?unified_build}" == "1" +%if 0%{?tizen_feature_datacontrol_support} BuildRequires: pkgconfig(capi-data-control) %endif -%if "%{?tizen_feature_download_support}" == "1" || "%{?unified_build}" == "1" +%if 0%{?tizen_feature_download_support} BuildRequires: pkgconfig(capi-web-url-download) %endif -%if "%{?tizen_feature_ham_support}" == "1" || "%{?unified_build}" == "1" +%if 0%{?tizen_feature_ham_support} BuildRequires: pkgconfig(motion) BuildRequires: pkgconfig(capi-system-sensor) BuildRequires: pkgconfig(capi-location-manager) BuildRequires: pkgconfig(sensor) %endif -%if "%{?tizen_feature_iotcon_support}" == "1" || "%{?unified_build}" == "1" +%if 0%{?tizen_feature_iotcon_support} BuildRequires: pkgconfig(iotcon) %endif -%if "%{?tizen_feature_player_util_support}" == "1" || "%{?unified_build}" == "1" +%if 0%{?tizen_feature_player_util_support} BuildRequires: pkgconfig(chromium-efl) %endif -%if "%{?tizen_feature_power_support}" == "1" || "%{?unified_build}" == "1" +%if 0%{?tizen_feature_power_support} BuildRequires: pkgconfig(deviced) %endif -%if "%{?tizen_feature_power_support}" == "1" || "%{?unified_build}" == "1" +%if 0%{?tizen_feature_power_support} BuildRequires: pkgconfig(capi-appfw-application) %endif -%if "%{?tizen_feature_push_support}" == "1" || "%{?unified_build}" == "1" +%if 0%{?tizen_feature_push_support} BuildRequires: pkgconfig(push) -BuildRequires: pkgconfig(capi-appfw-app-control) %endif -%if "%{?tizen_feature_key_manager_support}" == "1" || "%{?unified_build}" == "1" +%if 0%{?tizen_feature_key_manager_support} BuildRequires: pkgconfig(key-manager) %endif -%if "%{?tizen_feature_media_controller_support}" == "1" || "%{?unified_build}" == "1" +%if 0%{?tizen_feature_media_controller_support} BuildRequires: pkgconfig(capi-media-controller) %endif -%if "%{?tizen_feature_messaging_support}" == "1" || "%{?unified_build}" == "1" +%if 0%{?tizen_feature_messaging_support} BuildRequires: pkgconfig(ecore-file) BuildRequires: pkgconfig(email-service) BuildRequires: pkgconfig(msg-service) BuildRequires: pkgconfig(db-util) %endif -%if "%{?tizen_feature_badge_support}" == "1" || "%{?unified_build}" == "1" +%if 0%{?tizen_feature_badge_support} BuildRequires: pkgconfig(badge) %endif -%if "%{?tizen_feature_calendar_support}" == "1" || "%{?unified_build}" == "1" +%if 0%{?tizen_feature_calendar_support} BuildRequires: pkgconfig(calendar-service2) %endif -%if "%{?tizen_feature_contact_support}" == "1" || "%{?unified_build}" == "1" +%if 0%{?tizen_feature_contact_support} BuildRequires: pkgconfig(contacts-service2) %endif -%if "%{?tizen_feature_callhistory_support}" == "1" || "%{?unified_build}" == "1" +%if 0%{?tizen_feature_callhistory_support} BuildRequires: pkgconfig(contacts-service2) %endif -%if "%{?tizen_feature_exif_support}" == "1" || "%{?unified_build}" == "1" +%if 0%{?tizen_feature_exif_support} BuildRequires: pkgconfig(libexif) %endif -%if "%{?tizen_feature_nfc_support}" == "1" || "%{?unified_build}" == "1" +%if 0%{?tizen_feature_nfc_support} BuildRequires: pkgconfig(capi-network-nfc) -BuildRequires: pkgconfig(capi-appfw-app-control) %endif -%if "%{?tizen_feature_fm_radio_support}" == "1" || "%{?unified_build}" == "1" +%if 0%{?tizen_feature_fm_radio_support} BuildRequires: pkgconfig(capi-media-radio) %endif -%if "%{?tizen_feature_feedback_support}" == "1" || "%{?unified_build}" == "1" +%if 0%{?tizen_feature_feedback_support} BuildRequires: pkgconfig(feedback) %endif -%if "%{?tizen_feature_se_support}" == "1" || "%{?unified_build}" == "1" +%if 0%{?tizen_feature_se_support} BuildRequires: pkgconfig(capi-network-smartcard) %endif -%if "%{?tizen_feature_message_port_support}" == "1" || "%{?unified_build}" == "1" +%if 0%{?tizen_feature_message_port_support} BuildRequires: pkgconfig(capi-message-port) %endif -%if "%{?tizen_feature_notification_support}" == "1" || "%{?unified_build}" == "1" +%if 0%{?tizen_feature_notification_support} BuildRequires: pkgconfig(notification) -BuildRequires: pkgconfig(capi-appfw-app-control) %endif -%if "%{?tizen_feature_preference_support}" == "1" || "%{?unified_build}" == "1" -BuildRequires: pkgconfig(capi-appfw-preference) -%endif - -%if "%{?tizen_feature_sound_support}" == "1" || "%{?unified_build}" == "1" +%if 0%{?tizen_feature_sound_support} BuildRequires: pkgconfig(capi-media-sound-manager) %endif -%if "%{?tizen_feature_sensor_support}" == "1" || "%{?unified_build}" == "1" +%if 0%{?tizen_feature_sensor_support} BuildRequires: pkgconfig(capi-system-sensor) %endif -%if "%{?tizen_feature_media_key_support}" == "1" || "%{?unified_build}" == "1" +%if 0%{?tizen_feature_media_key_support} BuildRequires: pkgconfig(capi-system-media-key) %endif -%if "%{?tizen_feature_convergence_support}" == "1" || "%{?unified_build}" == "1" +%if 0%{?tizen_feature_convergence_support} BuildRequires: pkgconfig(d2d-conv-manager) %endif -%if "%{?tizen_feature_widget_service_support}" == "1" || "%{?unified_build}" == "1" +%if 0%{?tizen_feature_widget_service_support} BuildRequires: pkgconfig(widget_service) %endif -Requires: %{name}-compat = %{version}-%{release} -%if "%{?unified_build}" == "1" -Recommends: %{name}-profile_common = %{version}-%{release} -%endif - %description Tizen Web APIs implemented. -%package profile_common -Summary: webapi-plugin binaries for common profile -Provides: %{name}-compat = %{version}-%{release} -Conflicts: %{name}-profile_mobile -Conflicts: %{name}-profile_wearable -Conflicts: %{name}-profile_tv -Conflicts: %{name}-profile_ivi -%description profile_common -Tizen Web API implementation binaries for Tizen common profile. - -%package profile_mobile -Summary: webapi-plugin binaries for mobile profile -Provides: %{name}-compat = %{version}-%{release} -Conflicts: %{name}-profile_common -Conflicts: %{name}-profile_wearable -Conflicts: %{name}-profile_tv -Conflicts: %{name}-profile_ivi -%description profile_mobile -Tizen Web API implementation binaries for Tizen mobile profile. - -%ifarch %{ix86} x86_64 -%package mobile-extension-emulator -Summary: webapi-plugin binaries for mobile emulator -Requires: %{name}-profile_mobile = %{version}-%{release} -%description mobile-extension-emulator -Tizen Web API implementation binaries for Tizen mobile emulator. -%endif - -%package profile_wearable -Summary: webapi-plugin binaries for wearable profile -Provides: %{name}-compat = %{version}-%{release} -Conflicts: %{name}-profile_mobile -Conflicts: %{name}-profile_common -Conflicts: %{name}-profile_tv -Conflicts: %{name}-profile_ivi -%description profile_wearable -Tizen Web API implementation binaries for Tizen wearable profile. - -%ifarch %{ix86} x86_64 -%package wearable-extension-emulator -Summary: webapi-plugin binaries for wearable emulator -Requires: %{name}-profile_wearable = %{version}-%{release} -%description wearable-extension-emulator -Tizen Web API implementation binaries for Tizen wearable emulator. -%endif - -%package profile_tv -Summary: webapi-plugin binaries for tv profile -Provides: %{name}-compat = %{version}-%{release} -Conflicts: %{name}-profile_mobile -Conflicts: %{name}-profile_wearable -Conflicts: %{name}-profile_common -Conflicts: %{name}-profile_ivi -%description profile_tv -Tizen Web API implementation binaries for Tizen tv profile. - -%package profile_ivi -Summary: webapi-plugin binaries for ivi profile -Provides: %{name}-compat = %{version}-%{release} -Conflicts: %{name}-profile_mobile -Conflicts: %{name}-profile_wearable -Conflicts: %{name}-profile_tv -Conflicts: %{name}-profile_common -%description profile_ivi -Tizen Web API implementation binaries for Tizen ivi profile. - %package devel Summary: webapi-plugins development headers Group: Development/Libraries @@ -649,382 +572,12 @@ webapi-plugins development headers %build export GYP_GENERATORS='ninja' - -%if "%{?unified_build}" == "1" -# Build All Profiles - -# Mobile -GYP_OPTIONS="--depth=. -Dtizen=1 -Dextension_build_type=Debug -Dextension_host_os=mobile -Dprivilege_engine=%{tizen_mobile_privilege_engine}" -GYP_OPTIONS="$GYP_OPTIONS -Ddisplay_type=%{display_type}" -GYP_OPTIONS="$GYP_OPTIONS -Dcrosswalk_extensions_path=%{crosswalk_extensions_path}" - -# feature flags -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_account_support=%{?tizen_mobile_feature_account_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_alarm_support=%{?tizen_mobile_feature_alarm_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_app_control_settings_support=%{?tizen_mobile_feature_app_control_settings_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_application_support=%{?tizen_mobile_feature_application_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_archive_support=%{?tizen_mobile_feature_archive_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_badge_support=%{?tizen_mobile_feature_badge_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_bluetooth_support=%{?tizen_mobile_feature_bluetooth_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_bookmark_support=%{?tizen_mobile_feature_bookmark_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_calendar_support=%{?tizen_mobile_feature_calendar_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_callhistory_support=%{?tizen_mobile_feature_callhistory_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_contact_support=%{?tizen_mobile_feature_contact_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_content_support=%{?tizen_mobile_feature_content_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_datacontrol_support=%{?tizen_mobile_feature_datacontrol_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_datasync_support=%{?tizen_mobile_feature_datasync_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_download_support=%{?tizen_mobile_feature_download_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_exif_support=%{?tizen_mobile_feature_exif_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_feedback_support=%{?tizen_mobile_feature_feedback_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_filesystem_support=%{?tizen_mobile_feature_filesystem_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_fm_radio_support=%{?tizen_mobile_feature_fm_radio_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_ham_support=%{?tizen_mobile_feature_ham_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_iotcon_support=%{?tizen_mobile_feature_iotcon_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_location_batch=%{?tizen_mobile_feature_location_batch}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_key_manager_support=%{?tizen_mobile_feature_key_manager_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_controller_support=%{?tizen_mobile_feature_media_controller_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_key_support=%{?tizen_mobile_feature_media_key_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_message_port_support=%{?tizen_mobile_feature_message_port_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_messaging_support=%{?tizen_mobile_feature_messaging_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nbs_support=%{?tizen_mobile_feature_nbs_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_emulation_support=%{?tizen_mobile_feature_nfc_emulation_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_support=%{?tizen_mobile_feature_nfc_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_notification_support=%{?tizen_mobile_feature_notification_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_package_support=%{?tizen_mobile_feature_package_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_player_util_support=%{?tizen_mobile_feature_player_util_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_power_support=%{?tizen_mobile_feature_power_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_preference_support=%{?tizen_mobile_feature_preference_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_push_support=%{?tizen_mobile_feature_push_support}" -#GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sap_support=%{?tizen_mobile_feature_sap_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sensor_support=%{?tizen_mobile_feature_sensor_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_se_support=%{?tizen_mobile_feature_se_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sound_support=%{?tizen_mobile_feature_sound_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_system_info_support=%{?tizen_mobile_feature_system_info_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_system_setting_support=%{?tizen_mobile_feature_system_setting_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_telephony_support=%{?tizen_mobile_feature_telephony_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_time_support=%{?tizen_mobile_feature_time_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_inputdevice_support=%{?tizen_mobile_feature_inputdevice_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_web_setting_support=%{?tizen_mobile_feature_web_setting_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_widget_service_support=%{?tizen_mobile_feature_widget_service_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_wi_fi_support=%{?tizen_mobile_feature_wi_fi_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_tvinputdevice_support=%{?tizen_mobile_feature_tvinputdevice_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_convergence_support=%{?tizen_mobile_feature_convergence_support}" - -./tools/gyp/gyp $GYP_OPTIONS src/tizen-wrt.gyp - -ninja -C out/Default %{?_smp_mflags} -pushd out -mv Default bin_mobile -popd - -# mobile-extension-emulator -%ifarch %{ix86} x86_64 - -%define tizen_mobile_feature_bluetooth_support 0 - -# FM radio feature -%define tizen_mobile_feature_fm_radio_support 1 - -%define tizen_mobile_feature_ham_support 1 -%define tizen_mobile_feature_media_key_support 0 -%define tizen_mobile_feature_nfc_emulation_support 0 -%define tizen_mobile_feature_nfc_support 1 - -# secure element feature -%define tizen_mobile_feature_se_support 0 - -# telephony feature -%define tizen_mobile_feature_telephony_support 1 -%define tizen_mobile_feature_callhistory_support 1 -%define tizen_mobile_feature_nbs_support 1 - -%define tizen_mobile_feature_wi_fi_support 0 - -GYP_OPTIONS="--depth=. -Dtizen=1 -Dextension_build_type=Debug -Dextension_host_os=mobile -Dprivilege_engine=%{tizen_mobile_privilege_engine}" -GYP_OPTIONS="$GYP_OPTIONS -Ddisplay_type=%{display_type}" -GYP_OPTIONS="$GYP_OPTIONS -Dcrosswalk_extensions_path=%{crosswalk_extensions_path}" - -# feature flags -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_account_support=%{?tizen_mobile_feature_account_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_alarm_support=%{?tizen_mobile_feature_alarm_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_app_control_settings_support=%{?tizen_mobile_feature_app_control_settings_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_application_support=%{?tizen_mobile_feature_application_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_archive_support=%{?tizen_mobile_feature_archive_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_badge_support=%{?tizen_mobile_feature_badge_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_bluetooth_support=%{?tizen_mobile_feature_bluetooth_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_bookmark_support=%{?tizen_mobile_feature_bookmark_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_calendar_support=%{?tizen_mobile_feature_calendar_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_callhistory_support=%{?tizen_mobile_feature_callhistory_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_contact_support=%{?tizen_mobile_feature_contact_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_content_support=%{?tizen_mobile_feature_content_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_datacontrol_support=%{?tizen_mobile_feature_datacontrol_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_datasync_support=%{?tizen_mobile_feature_datasync_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_download_support=%{?tizen_mobile_feature_download_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_exif_support=%{?tizen_mobile_feature_exif_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_feedback_support=%{?tizen_mobile_feature_feedback_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_filesystem_support=%{?tizen_mobile_feature_filesystem_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_fm_radio_support=%{?tizen_mobile_feature_fm_radio_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_ham_support=%{?tizen_mobile_feature_ham_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_iotcon_support=%{?tizen_mobile_feature_iotcon_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_location_batch=%{?tizen_mobile_feature_location_batch}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_key_manager_support=%{?tizen_mobile_feature_key_manager_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_controller_support=%{?tizen_mobile_feature_media_controller_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_key_support=%{?tizen_mobile_feature_media_key_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_message_port_support=%{?tizen_mobile_feature_message_port_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_messaging_support=%{?tizen_mobile_feature_messaging_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nbs_support=%{?tizen_mobile_feature_nbs_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_emulation_support=%{?tizen_mobile_feature_nfc_emulation_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_support=%{?tizen_mobile_feature_nfc_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_notification_support=%{?tizen_mobile_feature_notification_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_package_support=%{?tizen_mobile_feature_package_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_player_util_support=%{?tizen_mobile_feature_player_util_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_power_support=%{?tizen_mobile_feature_power_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_preference_support=%{?tizen_mobile_feature_preference_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_push_support=%{?tizen_mobile_feature_push_support}" -#GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sap_support=%{?tizen_mobile_feature_sap_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sensor_support=%{?tizen_mobile_feature_sensor_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_se_support=%{?tizen_mobile_feature_se_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sound_support=%{?tizen_mobile_feature_sound_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_system_info_support=%{?tizen_mobile_feature_system_info_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_system_setting_support=%{?tizen_mobile_feature_system_setting_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_telephony_support=%{?tizen_mobile_feature_telephony_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_time_support=%{?tizen_mobile_feature_time_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_inputdevice_support=%{?tizen_mobile_feature_inputdevice_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_web_setting_support=%{?tizen_mobile_feature_web_setting_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_widget_service_support=%{?tizen_mobile_feature_widget_service_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_wi_fi_support=%{?tizen_mobile_feature_wi_fi_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_tvinputdevice_support=%{?tizen_mobile_feature_tvinputdevice_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_convergence_support=%{?tizen_mobile_feature_convergence_support}" - -./tools/gyp/gyp $GYP_OPTIONS src/tizen-wrt.gyp - -ninja -C out/Default %{?_smp_mflags} -pushd out -mv Default bin_mobile_emulator -popd -%endif - -# WEARABLE -GYP_OPTIONS="--depth=. -Dtizen=1 -Dextension_build_type=Debug -Dextension_host_os=wearable -Dprivilege_engine=%{tizen_wearable_privilege_engine}" -GYP_OPTIONS="$GYP_OPTIONS -Ddisplay_type=%{display_type}" -GYP_OPTIONS="$GYP_OPTIONS -Dcrosswalk_extensions_path=%{crosswalk_extensions_path}" - -# feature flags -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_account_support=%{?tizen_wearable_feature_account_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_alarm_support=%{?tizen_wearable_feature_alarm_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_app_control_settings_support=%{?tizen_wearable_feature_app_control_settings_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_application_support=%{?tizen_wearable_feature_application_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_archive_support=%{?tizen_wearable_feature_archive_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_badge_support=%{?tizen_wearable_feature_badge_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_bluetooth_support=%{?tizen_wearable_feature_bluetooth_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_bookmark_support=%{?tizen_wearable_feature_bookmark_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_calendar_support=%{?tizen_wearable_feature_calendar_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_callhistory_support=%{?tizen_wearable_feature_callhistory_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_contact_support=%{?tizen_wearable_feature_contact_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_content_support=%{?tizen_wearable_feature_content_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_datacontrol_support=%{?tizen_wearable_feature_datacontrol_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_datasync_support=%{?tizen_wearable_feature_datasync_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_download_support=%{?tizen_wearable_feature_download_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_exif_support=%{?tizen_wearable_feature_exif_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_feedback_support=%{?tizen_wearable_feature_feedback_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_filesystem_support=%{?tizen_wearable_feature_filesystem_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_fm_radio_support=%{?tizen_wearable_feature_fm_radio_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_ham_support=%{?tizen_wearable_feature_ham_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_iotcon_support=%{?tizen_wearable_feature_iotcon_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_location_batch=%{?tizen_wearable_feature_location_batch}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_key_manager_support=%{?tizen_wearable_feature_key_manager_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_controller_support=%{?tizen_wearable_feature_media_controller_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_key_support=%{?tizen_wearable_feature_media_key_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_message_port_support=%{?tizen_wearable_feature_message_port_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_messaging_support=%{?tizen_wearable_feature_messaging_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nbs_support=%{?tizen_wearable_feature_nbs_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_emulation_support=%{?tizen_wearable_feature_nfc_emulation_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_support=%{?tizen_wearable_feature_nfc_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_notification_support=%{?tizen_wearable_feature_notification_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_package_support=%{?tizen_wearable_feature_package_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_player_util_support=%{?tizen_wearable_feature_player_util_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_power_support=%{?tizen_wearable_feature_power_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_preference_support=%{?tizen_wearable_feature_preference_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_push_support=%{?tizen_wearable_feature_push_support}" -#GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sap_support=%{?tizen_wearable_feature_sap_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sensor_support=%{?tizen_wearable_feature_sensor_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_se_support=%{?tizen_wearable_feature_se_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sound_support=%{?tizen_wearable_feature_sound_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_system_info_support=%{?tizen_wearable_feature_system_info_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_system_setting_support=%{?tizen_wearable_feature_system_setting_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_telephony_support=%{?tizen_wearable_feature_telephony_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_time_support=%{?tizen_wearable_feature_time_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_inputdevice_support=%{?tizen_wearable_feature_inputdevice_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_web_setting_support=%{?tizen_wearable_feature_web_setting_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_widget_service_support=%{?tizen_wearable_feature_widget_service_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_wi_fi_support=%{?tizen_wearable_feature_wi_fi_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_tvinputdevice_support=%{?tizen_wearable_feature_tvinputdevice_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_convergence_support=%{?tizen_wearable_feature_convergence_support}" - -./tools/gyp/gyp $GYP_OPTIONS src/tizen-wrt.gyp - -ninja -C out/Default %{?_smp_mflags} -pushd out -mv Default bin_wearable -popd - -# wearable-extension-emulator -%ifarch %{ix86} x86_64 - -%define tizen_wearable_feature_bluetooth_support 0 - -# MediayKey API is optional in Tizen Wearable Profile. -# tizen.org/feature/network.bluetooth.audio.media is required for MediayKey API -%define tizen_wearable_feature_media_key_support 0 - -#- telephony related APIs -# CallHistory API is optional in Tizen Wearable Profile. -# NetworkBearerSelection API is optional in Tizen Wearable Profile. -%define tizen_wearable_feature_se_support 0 -%define tizen_wearable_feature_telephony_support 1 -%define tizen_wearable_feature_callhistory_support 1 -%define tizen_wearable_feature_nbs_support 1 - -GYP_OPTIONS="--depth=. -Dtizen=1 -Dextension_build_type=Debug -Dextension_host_os=wearable -Dprivilege_engine=%{tizen_wearable_privilege_engine}" -GYP_OPTIONS="$GYP_OPTIONS -Ddisplay_type=%{display_type}" -GYP_OPTIONS="$GYP_OPTIONS -Dcrosswalk_extensions_path=%{crosswalk_extensions_path}" - -# feature flags -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_account_support=%{?tizen_wearable_feature_account_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_alarm_support=%{?tizen_wearable_feature_alarm_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_app_control_settings_support=%{?tizen_wearable_feature_app_control_settings_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_application_support=%{?tizen_wearable_feature_application_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_archive_support=%{?tizen_wearable_feature_archive_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_badge_support=%{?tizen_wearable_feature_badge_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_bluetooth_support=%{?tizen_wearable_feature_bluetooth_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_bookmark_support=%{?tizen_wearable_feature_bookmark_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_calendar_support=%{?tizen_wearable_feature_calendar_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_callhistory_support=%{?tizen_wearable_feature_callhistory_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_contact_support=%{?tizen_wearable_feature_contact_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_content_support=%{?tizen_wearable_feature_content_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_datacontrol_support=%{?tizen_wearable_feature_datacontrol_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_datasync_support=%{?tizen_wearable_feature_datasync_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_download_support=%{?tizen_wearable_feature_download_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_exif_support=%{?tizen_wearable_feature_exif_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_feedback_support=%{?tizen_wearable_feature_feedback_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_filesystem_support=%{?tizen_wearable_feature_filesystem_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_fm_radio_support=%{?tizen_wearable_feature_fm_radio_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_ham_support=%{?tizen_wearable_feature_ham_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_iotcon_support=%{?tizen_wearable_feature_iotcon_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_location_batch=%{?tizen_wearable_feature_location_batch}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_key_manager_support=%{?tizen_wearable_feature_key_manager_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_controller_support=%{?tizen_wearable_feature_media_controller_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_key_support=%{?tizen_wearable_feature_media_key_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_message_port_support=%{?tizen_wearable_feature_message_port_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_messaging_support=%{?tizen_wearable_feature_messaging_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nbs_support=%{?tizen_wearable_feature_nbs_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_emulation_support=%{?tizen_wearable_feature_nfc_emulation_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_support=%{?tizen_wearable_feature_nfc_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_notification_support=%{?tizen_wearable_feature_notification_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_package_support=%{?tizen_wearable_feature_package_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_player_util_support=%{?tizen_wearable_feature_player_util_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_power_support=%{?tizen_wearable_feature_power_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_preference_support=%{?tizen_wearable_feature_preference_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_push_support=%{?tizen_wearable_feature_push_support}" -#GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sap_support=%{?tizen_wearable_feature_sap_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sensor_support=%{?tizen_wearable_feature_sensor_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_se_support=%{?tizen_wearable_feature_se_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sound_support=%{?tizen_wearable_feature_sound_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_system_info_support=%{?tizen_wearable_feature_system_info_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_system_setting_support=%{?tizen_wearable_feature_system_setting_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_telephony_support=%{?tizen_wearable_feature_telephony_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_time_support=%{?tizen_wearable_feature_time_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_inputdevice_support=%{?tizen_wearable_feature_inputdevice_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_web_setting_support=%{?tizen_wearable_feature_web_setting_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_widget_service_support=%{?tizen_wearable_feature_widget_service_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_wi_fi_support=%{?tizen_wearable_feature_wi_fi_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_tvinputdevice_support=%{?tizen_wearable_feature_tvinputdevice_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_convergence_support=%{?tizen_wearable_feature_convergence_support}" - -./tools/gyp/gyp $GYP_OPTIONS src/tizen-wrt.gyp - -ninja -C out/Default %{?_smp_mflags} -pushd out -mv Default bin_wearable_emulator -popd -%endif - -# TV -GYP_OPTIONS="--depth=. -Dtizen=1 -Dextension_build_type=Debug -Dextension_host_os=tv -Dprivilege_engine=%{tizen_tv_privilege_engine}" -GYP_OPTIONS="$GYP_OPTIONS -Ddisplay_type=%{display_type}" -GYP_OPTIONS="$GYP_OPTIONS -Dcrosswalk_extensions_path=%{crosswalk_extensions_path}" - -# feature flags -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_account_support=%{?tizen_tv_feature_account_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_alarm_support=%{?tizen_tv_feature_alarm_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_app_control_settings_support=%{?tizen_tv_feature_app_control_settings_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_application_support=%{?tizen_tv_feature_application_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_archive_support=%{?tizen_tv_feature_archive_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_badge_support=%{?tizen_tv_feature_badge_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_bluetooth_support=%{?tizen_tv_feature_bluetooth_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_bookmark_support=%{?tizen_tv_feature_bookmark_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_calendar_support=%{?tizen_tv_feature_calendar_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_callhistory_support=%{?tizen_tv_feature_callhistory_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_contact_support=%{?tizen_tv_feature_contact_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_content_support=%{?tizen_tv_feature_content_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_datacontrol_support=%{?tizen_tv_feature_datacontrol_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_datasync_support=%{?tizen_tv_feature_datasync_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_download_support=%{?tizen_tv_feature_download_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_exif_support=%{?tizen_tv_feature_exif_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_feedback_support=%{?tizen_tv_feature_feedback_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_filesystem_support=%{?tizen_tv_feature_filesystem_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_fm_radio_support=%{?tizen_tv_feature_fm_radio_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_ham_support=%{?tizen_tv_feature_ham_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_iotcon_support=%{?tizen_tv_feature_iotcon_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_location_batch=%{?tizen_tv_feature_location_batch}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_key_manager_support=%{?tizen_tv_feature_key_manager_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_controller_support=%{?tizen_tv_feature_media_controller_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_key_support=%{?tizen_tv_feature_media_key_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_message_port_support=%{?tizen_tv_feature_message_port_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_messaging_support=%{?tizen_tv_feature_messaging_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nbs_support=%{?tizen_tv_feature_nbs_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_emulation_support=%{?tizen_tv_feature_nfc_emulation_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_support=%{?tizen_tv_feature_nfc_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_notification_support=%{?tizen_tv_feature_notification_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_package_support=%{?tizen_tv_feature_package_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_player_util_support=%{?tizen_tv_feature_player_util_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_power_support=%{?tizen_tv_feature_power_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_preference_support=%{?tizen_tv_feature_preference_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_push_support=%{?tizen_tv_feature_push_support}" -#GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sap_support=%{?tizen_tv_feature_sap_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sensor_support=%{?tizen_tv_feature_sensor_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_se_support=%{?tizen_tv_feature_se_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sound_support=%{?tizen_tv_feature_sound_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_system_info_support=%{?tizen_tv_feature_system_info_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_system_setting_support=%{?tizen_tv_feature_system_setting_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_telephony_support=%{?tizen_tv_feature_telephony_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_time_support=%{?tizen_tv_feature_time_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_inputdevice_support=%{?tizen_tv_feature_inputdevice_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_web_setting_support=%{?tizen_tv_feature_web_setting_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_widget_service_support=%{?tizen_tv_feature_widget_service_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_wi_fi_support=%{?tizen_tv_feature_wi_fi_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_tvinputdevice_support=%{?tizen_tv_feature_tvinputdevice_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_convergence_support=%{?tizen_tv_feature_convergence_support}" - -./tools/gyp/gyp $GYP_OPTIONS src/tizen-wrt.gyp - -ninja -C out/Default %{?_smp_mflags} -pushd out -mv Default bin_tv -popd - -%endif - -# Unified: common/ Others: its own profile -%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "wearable" && "%{?profile}" != "ivi" -GYP_OPTIONS="--depth=. -Dtizen=1 -Dextension_build_type=Debug -Dextension_host_os=common -Dprivilege_engine=%{tizen_privilege_engine}" -%else GYP_OPTIONS="--depth=. -Dtizen=1 -Dextension_build_type=Debug -Dextension_host_os=%{profile} -Dprivilege_engine=%{tizen_privilege_engine}" -%endif GYP_OPTIONS="$GYP_OPTIONS -Ddisplay_type=%{display_type}" GYP_OPTIONS="$GYP_OPTIONS -Dcrosswalk_extensions_path=%{crosswalk_extensions_path}" # feature flags +GYP_OPTIONS="$GYP_OPTIONS -Dtizen_is_emulator=%{?tizen_is_emulator}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_account_support=%{?tizen_feature_account_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_alarm_support=%{?tizen_feature_alarm_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_app_control_settings_support=%{?tizen_feature_app_control_settings_support}" @@ -1061,7 +614,7 @@ GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_player_util_support=%{?tizen_feature_p GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_power_support=%{?tizen_feature_power_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_preference_support=%{?tizen_feature_preference_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_push_support=%{?tizen_feature_push_support}" -#GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sap_support=%{?tizen_feature_sap_support}" +GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sap_support=%{?tizen_feature_sap_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sensor_support=%{?tizen_feature_sensor_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_se_support=%{?tizen_feature_se_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sound_support=%{?tizen_feature_sound_support}" @@ -1078,117 +631,17 @@ GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_convergence_support=%{?tizen_feature_c ./tools/gyp/gyp $GYP_OPTIONS src/tizen-wrt.gyp -%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "wearable" && "%{?profile}" != "ivi" ninja -C out/Default %{?_smp_mflags} -pushd out -mv Default bin_common -ln -sf bin_common Default - -# IVI does not have independent configurations, yet. -# Copying the whole result in order to support ivi subpacakge -cp -R bin_common bin_ivi - -popd -%else -ninja -C out/Default %{?_smp_mflags} -pushd out -mv Default bin_%{?profile} -ln -sf bin_%{?profile} Default -popd -%endif %install +mkdir -p %{buildroot}/usr/share/license +cp LICENSE %{buildroot}/usr/share/license/%{name} +cat LICENSE.BSD-3-Clause >> %{buildroot}/usr/share/license/%{name} +cat LICENSE.MIT >> %{buildroot}/usr/share/license/%{name} # Extensions. mkdir -p %{buildroot}%{crosswalk_extensions_path} - -%if "%{?unified_build}" == "1" || "%{?profile}" == "common" -mkdir -p %{buildroot}%{crosswalk_extensions_path}/common -install -p -m 644 out/bin_common/libtizen*.so %{buildroot}%{crosswalk_extensions_path}/common -# execute desc_gentool -LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{crosswalk_extensions_path}/common out/Default/desc_gentool \ - %{crosswalk_extensions_path}/common \ - %{buildroot}%{crosswalk_extensions_path}/common > plugins.json - -# temporary plugins description for lazy loading -install -p -m 644 plugins.json %{buildroot}%{crosswalk_extensions_path}/common/plugins.json -%endif - -%if "%{?unified_build}" == "1" || "%{?profile}" == "mobile" -mkdir -p %{buildroot}%{crosswalk_extensions_path}/mobile -install -p -m 644 out/bin_mobile/libtizen*.so %{buildroot}%{crosswalk_extensions_path}/mobile -# execute desc_gentool -LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{crosswalk_extensions_path}/mobile out/Default/desc_gentool \ - %{crosswalk_extensions_path}/mobile \ - %{buildroot}%{crosswalk_extensions_path}/mobile > plugins.json - -# temporary plugins description for lazy loading -install -p -m 644 plugins.json %{buildroot}%{crosswalk_extensions_path}/mobile/plugins.json - -# mobile-extension-emulator -%ifarch %{ix86} x86_64 -mkdir -p %{buildroot}%{crosswalk_extensions_path}/mobile_emulator -install -p -m 644 out/bin_mobile_emulator/libtizen*.so %{buildroot}%{crosswalk_extensions_path}/mobile_emulator -# execute desc_gentool -LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{crosswalk_extensions_path}/mobile_emulator out/Default/desc_gentool \ - %{crosswalk_extensions_path}/mobile_emulator \ - %{buildroot}%{crosswalk_extensions_path}/mobile_emulator > plugins.json - -# temporary plugins description for lazy loading -install -p -m 644 plugins.json %{buildroot}%{crosswalk_extensions_path}/mobile_emulator/plugins.json -%endif // mobile-extension-emulator - -%endif // mobile - -%if "%{?unified_build}" == "1" || "%{?profile}" == "wearable" -mkdir -p %{buildroot}%{crosswalk_extensions_path}/wearable -install -p -m 644 out/bin_wearable/libtizen*.so %{buildroot}%{crosswalk_extensions_path}/wearable -# execute desc_gentool -LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{crosswalk_extensions_path}/wearable out/Default/desc_gentool \ - %{crosswalk_extensions_path}/wearable \ - %{buildroot}%{crosswalk_extensions_path}/wearable > plugins.json - -# temporary plugins description for lazy loading -install -p -m 644 plugins.json %{buildroot}%{crosswalk_extensions_path}/wearable/plugins.json - -# wearable-extension-emulator -%ifarch %{ix86} x86_64 -mkdir -p %{buildroot}%{crosswalk_extensions_path}/wearable_emulator -install -p -m 644 out/bin_wearable_emulator/libtizen*.so %{buildroot}%{crosswalk_extensions_path}/wearable_emulator -# execute desc_gentool -LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{crosswalk_extensions_path}/mobile_emulator out/Default/desc_gentool \ - %{crosswalk_extensions_path}/wearable_emulator \ - %{buildroot}%{crosswalk_extensions_path}/wearable_emulator > plugins.json - -# temporary plugins description for lazy loading -install -p -m 644 plugins.json %{buildroot}%{crosswalk_extensions_path}/wearable_emulator/plugins.json -%endif // wearable-extension-emulator - -%endif // wearable - -%if "%{?unified_build}" == "1" || "%{?profile}" == "tv" -mkdir -p %{buildroot}%{crosswalk_extensions_path}/tv -install -p -m 644 out/bin_tv/libtizen*.so %{buildroot}%{crosswalk_extensions_path}/tv -# execute desc_gentool -LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{crosswalk_extensions_path}/tv out/Default/desc_gentool \ - %{crosswalk_extensions_path}/tv \ - %{buildroot}%{crosswalk_extensions_path}/tv > plugins.json - -# temporary plugins description for lazy loading -install -p -m 644 plugins.json %{buildroot}%{crosswalk_extensions_path}/tv/plugins.json -%endif - -%if "%{?unified_build}" == "1" || "%{?profile}" == "ivi" -mkdir -p %{buildroot}%{crosswalk_extensions_path}/ivi -install -p -m 644 out/bin_ivi/libtizen*.so %{buildroot}%{crosswalk_extensions_path}/ivi -# execute desc_gentool -LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{crosswalk_extensions_path}/ivi out/Default/desc_gentool \ - %{crosswalk_extensions_path}/ivi \ - %{buildroot}%{crosswalk_extensions_path}/ivi > plugins.json - -# temporary plugins description for lazy loading -install -p -m 644 plugins.json %{buildroot}%{crosswalk_extensions_path}/ivi/plugins.json -%endif +install -p -m 644 out/Default/libtizen*.so %{buildroot}%{crosswalk_extensions_path} # devel files mkdir -p %{buildroot}%{_libdir}/pkgconfig @@ -1209,123 +662,20 @@ cp -a tools/gyp %{buildroot}%{_includedir}/%{name}/tools/gyp cp -a tools/slimit %{buildroot}%{_includedir}/%{name}/tools/slimit cp -a out/Default/desc_gentool %{buildroot}%{_includedir}/%{name}/tools/desc_gentool -%files -%manifest webapi-plugins.manifest -%license LICENSE - -%if "%{?unified_build}" == "1" || "%{?profile}" == "common" -%post profile_common -ln -sf %{crosswalk_extensions_path}/common/* %{crosswalk_extensions_path} -%preun profile_common -# This is an un-installation. -if [ "$1" == "0" ]; then - rm %{crosswalk_extensions_path}/libtizen*.so - rm %{crosswalk_extensions_path}/plugins.json -fi -%files profile_common -%dir %{crosswalk_extensions_path}/common/ -%{crosswalk_extensions_path}/common/libtizen*.so -%{crosswalk_extensions_path}/common/plugins.json -%manifest webapi-plugins.manifest -%endif +# execute desc_gentool +LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{crosswalk_extensions_path} out/Default/desc_gentool \ + %{crosswalk_extensions_path} \ + %{buildroot}%{crosswalk_extensions_path} > plugins.json -%if "%{?unified_build}" == "1" || "%{?profile}" == "mobile" -%post profile_mobile -ln -sf %{crosswalk_extensions_path}/mobile/* %{crosswalk_extensions_path} -%preun profile_mobile -# This is an un-installation. -if [ "$1" == "0" ]; then - rm %{crosswalk_extensions_path}/libtizen*.so - rm %{crosswalk_extensions_path}/plugins.json -fi -%files profile_mobile -%dir %{crosswalk_extensions_path}/mobile/ -%{crosswalk_extensions_path}/mobile/libtizen*.so -%{crosswalk_extensions_path}/mobile/plugins.json -%manifest webapi-plugins.manifest +# temporary plugins description for lazy loading +install -p -m 644 plugins.json %{buildroot}%{crosswalk_extensions_path}/plugins.json -# mobile-extension-emulator -%ifarch %{ix86} x86_64 -%post mobile-extension-emulator -ln -sf %{crosswalk_extensions_path}/mobile_emulator/* %{crosswalk_extensions_path} -%preun mobile-extension-emulator -# This is an un-installation. -if [ "$1" == "0" ]; then - rm %{crosswalk_extensions_path}/libtizen*.so - rm %{crosswalk_extensions_path}/plugins.json -fi -%files mobile-extension-emulator -%dir %{crosswalk_extensions_path}/mobile_emulator/ -%{crosswalk_extensions_path}/mobile_emulator/libtizen*.so -%{crosswalk_extensions_path}/mobile_emulator/plugins.json -%manifest webapi-plugins.manifest -%endif // mobile-extension-emulator -%endif // mobile - -%if "%{?unified_build}" == "1" || "%{?profile}" == "wearable" -%post profile_wearable -ln -sf %{crosswalk_extensions_path}/wearable/* %{crosswalk_extensions_path} -%preun profile_wearable -# This is an un-installation. -if [ "$1" == "0" ]; then - rm %{crosswalk_extensions_path}/libtizen*.so - rm %{crosswalk_extensions_path}/plugins.json -fi -%files profile_wearable -%dir %{crosswalk_extensions_path}/wearable/ -%{crosswalk_extensions_path}/wearable/libtizen*.so -%{crosswalk_extensions_path}/wearable/plugins.json -%manifest webapi-plugins.manifest -# wearable-extension-emulator -%ifarch %{ix86} x86_64 -%post wearable-extension-emulator -ln -sf %{crosswalk_extensions_path}/wearable_emulator/* %{crosswalk_extensions_path} -%preun wearable-extension-emulator -# This is an un-installation. -if [ "$1" == "0" ]; then - rm %{crosswalk_extensions_path}/libtizen*.so - rm %{crosswalk_extensions_path}/plugins.json -fi -%files wearable-extension-emulator -%dir %{crosswalk_extensions_path}/wearable_emulator/ -%{crosswalk_extensions_path}/wearable_emulator/libtizen*.so -%{crosswalk_extensions_path}/wearable_emulator/plugins.json -%manifest webapi-plugins.manifest -%endif // wearable-extension-emulator -%endif // wearable - -%if "%{?unified_build}" == "1" || "%{?profile}" == "tv" -%post profile_tv -ln -sf %{crosswalk_extensions_path}/tv/* %{crosswalk_extensions_path} -%preun profile_tv -# This is an un-installation. -if [ "$1" == "0" ]; then - rm %{crosswalk_extensions_path}/libtizen*.so - rm %{crosswalk_extensions_path}/plugins.json -fi -%files profile_tv -%dir %{crosswalk_extensions_path}/tv/ -%{crosswalk_extensions_path}/tv/libtizen*.so -%{crosswalk_extensions_path}/tv/plugins.json -%manifest webapi-plugins.manifest -%endif - -%if "%{?unified_build}" == "1" || "%{?profile}" == "ivi" -%post profile_ivi -ln -sf %{crosswalk_extensions_path}/ivi/* %{crosswalk_extensions_path} -%preun profile_ivi -# This is an un-installation. -if [ "$1" == "0" ]; then - rm %{crosswalk_extensions_path}/libtizen*.so - rm %{crosswalk_extensions_path}/plugins.json -fi -%files profile_ivi -%dir %{crosswalk_extensions_path}/ivi/ -%{crosswalk_extensions_path}/ivi/libtizen*.so -%{crosswalk_extensions_path}/ivi/plugins.json +%files +%{crosswalk_extensions_path}/libtizen*.so +%{crosswalk_extensions_path}/plugins.json +%{_datadir}/license/%{name} %manifest webapi-plugins.manifest -%endif %files devel %{_includedir}/* diff --git a/src/alarm/alarm.gyp b/src/alarm/alarm.gyp index 5d212ec..dc1135a 100644 --- a/src/alarm/alarm.gyp +++ b/src/alarm/alarm.gyp @@ -8,7 +8,6 @@ 'type': 'loadable_module', 'dependencies': [ '../common/common.gyp:tizen_common', - '../notification/notification.gyp:tizen_notification', ], 'sources': [ 'alarm_api.js', @@ -26,8 +25,6 @@ 'variables': { 'packages': [ 'capi-appfw-alarm', - 'capi-appfw-app-control', - 'capi-appfw-application', ] }, }], diff --git a/src/alarm/alarm_api.js b/src/alarm/alarm_api.js index 278719b..47725dc 100755 --- a/src/alarm/alarm_api.js +++ b/src/alarm/alarm_api.js @@ -66,20 +66,6 @@ function UpdateInternalData_(internal, data) { } } -var LogManager = function() { - this.enableLog = true; -}; - -LogManager.prototype.allow = function() { - this.enableLog = true; -}; - -LogManager.prototype.disallow = function() { - this.enableLog = false; -}; - -var _warningLogs = new LogManager(); - //class AlarmManager //////////////////////////////////////////////////// AlarmManager.prototype.add = function () { var args = AV.validateMethod(arguments, [ @@ -130,44 +116,6 @@ AlarmManager.prototype.add = function () { } }; -AlarmManager.prototype.addAlarmNotification = function() { - var args = AV.validateMethod(arguments, [ - { - name: 'alarm', - type: AV.Types.PLATFORM_OBJECT, - values: [tizen.AlarmRelative, tizen.AlarmAbsolute] - }, { - name: 'notification', - type: AV.Types.PLATFORM_OBJECT, - values: tizen.StatusNotification - }]); - - var type = null, milliseconds = 0; - if (args.alarm instanceof tizen.AlarmRelative) { - type = 'AlarmRelative'; - } else if (args.alarm instanceof tizen.AlarmAbsolute) { - type = 'AlarmAbsolute'; - milliseconds = args.alarm.date.getTime(); - } - - var callArgs = {}; - callArgs.alarm = args.alarm; - callArgs.type = type; - callArgs.notification = args.notification; - callArgs.milliseconds = Converter.toString(milliseconds); - callArgs.isPeriodSet = !T.isNullOrUndefined(args.alarm.period); - - var result = native.callSync('AlarmManager_addAlarmNotification', callArgs); - if (native.isFailure(result)) { - throw native.getErrorObject(result); - } - else { - _edit.allow(); - UpdateInternalData_(args.alarm, native.getResultObject(result)); - _edit.disallow(); - } -}; - AlarmManager.prototype.remove = function () { var args = AV.validateMethod(arguments, [ { @@ -205,46 +153,14 @@ AlarmManager.prototype.get = function () { throw native.getErrorObject(result); } else { result = native.getResultObject(result); - - var alarm; - _warningLogs.disallow(); if ('AlarmRelative' === result.type) { - alarm = new tizen.AlarmRelative(result.delay, result.period, InternalData_(result)); + return new tizen.AlarmRelative(result.delay, result.period, InternalData_(result)); } else { var date = new Date(result.year, result.month, result.day, result.hour, result.min, result.sec); - alarm = new tizen.AlarmAbsolute(date, result.second, InternalData_(result)); - } - _warningLogs.allow(); - return alarm; - } -}; - -AlarmManager.prototype.getAlarmNotification = function () { - var args = AV.validateMethod(arguments, [ - { - name : 'id', - type : AV.Types.STRING, - } - ]); - - var result = native.callSync('AlarmManager_getAlarmNotification', {id: Number(args.id)}); - - if (native.isFailure(result)) { - throw native.getErrorObject(result); - } else { - var noti = native.getResultObject(result); - if(!T.isNullOrUndefined(noti.appControl.operation)){ - noti.appControl = new tizen.ApplicationControl( - noti.appControl.operation, - noti.appControl.uri, - noti.appControl.mime, - noti.appControl.category, - noti.appControl.data, - noti.appControl.launchMode); + return new tizen.AlarmAbsolute(date, result.second, InternalData_(result)); } - return new tizen.StatusNotification('SIMPLE', noti.title, noti); } }; @@ -256,7 +172,6 @@ AlarmManager.prototype.getAll = function () { } else { var data = native.getResultObject(result); var md = []; - _warningLogs.disallow(); data.forEach(function (i) { if ('AlarmRelative'=== i.type) { md.push(new tizen.AlarmRelative(i.delay, i.period, InternalData_(i))); @@ -266,7 +181,6 @@ AlarmManager.prototype.getAll = function () { md.push(new tizen.AlarmAbsolute(date, i.second, InternalData_(i))); } }); - _warningLogs.allow(); return md; } }; @@ -388,10 +302,6 @@ tizen.AlarmAbsolute = function(date, second, internal) { } else { if(!T.isNullOrUndefined(second)){ m_period = Converter.toLong(second); - if(_warningLogs.enableLog){ - privUtils_.warn("This Constructor is deprecated since Tizen 4.0." + - " Please consider using other constructors or other type of an alarm."); - } } } } diff --git a/src/alarm/alarm_instance.cc b/src/alarm/alarm_instance.cc index a9e6d00..8f33bc3 100755 --- a/src/alarm/alarm_instance.cc +++ b/src/alarm/alarm_instance.cc @@ -30,16 +30,12 @@ AlarmInstance::AlarmInstance() { RegisterSyncHandler("AlarmManager_add", std::bind(&AlarmManager::Add, &manager_, _1, _2)); - RegisterSyncHandler("AlarmManager_addAlarmNotification", - std::bind(&AlarmManager::AddAlarmNotification, &manager_, _1, _2)); RegisterSyncHandler("AlarmManager_remove", std::bind(&AlarmManager::Remove, &manager_, _1, _2)); RegisterSyncHandler("AlarmManager_removeAll", std::bind(&AlarmManager::RemoveAll, &manager_, _1, _2)); RegisterSyncHandler("AlarmManager_get", std::bind(&AlarmManager::Get, &manager_, _1, _2)); - RegisterSyncHandler("AlarmManager_getAlarmNotification", - std::bind(&AlarmManager::GetAlarmNotification, &manager_, _1, _2)); RegisterSyncHandler("AlarmManager_getAll", std::bind(&AlarmManager::GetAll, &manager_, _1, _2)); //AlarmRelative diff --git a/src/alarm/alarm_manager.cc b/src/alarm/alarm_manager.cc index 3069886..3dc9f21 100755 --- a/src/alarm/alarm_manager.cc +++ b/src/alarm/alarm_manager.cc @@ -20,7 +20,6 @@ #include #include #include -#include #include "common/logger.h" #include "common/converter.h" @@ -30,8 +29,6 @@ #include "alarm_instance.h" #include "alarm_utils.h" -#include "notification/status_notification.h" - using namespace common; using namespace common::tools; @@ -41,7 +38,6 @@ namespace alarm { namespace { const int kDateSize = 22; //"yyy mm dd hh mm ss dd" e.g 115 11 28 11 25 50 -1 const std::string kPrivilegeAlarm = "http://tizen.org/privilege/alarm"; -const std::string kPrivilegeNotification = "http://tizen.org/privilege/notification"; const std::string kAlarmRelative = "AlarmRelative"; const std::string kAlarmAbsolute = "AlarmAbsolute"; @@ -58,6 +54,15 @@ const char* kAlarmTypeValueAbsolute = "ABSOLUTE"; const char* kAlarmTypeValueRelative = "RELATIVE"; const char* kAlarmRelativeDelayKey = "RELATIVE_DELAY"; + +const char* kSundayShort = "SU"; +const char* kMondayShort = "MO"; +const char* kTuesdayShort = "TU"; +const char* kWednesdayShort = "WE"; +const char* kThuesdayShort = "TH"; +const char* kFridayShort = "FR"; +const char* kSaturdayShort = "SA"; + } AlarmManager::AlarmManager() { @@ -213,12 +218,29 @@ void AlarmManager::Add(const picojson::value& args, picojson::object& out) { !(it_daysOfTheWeek->second.get()).empty()) { app_control_add_extra_data( app_control, kAlarmAbsoluteRecurrenceTypeKey, kAlarmAbsoluteReccurrenceTypeByDayValue); - const picojson::array &days_of_the_week = it_daysOfTheWeek->second.get(); + picojson::array days_of_the_week = it_daysOfTheWeek->second.get(); int repeat_value = 0; - PlatformResult result = util::ArrayDaysToMask(days_of_the_week, &repeat_value); - if (!result) { - LogAndReportError(PlatformResult(result.error_code(), result.message()), &out); - return; + for (auto iter = days_of_the_week.begin(); iter != days_of_the_week.end(); ++iter) { + auto day = (*iter).get(); + if (kSundayShort == day) { + repeat_value |= ALARM_WEEK_FLAG_SUNDAY; + } else if (kMondayShort == day) { + repeat_value |= ALARM_WEEK_FLAG_MONDAY; + } else if (kTuesdayShort == day) { + repeat_value |= ALARM_WEEK_FLAG_TUESDAY; + } else if (kWednesdayShort == day) { + repeat_value |= ALARM_WEEK_FLAG_WEDNESDAY; + } else if (kThuesdayShort == day) { + repeat_value |= ALARM_WEEK_FLAG_THURSDAY; + } else if (kFridayShort == day) { + repeat_value |= ALARM_WEEK_FLAG_FRIDAY; + } else if (kSaturdayShort == day) { + repeat_value |= ALARM_WEEK_FLAG_SATURDAY; + } else { + LogAndReportError(PlatformResult( + ErrorCode::TYPE_MISMATCH_ERR, "Invalid days of the week value."), &out); + return; + } } ret = alarm_schedule_with_recurrence_week_flag( app_control, &start_date, repeat_value, &alarm_id); @@ -240,223 +262,6 @@ void AlarmManager::Add(const picojson::value& args, picojson::object& out) { ReportSuccess(result, out); } -void AlarmManager::AddAlarmNotification(const picojson::value& args, picojson::object& out) { - using namespace extension::notification; - LoggerD("Entered"); - CHECK_PRIVILEGE_ACCESS(kPrivilegeAlarm, &out); - CHECK_PRIVILEGE_ACCESS(kPrivilegeNotification, &out); - - if (!args.contains("alarm") || !args.contains("notification")) { - LogAndReportError(PlatformResult(ErrorCode::INVALID_VALUES_ERR, "Invalid parameter passed."), - &out); - return; - } - - const picojson::object& alarm = args.get("alarm").get(); - - std::string alarm_type; - if (args.contains("type")) { - alarm_type = args.get("type").get(); - } - - notification_h notification_handle = nullptr; - app_control_h app_control = nullptr; - - SCOPE_EXIT { - notification_free(notification_handle); - app_control_destroy(app_control); - }; - - PlatformResult platform_result = StatusNotification::GetNotiHandleFromJson( - args.get(), - false, - ¬ification_handle); - - if (!platform_result) { - LogAndReportError(PlatformResult(ErrorCode::ABORT_ERR, platform_result.message().c_str()), - &out); - } - - platform_result = StatusNotification::GetAppControl(notification_handle, &app_control); - - if (!platform_result) { - LogAndReportError( - PlatformResult(platform_result.error_code(), platform_result.message().c_str()), &out); - } - - int alarm_id = 0; - int ret = 0; - - if (kAlarmRelative == alarm_type) { - ret = app_control_add_extra_data(app_control, kAlarmKeyType, kAlarmTypeValueRelative); - if (ret != APP_CONTROL_ERROR_NONE) { - LogAndReportError( - PlatformResult(ErrorCode::ABORT_ERR, "Fail to add data from app_control."), &out, - ("Fail to add data from app_control: %d (%s)", ret, get_error_message(ret))); - return; - } - - const auto it_period = alarm.find("period"); - const auto it_delay = alarm.find("delay"); - - if (alarm.end() == it_delay || alarm.end() == it_period || !it_delay->second.is()) { - LogAndReportError(PlatformResult(ErrorCode::INVALID_VALUES_ERR, "Invalid parameter passed."), - &out); - return; - } - - int delay = static_cast(it_delay->second.get()); - - std::string delay_str = std::to_string(delay); - ret = app_control_add_extra_data(app_control, kAlarmRelativeDelayKey, delay_str.c_str()); - if (APP_CONTROL_ERROR_NONE != ret) { - LogAndReportError( - PlatformResult(ErrorCode::ABORT_ERR, "Fail to add data from app_control."), &out, - ("Fail to add data from app_control: %d (%s)", ret, get_error_message(ret))); - return; - } - - platform_result = StatusNotification::SetAppControl(notification_handle, app_control); - - if (!platform_result) { - LogAndReportError( - PlatformResult(platform_result.error_code(), platform_result.message().c_str()), &out); - } - - int period = 0; - if (it_period->second.is()) { - period = static_cast(it_period->second.get()); - } - - bool isPeriodSet = false; - if (args.contains("isPeriodSet")) { - isPeriodSet = args.get("isPeriodSet").get(); - } - - if (!isPeriodSet) { - ret = alarm_schedule_noti_once_after_delay(notification_handle, delay, &alarm_id); - } else { - ret = alarm_schedule_noti_after_delay(notification_handle, delay, period, &alarm_id); - } - } else { - if (alarm.find("period")->second.is()) { - LogAndReportError( - PlatformResult(ErrorCode::INVALID_VALUES_ERR, - "AlarmAbsolute constructed by deprecated constructor."), - &out); - return; - } - - ret = app_control_add_extra_data(app_control, kAlarmKeyType, kAlarmTypeValueAbsolute); - if (APP_CONTROL_ERROR_NONE != ret) { - LogAndReportError( - PlatformResult(ErrorCode::ABORT_ERR, "Fail to add data from app_control."), &out, - ("Fail to add data from app_control: %d (%s)", ret, get_error_message(ret))); - return; - } - - const auto it_daysOfTheWeek = alarm.find("daysOfTheWeek"); - long long int milliseconds = 0; - - if (args.contains("milliseconds")) { - milliseconds = strtoll(args.get("milliseconds").get().c_str(), nullptr, 10); - } - - time_t second = milliseconds / 1000; - struct tm start_date = { 0 }; - - tzset(); - if (nullptr == localtime_r(&second, &start_date)) { - LogAndReportError(PlatformResult(ErrorCode::ABORT_ERR, "Invalid date."), &out); - return; - } - - mktime(&start_date); - - char str_date[kDateSize]; - - snprintf(str_date, sizeof(str_date), "%d %d %d %d %d %d %d", start_date.tm_year, - start_date.tm_mon, start_date.tm_mday, start_date.tm_hour, start_date.tm_min, - start_date.tm_sec, start_date.tm_isdst); - - ret = app_control_add_extra_data(app_control, kAlarmAbsoluteDateKey, str_date); - if (APP_CONTROL_ERROR_NONE != ret) { - LogAndReportError( - PlatformResult(ErrorCode::ABORT_ERR, "Fail to add data from app_control."), &out, - ("Fail to add data from app_control: %d (%s)", ret, get_error_message(ret))); - return; - } - - if (alarm.end() != it_daysOfTheWeek && it_daysOfTheWeek->second.is() - && !(it_daysOfTheWeek->second.get()).empty()) { - app_control_add_extra_data(app_control, kAlarmAbsoluteRecurrenceTypeKey, - kAlarmAbsoluteReccurrenceTypeByDayValue); - - const picojson::array &days_of_the_week = it_daysOfTheWeek->second.get(); - int repeat_value = 0; - util::ArrayDaysToMask(days_of_the_week, &repeat_value); - - platform_result = StatusNotification::SetAppControl(notification_handle, app_control); - if (!platform_result) { - LogAndReportError( - PlatformResult(platform_result.error_code(), platform_result.message().c_str()), &out); - } - - ret = alarm_schedule_noti_with_recurrence_week_flag(notification_handle, &start_date, - repeat_value, &alarm_id); - } else { - ret = app_control_add_extra_data(app_control, kAlarmAbsoluteRecurrenceTypeKey, - kAlarmAbsoluteRecurrenceTypeNone); - if (APP_CONTROL_ERROR_NONE != ret) { - LogAndReportError( - PlatformResult(ErrorCode::ABORT_ERR, "Fail to add data from app_control."), &out, - ("Fail to add data from app_control: %d (%s)", ret, get_error_message(ret))); - return; - } - - platform_result = StatusNotification::SetAppControl(notification_handle, app_control); - if (!platform_result) { - LogAndReportError( - PlatformResult(platform_result.error_code(), platform_result.message().c_str()), &out); - } - - ret = alarm_schedule_noti_once_at_date(notification_handle, &start_date, &alarm_id); - } - } - - if (ALARM_ERROR_NONE != ret) { - if (ALARM_ERROR_INVALID_TIME == ret || ALARM_ERROR_INVALID_DATE == ret - || ALARM_ERROR_INVALID_PARAMETER == ret) { - platform_result = PlatformResult(ErrorCode::INVALID_VALUES_ERR, "Invalid data."); - } else { - platform_result = PlatformResult(ErrorCode::ABORT_ERR, "Error while adding alarm to server."); - } - - LogAndReportError(platform_result, &out, - ("Error while add alarm to server: %d (%s)", ret, get_error_message(ret))); - return; - } - - picojson::value result = picojson::value(picojson::object()); - picojson::object& result_obj = result.get(); - - if (alarm_type == kAlarmRelative) { - int period = 0; - ret = alarm_get_scheduled_period(alarm_id, &period); - if (ALARM_ERROR_NONE != ret) { - LogAndReportError(PlatformResult(ErrorCode::UNKNOWN_ERR, "Unknown error occurred."), &out, - ("Unknown error occurred: %d (%s)", ret, get_error_message(ret))); - return; - } - if (0 != period) { - result_obj.insert(std::make_pair("period", picojson::value(std::to_string(period)))); - } - } - - result_obj.insert(std::make_pair("id", picojson::value(std::to_string(alarm_id)))); - ReportSuccess(result, out); -} - void AlarmManager::Remove(const picojson::value& args, picojson::object& out) { LoggerD("Entered"); CHECK_PRIVILEGE_ACCESS(kPrivilegeAlarm, &out); @@ -513,31 +318,18 @@ PlatformResult AlarmManager::GetAlarm(int id, picojson::object& obj) { char* alarm_type = nullptr; char* date_string = nullptr; char* delay_string = nullptr; - notification_h notification_handle = nullptr; SCOPE_EXIT { app_control_destroy(app_control); free(alarm_type); free(date_string); free(delay_string); - notification_free(notification_handle); }; - if (ALARM_ERROR_NONE != alarm_get_app_control(id, &app_control)) { - if (ALARM_ERROR_NONE != alarm_get_notification(id, ¬ification_handle)) { - return LogAndCreateResult(ErrorCode::NOT_FOUND_ERR, "Alarm not found.", - ("Alarm not found: %d (%s)", ret, get_error_message(ret))); - } else { - PlatformResult platform_result = extension::notification::StatusNotification::GetAppControl( - notification_handle, &app_control); - if (!platform_result) { - return LogAndCreateResult( - platform_result.error_code(), - platform_result.message().c_str(), - ("Failed to get AppControl: %d (%s)", platform_result.error_code(), - platform_result.message().c_str())); - } - } + ret = alarm_get_app_control(id, &app_control); + if (ALARM_ERROR_NONE != ret) { + return LogAndCreateResult(ErrorCode::NOT_FOUND_ERR, "Alarm not found.", + ("Alarm not found: %d (%s)", ret, get_error_message(ret))); } ret = app_control_get_extra_data(app_control, kAlarmKeyType, &alarm_type); @@ -595,7 +387,6 @@ PlatformResult AlarmManager::GetAlarm(int id, picojson::object& obj) { obj.insert(std::make_pair("second", picojson::value(picojson::array()))) .first->second.get(); - using namespace util; if (byDayValue & ALARM_WEEK_FLAG_SUNDAY) array.push_back(picojson::value(kSundayShort)); if (byDayValue & ALARM_WEEK_FLAG_MONDAY) @@ -664,54 +455,6 @@ void AlarmManager::Get(const picojson::value& args, picojson::object& out) { } } -void AlarmManager::GetAlarmNotification(const picojson::value& args, picojson::object& out) { - using namespace extension::notification; - LoggerD("Entered"); - - int alarm_id = 0; - int ret = ALARM_ERROR_NONE; - notification_h notification_handle = nullptr; - PlatformResult platform_result = PlatformResult(ErrorCode::NO_ERROR); - - SCOPE_EXIT { - notification_free(notification_handle); - }; - - if (args.contains("id") && args.get("id").is()) { - alarm_id = static_cast(args.get("id").get()); - } - - ret = alarm_get_notification(alarm_id, ¬ification_handle); - - if (ALARM_ERROR_NONE != ret) { - if (ALARM_ERROR_INVALID_PARAMETER == ret) { - platform_result = PlatformResult(ErrorCode::NOT_FOUND_ERR, - "Alarm with given ID was not found."); - } else { - platform_result = PlatformResult(ErrorCode::ABORT_ERR, "Failed to get notification."); - } - LogAndReportError(platform_result, &out); - } - - app_control_h app_control = nullptr; - platform_result = StatusNotification::GetAppControl(notification_handle, &app_control); - - if (!platform_result) { - LogAndReportError(platform_result, &out); - } - - picojson::value result = picojson::value(picojson::object()); - picojson::object& result_obj = result.get(); - - platform_result = StatusNotification::ToJson(-1, notification_handle, app_control, &result_obj); - - if (ALARM_ERROR_NONE != ret) { - LogAndReportError(PlatformResult(ErrorCode::ABORT_ERR, "Failed ToJson()."), &out); - } - - ReportSuccess(result, out); -} - static bool AlarmIterateCB(int alarm_id, void *user_data) { LoggerD("Enter"); diff --git a/src/alarm/alarm_manager.h b/src/alarm/alarm_manager.h index 2920787..1ad2701 100755 --- a/src/alarm/alarm_manager.h +++ b/src/alarm/alarm_manager.h @@ -29,11 +29,9 @@ class AlarmManager { virtual ~AlarmManager(); void Add(const picojson::value& args, picojson::object& out); - void AddAlarmNotification(const picojson::value& args, picojson::object& out); void Remove(const picojson::value& args, picojson::object& out); void RemoveAll(const picojson::value& args, picojson::object& out); void Get(const picojson::value& args, picojson::object& out); - void GetAlarmNotification(const picojson::value& args, picojson::object& out); void GetAll(const picojson::value& args, picojson::object& out); //AlarmRelative diff --git a/src/alarm/alarm_utils.cc b/src/alarm/alarm_utils.cc index 5d72544..1c9ee9d 100755 --- a/src/alarm/alarm_utils.cc +++ b/src/alarm/alarm_utils.cc @@ -22,14 +22,6 @@ namespace extension { namespace alarm { namespace util { -const char* kSundayShort = "SU"; -const char* kMondayShort = "MO"; -const char* kTuesdayShort = "TU"; -const char* kWednesdayShort = "WE"; -const char* kThuesdayShort = "TH"; -const char* kFridayShort = "FR"; -const char* kSaturdayShort = "SA"; - using namespace common; PlatformResult AppControlToService(const picojson::object& obj, app_control_h *app_control) { @@ -136,31 +128,6 @@ PlatformResult AppControlToServiceExtraData(const picojson::object& app_obj, return PlatformResult(ErrorCode::NO_ERROR); } -PlatformResult ArrayDaysToMask(const picojson::array &days_of_the_week, int *repeat_value) { - LoggerD("Entered"); - for (auto iter = days_of_the_week.begin(); iter != days_of_the_week.end(); ++iter) { - auto day = (*iter).get(); - if (kSundayShort == day) { - *repeat_value |= ALARM_WEEK_FLAG_SUNDAY; - } else if (kMondayShort == day) { - *repeat_value |= ALARM_WEEK_FLAG_MONDAY; - } else if (kTuesdayShort == day) { - *repeat_value |= ALARM_WEEK_FLAG_TUESDAY; - } else if (kWednesdayShort == day) { - *repeat_value |= ALARM_WEEK_FLAG_WEDNESDAY; - } else if (kThuesdayShort == day) { - *repeat_value |= ALARM_WEEK_FLAG_THURSDAY; - } else if (kFridayShort == day) { - *repeat_value |= ALARM_WEEK_FLAG_FRIDAY; - } else if (kSaturdayShort == day) { - *repeat_value |= ALARM_WEEK_FLAG_SATURDAY; - } else { - return LogAndCreateResult(ErrorCode::TYPE_MISMATCH_ERR, "Invalid days of the week value."); - } - } - return PlatformResult(ErrorCode::NO_ERROR); -} - } // util } // alarm } // extension diff --git a/src/alarm/alarm_utils.h b/src/alarm/alarm_utils.h index 048fea3..a513f0d 100755 --- a/src/alarm/alarm_utils.h +++ b/src/alarm/alarm_utils.h @@ -18,7 +18,6 @@ #define ALARM_ALARM_UTILS_H_ #include -#include #include "common/picojson.h" #include "common/platform_result.h" @@ -27,19 +26,9 @@ namespace extension { namespace alarm { namespace util { -extern const char* kSundayShort; -extern const char* kMondayShort; -extern const char* kTuesdayShort; -extern const char* kWednesdayShort; -extern const char* kThuesdayShort; -extern const char* kFridayShort; -extern const char* kSaturdayShort; - common::PlatformResult AppControlToService(const picojson::object& obj, app_control_h *app_control); common::PlatformResult AppControlToServiceExtraData(const picojson::object& app_obj, app_control_h *app_control); -common::PlatformResult ArrayDaysToMask(const picojson::array &days_of_the_week, - int *repeat_value); } // util } // alarm } // extension diff --git a/src/application/application.gyp b/src/application/application.gyp index 38d04d0..40b614f 100644 --- a/src/application/application.gyp +++ b/src/application/application.gyp @@ -33,8 +33,7 @@ 'packages': [ 'aul', 'capi-appfw-app-manager', - 'capi-appfw-app-control', - 'capi-appfw-event', + 'capi-appfw-application', 'capi-appfw-package-manager', 'pkgmgr', 'pkgmgr-info', @@ -43,13 +42,6 @@ ] }, }], - ['extension_host_os == "mobile"', { - 'variables': { - 'packages': [ - 'capi-context', - ] - } - }], ], }, ], diff --git a/src/application/application_api.js b/src/application/application_api.js index d1e57eb..b668dbb 100755 --- a/src/application/application_api.js +++ b/src/application/application_api.js @@ -496,44 +496,6 @@ ApplicationManager.prototype.getAppMetaData = function() { } }; -ApplicationManager.prototype.getBatteryUsageInfo = function() { - var args = AV.validateMethod(arguments, [ - { - name: 'days', - type: AV.Types.LONG, - optional: true, - nullable: true - }, - { - name: 'limit', - type: AV.Types.LONG, - optional: true, - nullable: true - }]); - - var callArgs = {}; - - if (!T.isNullOrUndefined(args.days)) { - callArgs.days = args.days; - } - - if (!T.isNullOrUndefined(args.limit)) { - callArgs.limit = args.limit; - } - - var result = native.callSync('ApplicationManager_getBatteryUsageInfo', callArgs); - if (native.isFailure(result)) { - throw native.getErrorObject(result); - } else { - var metaData = native.getResultObject(result); - var data = []; - metaData.forEach(function(i) { - data.push(new ApplicationBatteryUsage(i)); - }); - return data; - } -}; - function ListenerManager(native, listenerName) { this.listeners = {}; this.nextId = 1; @@ -631,110 +593,6 @@ ApplicationManager.prototype.removeAppInfoEventListener = function() { applicationEventListener.removeListener(args.watchId); }; -function StatusListenerManager(native, listenerName) { - this.listeners = {}; - this.listenersCount = 0; - this.nextId = 1; - this.nativeSet = false; - this.native = native; - this.listenerName = listenerName; -}; - -StatusListenerManager.prototype.onListenerCalled = function(msg) { - var statusType = msg.statusType; - var app_id = msg.appId; - - for (var watchId in this.listeners) { - if (this.listeners.hasOwnProperty(watchId)) { - var listener = this.listeners[watchId]; - if (!listener.appId || listener.appId === app_id) { - listener.callback(app_id, statusType); - } - } - } -}; - -StatusListenerManager.prototype.addListener = function(callback, appId) { - if (!this.nativeSet) { - var result = this.native.callSync('ApplicationManager_addAppStatusChangeListener'); - if (this.native.isFailure(result)) { - throw this.native.getErrorObject(result); - } - - this.native.addListener(this.listenerName, this.onListenerCalled.bind(this)); - this.nativeSet = true; - } - - var listener = { - 'callback' : callback, - 'appId' : appId - }; - - var id = this.nextId++; - this.listeners[id] = listener; - this.listenersCount++; - - return id; -}; - -StatusListenerManager.prototype.removeListener = function(watchId) { - if (this.listeners.hasOwnProperty(watchId)) { - if (this.listenersCount > 1) { - delete this.listeners[watchId]; - this.listenersCount--; - return; - } - - if (this.nativeSet) { - var result = this.native.callSync('ApplicationManager_removeStatusChangeListener'); - if (this.native.isFailure(result)) { - throw this.native.getErrorObject(result); - } - - delete this.listeners[watchId]; - this.listenersCount--; - - this.native.removeListener(this.listenerName); - this.nativeSet = false; - } - } -}; - -var APP_STATUS_CHANGE_LISTENER = 'AppStatusChangeListener'; -var appStatusChangeListener = new StatusListenerManager(native, APP_STATUS_CHANGE_LISTENER); - -ApplicationManager.prototype.addAppStatusChangeListener = function() { - var args = AV.validateMethod(arguments, [ - { - name : 'statusChangeListener', - type : AV.Types.FUNCTION, - }, - { - name : 'appId', - type : AV.Types.STRING, - optional : true, - nullable : true - } - ]); - - if (args.appId !== undefined && args.appId !== null && !args.appId.length) { - throw new WebAPIException(WebAPIException.INVALID_VALUES_ERR, 'Application id is empty'); - } - - return appStatusChangeListener.addListener(args.statusChangeListener, args.appId); -}; - -ApplicationManager.prototype.removeAppStatusChangeListener = function() { - var args = AV.validateMethod(arguments, [ - { - name : 'watchId', - type : AV.Types.LONG - } - ]); - - appStatusChangeListener.removeListener(args.watchId); -}; - // class Application //////////////////////////////////////////////////// function Application(data) { @@ -1265,21 +1123,5 @@ function ApplicationMetaData(data) { }); } -//class ApplicationBatteryUsage //////////////////////////////////////////////////// -function ApplicationBatteryUsage(data) { - Object.defineProperties(this, { - appId : { - value : data.appId, - writable : false, - enumerable : true - }, - batteryUsage : { - value : data.batteryUsage, - writable : false, - enumerable : true - } - }); -} - // exports //////////////////////////////////////////////////// exports = new ApplicationManager(); diff --git a/src/application/application_instance.cc b/src/application/application_instance.cc index eb4ee2d..cb8d850 100755 --- a/src/application/application_instance.cc +++ b/src/application/application_instance.cc @@ -32,7 +32,6 @@ const std::string kPrivilegeAppManagerCertificate = "http://tizen.org/privilege/ const std::string kPrivilegeAppManagerKill = "http://tizen.org/privilege/appmanager.kill"; const std::string kPrivilegeApplicationInfo = "http://tizen.org/privilege/application.info"; const std::string kPrivilegeApplicationLaunch = "http://tizen.org/privilege/application.launch"; -const std::string kPrivilegeAppHistoryRead = "http://tizen.org/privilege/apphistory.read"; } // namespace using namespace common; @@ -60,11 +59,8 @@ ApplicationInstance::ApplicationInstance() : REGISTER_SYNC("ApplicationManager_getAppCerts", GetAppCerts); REGISTER_SYNC("ApplicationManager_getAppSharedURI", GetAppSharedURI); REGISTER_SYNC("ApplicationManager_getAppMetaData", GetAppMetaData); - REGISTER_SYNC("ApplicationManager_getBatteryUsageInfo", GetBatteryUsageInfo); REGISTER_SYNC("ApplicationManager_addAppInfoEventListener", AddAppInfoEventListener); REGISTER_SYNC("ApplicationManager_removeAppInfoEventListener", RemoveAppInfoEventListener); - REGISTER_SYNC("ApplicationManager_addAppStatusChangeListener", AddStatusListener); - REGISTER_SYNC("ApplicationManager_removeStatusChangeListener", RemoveStatusListener); //Application REGISTER_SYNC("Application_getRequestedAppControl", GetRequestedAppControl); @@ -161,13 +157,6 @@ void ApplicationInstance::GetAppMetaData(const picojson::value& args, picojson:: manager_.GetAppMetaData(app_id, &out); } -void ApplicationInstance::GetBatteryUsageInfo(const picojson::value& args, picojson::object& out) { - LoggerD("Entered"); - CHECK_PRIVILEGE_ACCESS(kPrivilegeAppHistoryRead, &out); - - manager_.GetBatteryUsageInfo(args, &out); -} - void ApplicationInstance::AddAppInfoEventListener(const picojson::value& args, picojson::object& out) { LoggerD("Entered"); LoggerW("DEPRECATION WARNING: addAppInfoEventListener() is deprecated and will be removed from next release. " @@ -298,31 +287,5 @@ void ApplicationInstance::RemoveEventListener(const picojson::value& args, picoj manager_.StopEventListener(event_name); } -void ApplicationInstance::AddStatusListener(const picojson::value& args, picojson::object& out) { - LoggerD("Entered"); - - JsonCallback cb = [this](picojson::value* event) -> void { - Instance::PostMessage(this, event->serialize().c_str()); - }; - - PlatformResult result = manager_.StartStatusListener(cb); - if (result) { - ReportSuccess(out); - } else { - LogAndReportError(result, &out); - } -} - -void ApplicationInstance::RemoveStatusListener(const picojson::value& args, picojson::object& out) { - LoggerD("Entered"); - - PlatformResult result = manager_.StopStatusChangeListener(); - if (result) { - ReportSuccess(out); - } else { - LogAndReportError(result, &out); - } -} - } // namespace application } // namespace extension diff --git a/src/application/application_instance.h b/src/application/application_instance.h index 3ae6c32..cb99cbb 100755 --- a/src/application/application_instance.h +++ b/src/application/application_instance.h @@ -38,7 +38,6 @@ class ApplicationInstance: public common::ParsedInstance { void GetAppCerts(const picojson::value& args, picojson::object& out); void GetAppSharedURI(const picojson::value& args, picojson::object& out); void GetAppMetaData(const picojson::value& args, picojson::object& out); - void GetBatteryUsageInfo(const picojson::value& args, picojson::object& out); void AddAppInfoEventListener(const picojson::value& args, picojson::object& out); void RemoveAppInfoEventListener(const picojson::value& args, picojson::object& out); void GetRequestedAppControl(const picojson::value& args, picojson::object& out); @@ -55,8 +54,6 @@ class ApplicationInstance: public common::ParsedInstance { void BroadcastTrustedEvent(const picojson::value& args, picojson::object& out); void AddEventListener(const picojson::value& args, picojson::object& out); void RemoveEventListener(const picojson::value& args, picojson::object& out); - void AddStatusListener(const picojson::value& args, picojson::object& out); - void RemoveStatusListener(const picojson::value& args, picojson::object& out); ApplicationManager manager_; Application current_application_; diff --git a/src/application/application_manager.cc b/src/application/application_manager.cc index 8af357a..0d8ed50 100755 --- a/src/application/application_manager.cc +++ b/src/application/application_manager.cc @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -29,9 +30,6 @@ #include #include #include -#ifdef TIZEN_MOBILE -#include -#endif #include "common/current_application.h" #include "common/logger.h" @@ -70,10 +68,6 @@ const std::string kOnInstalled = "oninstalled"; const std::string kOnUpdated = "onupdated"; const std::string kOnUninstalled = "onuninstalled"; const std::string kData = "data"; -const std::string kStatusType = "statusType"; -const std::string kAppId = "appId"; -const std::string kListenerId = "listenerId"; -const std::string kAppStatusChangeListener = "AppStatusChangeListener"; const std::map event_map_ = { {SYSTEM_EVENT_BATTERY_CHARGER_STATUS, EVENT_KEY_BATTERY_CHARGER_STATUS}, @@ -104,22 +98,13 @@ const std::map event_map_ = { ApplicationManager::ApplicationManager(ApplicationInstance& instance) : pkgmgr_client_handle_(nullptr), pkgmgr_client_uninstall_handle_(nullptr), - instance_(instance), - app_status_handle_(nullptr) { + instance_(instance) { LoggerD("Enter"); } ApplicationManager::~ApplicationManager() { LoggerD("Enter"); StopAppInfoEventListener(); - StopStatusChangeListener(); - - if (app_status_handle_) { - int ret = app_manager_event_destroy(app_status_handle_); - if (APP_MANAGER_ERROR_NONE != ret) { - LoggerE ("app_manager_event_destroy failed, error: %d", ret); - } - } } void ApplicationManager::GetCurrentApplication(const std::string& app_id, @@ -1158,132 +1143,6 @@ void ApplicationManager::GetAppSharedUri(const std::string& app_id, picojson::ob ReportSuccess(result, *out); } -void ApplicationManager::GetBatteryUsageInfo(const picojson::value& args, picojson::object* out) { - LoggerD("Entered"); - -#ifdef TIZEN_MOBILE - context_history_list_h list = nullptr; - context_history_h handle = nullptr; - context_history_filter_h filter = nullptr; - - SCOPE_EXIT { - context_history_list_destroy(list); - context_history_destroy(handle); - context_history_filter_destroy(filter); - }; - - int ret = context_history_create(&handle); - if (CONTEXT_HISTORY_ERROR_NONE != ret) { - LogAndReportError(PlatformResult(ErrorCode::ABORT_ERR, "Failed to create context handle."), out, - ("Failed to create context handle: %d (%s)", ret, get_error_message(ret))); - return; - } - - ret = context_history_filter_create(&filter); - if (CONTEXT_HISTORY_ERROR_NONE != ret) { - LogAndReportError(PlatformResult(ErrorCode::ABORT_ERR, "Failed to create filter handle."), out, - ("Failed to create filter handle: %d (%s)", ret, get_error_message(ret))); - return; - } - - if (args.contains("limit")) { - const int limit = static_cast(args.get("limit").get()); - ret = context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_RESULT_SIZE, limit); - - if (CONTEXT_HISTORY_ERROR_NONE != ret) { - LogAndReportError( - PlatformResult(ErrorCode::INVALID_VALUES_ERR, "limit given with invalid value."), out, - ("limit given with invalid value: %d (%s)", ret, get_error_message(ret))); - return; - } - } - - context_history_data_e date_type = CONTEXT_HISTORY_RECENT_BATTERY_USAGE; - if (args.contains("days")) { - const int days = static_cast(args.get("days").get()); - date_type = CONTEXT_HISTORY_BATTERY_USAGE; - ret = context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_TIME_SPAN, days); - - if (CONTEXT_HISTORY_ERROR_NONE != ret) { - LogAndReportError( - PlatformResult(ErrorCode::INVALID_VALUES_ERR, "days given with invalid value."), out, - ("days given with invalid value: %d (%s)", ret, get_error_message(ret))); - return; - } - } - - ret = context_history_get_list(handle, date_type, filter, &list); - if (CONTEXT_HISTORY_ERROR_NONE != ret) { - LogAndReportError(PlatformResult(ErrorCode::ABORT_ERR, "Failed to get list."), out, - ("Failed to get list: %d (%s)", ret, get_error_message(ret))); - return; - } - - int size = 0; - ret = context_history_list_get_count(list, &size); - if (CONTEXT_HISTORY_ERROR_NONE != ret) { - LogAndReportError(PlatformResult(ErrorCode::ABORT_ERR, "Failed to get list size."), out, - ("Failed to get list size: %d (%s)", ret, get_error_message(ret))); - return; - } - - double amount; - char* app_id; - - context_history_record_h record; - picojson::value result_array = picojson::value( - picojson::array(size, picojson::value(picojson::object()))); - picojson::array& array_obj = result_array.get(); - - for (int i = 0; i < size; ++i) { - SCOPE_EXIT { - free(app_id); - context_history_record_destroy(record); - }; - - app_id = nullptr; - record = nullptr; - - picojson::object& object = array_obj[i].get(); - - ret = context_history_list_get_current(list, &record); - if (CONTEXT_HISTORY_ERROR_NONE != ret) { - LogAndReportError(PlatformResult(ErrorCode::ABORT_ERR, "Failed to current record."), out, - ("Failed to get current record: %d (%s)", ret, get_error_message(ret))); - return; - } - - ret = context_history_record_get_string(record, CONTEXT_HISTORY_APP_ID, &app_id); - if (CONTEXT_HISTORY_ERROR_NONE != ret) { - LogAndReportError(PlatformResult(ErrorCode::ABORT_ERR, "Failed to get string."), out, - ("Failed to get string: %d (%s)", ret, get_error_message(ret))); - return; - } - object.insert(std::make_pair("appId", picojson::value(app_id))); - - ret = context_history_record_get_double(record, CONTEXT_HISTORY_TOTAL_AMOUNT, &amount); - if (CONTEXT_HISTORY_ERROR_NONE != ret) { - LogAndReportError(PlatformResult(ErrorCode::ABORT_ERR, "Failed to get amount."), out, - ("Failed to get amount: %d (%s)", ret, get_error_message(ret))); - return; - } - object.insert(std::make_pair("batteryUsage", picojson::value(amount))); - - ret = context_history_list_move_next(list); - if (CONTEXT_HISTORY_ERROR_NONE != ret && CONTEXT_HISTORY_ERROR_NO_DATA != ret) { - LogAndReportError(PlatformResult(ErrorCode::ABORT_ERR, "Failed to move iterator."), out, - ("Failed to move iterator: %d (%s)", ret, get_error_message(ret))); - return; - } - } - ReportSuccess(result_array, *out); -#else - // 20170510 Context API is supported only for mobile profile, other ones would result with NotSupportedError - LogAndReportError(PlatformResult(ErrorCode::NOT_SUPPORTED_ERR, "This feature is not supported on this profile."), out, - ("NOT_SUPPORTED_ERR: This feature is not supported on this profile")); -#endif -} - void ApplicationManager::GetAppMetaData(const std::string& app_id, picojson::object* out) { LoggerD("Entered"); @@ -1767,89 +1626,5 @@ void ApplicationManager::StopEventListener(const std::string& event_name) { } } -void ApplicationManager::OnStatusEvent(const char *type, const char *app_id, - app_manager_event_type_e event_type, - app_manager_event_state_e event_state, - app_manager_event_h handle, void *user_data) { - LoggerD("Entered"); - - if (APP_MANAGER_EVENT_STATE_COMPLETED != event_state) { - LoggerD("State different from completed"); - return; - } - - ApplicationManager* manager = static_cast(user_data); - - if (!manager || !manager->status_callback_) { - LoggerD("No event listener registered, skipping."); - return; - } - - bool status_type; - switch (event_type) { - case APP_MANAGER_EVENT_ENABLE_APP: - status_type = true; - break; - case APP_MANAGER_EVENT_DISABLE_APP: - status_type = false; - break; - default: - LoggerD("Uknown status type skipping."); - return; - } - - picojson::value event = picojson::value(picojson::object()); - picojson::object& event_o = event.get(); - - event_o[kStatusType] = picojson::value(status_type); - event_o[kAppId] = picojson::value(app_id); - event_o[kListenerId] = picojson::value(kAppStatusChangeListener); - - manager->status_callback_(&event); -} - -PlatformResult ApplicationManager::StartStatusListener(const JsonCallback& callback) { - LoggerD("Entered"); - - int ret = APP_MANAGER_ERROR_NONE; - - if (!app_status_handle_) { - ret = app_manager_event_create(&app_status_handle_); - if (APP_MANAGER_ERROR_NONE != ret) { - return LogAndCreateResult(ErrorCode::ABORT_ERR, "Error while creating event handle", - ("app_manager_event_create failed, error: %d", ret)); - } - - ret = app_manager_event_set_status(app_status_handle_, APP_MANAGER_EVENT_STATUS_TYPE_ALL); - if (APP_MANAGER_ERROR_NONE != ret) { - return LogAndCreateResult(ErrorCode::ABORT_ERR, "Error while setting status type", - ("app_manager_event_set_status failed, error: %d", ret)); - } - } - - status_callback_ = callback; - ret = app_manager_set_event_cb(app_status_handle_, OnStatusEvent, this); - if (APP_MANAGER_ERROR_NONE != ret) { - return LogAndCreateResult(ErrorCode::ABORT_ERR, "Error while setting status listener", - ("app_manager_set_event_cb failed, error: %d", ret)); - } - - return PlatformResult(ErrorCode::NO_ERROR); -} - -PlatformResult ApplicationManager::StopStatusChangeListener() { - LoggerD("Entered"); - - if (app_status_handle_) { - int ret = app_manager_unset_event_cb(app_status_handle_); - if (APP_MANAGER_ERROR_NONE != ret) { - return LogAndCreateResult(ErrorCode::ABORT_ERR, "Error while removing status listener", - ("app_manager_unset_event_cb failed, error: %d", ret)); - } - } - - return PlatformResult(ErrorCode::NO_ERROR); -} - } // namespace application } // namespace extension diff --git a/src/application/application_manager.h b/src/application/application_manager.h index f80ddc1..f5585b3 100755 --- a/src/application/application_manager.h +++ b/src/application/application_manager.h @@ -18,7 +18,6 @@ #define SRC_APPLICATION_APPLICATION_MANAGER_H__ #include -#include #include #include #include @@ -53,7 +52,6 @@ class ApplicationManager { void GetAppCerts(const std::string& app_id, picojson::object* out); void GetAppSharedUri(const std::string& app_id, picojson::object* out); void GetAppMetaData(const std::string& app_id, picojson::object* out); - void GetBatteryUsageInfo(const picojson::value& args, picojson::object* out); void StartAppInfoEventListener(picojson::object* out); void StopAppInfoEventListener(); void GetApplicationInformationSize(const picojson::value& args, picojson::object* out); @@ -63,8 +61,6 @@ class ApplicationManager { common::PlatformResult StartEventListener(const std::string& event_name, const JsonCallback& callback); void StopEventListener(const std::string& event_name); - common::PlatformResult StartStatusListener(const JsonCallback& callback); - common::PlatformResult StopStatusChangeListener(); private: char* GetPackageId(const std::string& app_id); @@ -72,19 +68,12 @@ class ApplicationManager { pkgmgr_client* pkgmgr_client_handle_; pkgmgr_client* pkgmgr_client_uninstall_handle_; ApplicationInstance& instance_; - app_manager_event_h app_status_handle_; JsonCallback event_callback_; - JsonCallback status_callback_; std::map event_handler_map_; static void OnEvent(const char* event_name, bundle* event_data, void* user_data); - static void OnStatusEvent(const char *type, const char *app_id, - app_manager_event_type_e event_type, - app_manager_event_state_e event_state, - app_manager_event_h handle, - void *user_data); }; } // namespace application diff --git a/src/bluetooth/bluetooth.gyp b/src/bluetooth/bluetooth.gyp index 8981306..72eb206 100644 --- a/src/bluetooth/bluetooth.gyp +++ b/src/bluetooth/bluetooth.gyp @@ -50,7 +50,6 @@ 'variables': { 'packages': [ 'capi-network-bluetooth', - 'capi-appfw-app-control', 'capi-system-info', 'libpcrecpp', ] diff --git a/src/common/common.gyp b/src/common/common.gyp index 64404f8..7f4e78e 100644 --- a/src/common/common.gyp +++ b/src/common/common.gyp @@ -68,7 +68,7 @@ 'variables': { 'packages': [ 'capi-appfw-app-manager', - 'capi-appfw-app-common', + 'capi-appfw-application', 'capi-appfw-package-manager', 'storage', 'security-privilege-manager', diff --git a/src/convergence/convergence_instance.cc b/src/convergence/convergence_instance.cc index 8634375..4ad3807 100644 --- a/src/convergence/convergence_instance.cc +++ b/src/convergence/convergence_instance.cc @@ -412,11 +412,7 @@ common::TizenResult ConvergenceInstance::RemoteAppControlServiceLaunchAppControl static_cast(ConvergenceUtils::GetArg(args, kJSCurrentListenerId).get())); } - //only in case of failure call callback - //other cases are handled by conv_service_listener_cb() - if (!result) { - this->Post(token, result); - } + this->Post(token, result); }; std::thread(launch_app_control, token).detach(); @@ -453,7 +449,7 @@ common::TizenResult ConvergenceInstance::AppCommunicationServiceStart(const pico auto channel_arg = ConvergenceUtils::GetArg(args, kJSArgumentChannel); std::vector::iterator channel_it = service->GetChannel(channel_arg); - if (service->opened_channels.end() != channel_it) { + if (service->IsChannelStarted(channel_it)) { result = LogAndCreateTizenError(InvalidStateError, "Service is already started for the channel.", ("Service is already started for the channel.")); } else { @@ -505,7 +501,7 @@ common::TizenResult ConvergenceInstance::AppCommunicationServiceSend(const picoj auto channel_arg = ConvergenceUtils::GetArg(args, kJSArgumentChannel); std::vector::iterator channel_it = service->GetChannel(channel_arg); - if (service->opened_channels.end() == channel_it) { + if (!service->IsChannelStarted(channel_it)) { result = LogAndCreateTizenError(InvalidStateError, "Service is not started for the channel.", ("Service is not started for the channel.")); } else { @@ -556,7 +552,7 @@ common::TizenResult ConvergenceInstance::AppCommunicationServiceStop(const picoj auto channel_arg = ConvergenceUtils::GetArg(args, kJSArgumentChannel); std::vector::iterator channel_it = service->GetChannel(channel_arg); - if (service->opened_channels.end() == channel_it) { + if (!service->IsChannelStarted(channel_it)) { result = LogAndCreateTizenError(InvalidStateError, "Service is not started for the channel.", ("Service is not started for the channel.")); } else { @@ -609,7 +605,7 @@ common::TizenResult ConvergenceInstance::AppCommunicationServiceGetClientList(co auto channel_arg = ConvergenceUtils::GetArg(args, kJSArgumentChannel); std::vector::iterator channel_it = service->GetChannel(channel_arg); - if (service->opened_channels.end() == channel_it) { + if (!service->IsChannelStarted(channel_it)) { result = LogAndCreateTizenError(InvalidStateError, "Service is not started for the channel.", ("Service is not started for the channel.")); } else { diff --git a/src/convergence/convergence_remote_app_control_service.cc b/src/convergence/convergence_remote_app_control_service.cc index 70f00c9..7116645 100644 --- a/src/convergence/convergence_remote_app_control_service.cc +++ b/src/convergence/convergence_remote_app_control_service.cc @@ -128,7 +128,6 @@ TizenResult ConvergenceRemoteAppControlService::Disconnect() { } int error = conv_service_disconnect(service); - if (CONV_ERROR_NONE != error) { return LogAndCreateTizenError(AbortError, "conv_service_disconnect [Fail]"); } else { diff --git a/src/convergence/convergence_service.cc b/src/convergence/convergence_service.cc index f2b2bbe..29992d7 100644 --- a/src/convergence/convergence_service.cc +++ b/src/convergence/convergence_service.cc @@ -203,6 +203,11 @@ std::vector::iterator ConvergenceService::GetChannel(const return opened_channels.end(); } +bool ConvergenceService::IsChannelStarted(std::vector::iterator it) { + ScopeLogger(); + return it != opened_channels.end(); +} + void ConvergenceService::RemoveChannel(std::vector::iterator it) { ScopeLogger(); opened_channels.erase(it); diff --git a/src/convergence/convergence_service.h b/src/convergence/convergence_service.h index 9f4b4e4..42ff0a6 100644 --- a/src/convergence/convergence_service.h +++ b/src/convergence/convergence_service.h @@ -46,13 +46,13 @@ class ConvergenceService { public: void Refresh(); std::vector::iterator GetChannel(const picojson::value &channel_json); + bool IsChannelStarted(std::vector::iterator); void RemoveChannel(std::vector::iterator); public: //conv_service_e get_type() const { return type_; } //conv_device_h get_device() const {return device_; } picojson::value ToJson() const; - std::vector opened_channels; protected: conv_service_h FindServiceHandle() const; @@ -68,6 +68,7 @@ class ConvergenceService { conv_device_h device_; // TODO rename to device_handle_ conv_service_e type_; mutable conv_service_h service_handle_; + std::vector opened_channels; friend class ConvergenceAppCommunicationServerService; // It is needed to register the local service private: conv_service_connection_state_e connection_state_; diff --git a/src/convergence/convergence_utils.cc b/src/convergence/convergence_utils.cc index f14cac2..bbe9a7c 100644 --- a/src/convergence/convergence_utils.cc +++ b/src/convergence/convergence_utils.cc @@ -97,7 +97,6 @@ common::TizenResult ConvergenceUtils::ConvertConvergenceError(int error) { } return common::TizenSuccess(); - } } // namespace convergence diff --git a/src/humanactivitymonitor/gesture_manager.cc b/src/humanactivitymonitor/gesture_manager.cc deleted file mode 100644 index 050d79e..0000000 --- a/src/humanactivitymonitor/gesture_manager.cc +++ /dev/null @@ -1,413 +0,0 @@ -/* - * Copyright (c) 2017 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 "humanactivitymonitor/gesture_manager.h" - -#include - -#include "common/logger.h" -#include "common/optional.h" -#include "common/picojson.h" -#include "common/tools.h" -#include "common/scope_exit.h" -#include "common/extension.h" - -namespace extension { -namespace humanactivitymonitor { - -using common::PlatformResult; -using common::ErrorCode; -using common::tools::ReportError; -using common::tools::ReportSuccess; - -namespace { - -const std::string kListenerId = "listenerId"; -const std::string kListener = "GestureRecognitionListener"; -const std::string kType = "type"; -const std::string kTimestamp = "timestamp"; -const std::string kAlwayOn = "alwaysOn"; -const std::string kAction = "action"; -const std::string kEvent = "event"; -const std::string kError = "error"; -const std::string kOnError = "onerror"; -const std::string kOnDetect = "ondetect"; - -ErrorCode getErrorCode(int error) { - switch (error) { - case GESTURE_ERROR_NONE: - return ErrorCode::NO_ERROR; - case GESTURE_ERROR_INVALID_PARAMETER: - return ErrorCode::INVALID_VALUES_ERR; - case GESTURE_ERROR_OPERATION_FAILED: - return ErrorCode::IO_ERR; - case GESTURE_ERROR_NOT_SUPPORTED: - return ErrorCode::NOT_SUPPORTED_ERR; - case GESTURE_ERROR_INVALID_OPERATION: - case GESTURE_ERROR_OUT_OF_MEMORY: - case GESTURE_ERROR_PERMISSION_DENIED: - case GESTURE_ERROR_ALREADY_STARTED: - case GESTURE_ERROR_NOT_STARTED: - default: - return ErrorCode::ABORT_ERR; - } -} - -PlatformResult StrToGestureType(const std::string& type, gesture_type_e* type_e) { - if ("GESTURE_DOUBLE_TAP" == type) { - *type_e = GESTURE_DOUBLE_TAP; - } else if ("GESTURE_MOVE_TO_EAR" == type) { - *type_e = GESTURE_MOVE_TO_EAR; - } else if ("GESTURE_NO_MOVE" == type) { - *type_e = GESTURE_NO_MOVE; - } else if ("GESTURE_PICK_UP" == type) { - *type_e = GESTURE_PICK_UP; - } else if ("GESTURE_SHAKE" == type) { - *type_e = GESTURE_SHAKE; - } else if ("GESTURE_SNAP" == type) { - *type_e = GESTURE_SNAP; - } else if ("GESTURE_TILT" == type) { - *type_e = GESTURE_TILT; - } else if ("GESTURE_TURN_FACE_DOWN" == type) { - *type_e = GESTURE_TURN_FACE_DOWN; - } else if ("GESTURE_WRIST_UP" == type) { - *type_e = GESTURE_WRIST_UP; - } else { - return PlatformResult(ErrorCode::TYPE_MISMATCH_ERR, "Unknown gesture type"); - } - - return PlatformResult(ErrorCode::NO_ERROR); -} - -std::string GestureTypeToStr(gesture_type_e type) { - switch (type) { - case GESTURE_DOUBLE_TAP: - return "GESTURE_DOUBLE_TAP"; - case GESTURE_MOVE_TO_EAR: - return "GESTURE_MOVE_TO_EAR"; - case GESTURE_NO_MOVE: - return "GESTURE_NO_MOVE"; - case GESTURE_PICK_UP: - return "GESTURE_PICK_UP"; - case GESTURE_SHAKE: - return "GESTURE_SHAKE"; - case GESTURE_SNAP: - return "GESTURE_SNAP"; - case GESTURE_TILT: - return "GESTURE_TILT"; - case GESTURE_TURN_FACE_DOWN: - return "GESTURE_TURN_FACE_DOWN"; - case GESTURE_WRIST_UP: - return "GESTURE_WRIST_UP"; - default: - return "GESTURE_UNKNOWN_TYPE"; - } -} -std::string GestureEventToStr(gesture_event_e event, gesture_type_e gesture) { - switch (event) { - // GESTURE_EVENT_DETECTED == GESTURE_SHAKE_DETECTED == GESTURE_SNAP_X_NEGATIVE == 1 - case GESTURE_EVENT_DETECTED: - if (GESTURE_SHAKE == gesture) { - return "GESTURE_SHAKE_DETECTED"; - } else if (GESTURE_SNAP == gesture) { - return "GESTURE_SNAP_X_NEGATIVE"; - } else { - return "GESTURE_EVENT_DETECTED"; - } - // GESTURE_SHAKE_FINISHED == GESTURE_SNAP_X_POSITIVE == 2 - case GESTURE_SHAKE_FINISHED: - if (GESTURE_SHAKE == gesture) { - return "GESTURE_SHAKE_FINISHED"; - } else { - return "GESTURE_SNAP_X_POSITIVE"; - } - case GESTURE_SNAP_Y_NEGATIVE: - return "GESTURE_SNAP_Y_NEGATIVE"; - case GESTURE_SNAP_Y_POSITIVE: - return "GESTURE_SNAP_Y_POSITIVE"; - case GESTURE_SNAP_Z_NEGATIVE: - return "GESTURE_SNAP_Z_NEGATIVE"; - case GESTURE_SNAP_Z_POSITIVE: - return "GESTURE_SNAP_Z_POSITIVE"; - default: - return "GESTURE_EVENT_NONE"; - } -} - -void GestureRecognitionDefaultCb(gesture_type_e gesture, const gesture_data_h data, - double timestamp, gesture_error_e error, void *user_data) { - ScopeLogger(); - - GestureManager* manager = static_cast(user_data); - if (!manager) { - LoggerW("User data is null"); - return; - } - - manager->CompleteGestureListenerCb(gesture, data, timestamp, error, false); -} - -void GestureRecognitionAlwaysOnCb(gesture_type_e gesture, const gesture_data_h data, - double timestamp, gesture_error_e error, void *user_data) { - ScopeLogger(); - GestureManager* manager = static_cast(user_data); - - if (!manager) { - LoggerW("User data is null"); - return; - } - - manager->CompleteGestureListenerCb(gesture, data, timestamp, error, true); -} - -} // namespace - -GestureManager::GestureManager() : - m_callback(nullptr), - m_recognition_default_map(), - m_recognition_always_on_map() { - ScopeLogger(); -} - -GestureManager::~GestureManager() { - ScopeLogger(); - - int ret = GESTURE_ERROR_NONE; - - for (auto& it : m_recognition_default_map) { - ret = gesture_stop_recognition(it.second); - if (GESTURE_ERROR_NONE != ret) { - LoggerE("gesture_stop_recognition() failed"); - } - - ret = gesture_release(it.second); - if (GESTURE_ERROR_NONE != ret) { - LoggerE("gesture_release() failed"); - } - } - - for (auto& it : m_recognition_always_on_map) { - ret = gesture_stop_recognition(it.second); - if (GESTURE_ERROR_NONE != ret) { - LoggerE("gesture_stop_recognition() failed"); - } - - ret = gesture_release(it.second); - if (GESTURE_ERROR_NONE != ret) { - LoggerE("gesture_release() failed"); - } - } - - m_recognition_default_map.clear(); - m_recognition_always_on_map.clear(); -} - -PlatformResult GestureManager::IsSupported(const std::string& type, bool* is_supported) { - ScopeLogger(); - - gesture_type_e type_e = GESTURE_DOUBLE_TAP; - PlatformResult result = StrToGestureType(type, &type_e); - if (!result) { - return result; - } - - int ret = gesture_is_supported(type_e, is_supported); - if (GESTURE_ERROR_NONE != ret) { - return LogAndCreateResult(getErrorCode(ret), - "Checking gesture failed", - ("Checking gesture failed, error: %d (%s)", ret, get_error_message(ret))); - } - - return PlatformResult(ErrorCode::NO_ERROR); -} - -gesture_event_e GestureManager::GetGestureEvent(const gesture_data_h data) { - ScopeLogger(); - - gesture_event_e event = GESTURE_EVENT_NONE; - int ret = gesture_get_event(data, &event); - if (GESTURE_ERROR_NONE != ret) { - LoggerE("gesture_get_event() failed, error %d (%s)", ret, get_error_message(ret)); - } - - return event; -} - -void GestureManager::FillTiltData(const gesture_data_h data, picojson::object* obj) { - ScopeLogger(); - - int x = 0; - int y = 0; - - int ret = gesture_get_tilt(data, &x, &y); - if (GESTURE_ERROR_NONE != ret) { - LoggerE("gesture_get_tilt() failed, error %d (%s)", ret, get_error_message(ret)); - } - - obj->insert(std::make_pair("x", picojson::value(static_cast(x)))); - obj->insert(std::make_pair("y", picojson::value(static_cast(y)))); -} - -void GestureManager::CompleteGestureListenerCb(gesture_type_e gesture, - const gesture_data_h data, - double timestamp, - gesture_error_e error, - bool always_on) { - ScopeLogger(); - - picojson::value response = picojson::value(picojson::object()); - auto& obj = response.get(); - - obj.insert(std::make_pair(kAlwayOn, picojson::value(always_on))); - obj.insert(std::make_pair(kListenerId, picojson::value(kListener))); - - if (GESTURE_ERROR_NONE != error) { - obj.insert(std::make_pair(kAction, picojson::value(kOnError))); - - PlatformResult result = LogAndCreateResult(getErrorCode(error), "Error occurred during recognition"); - ReportError(result, &obj); - } else { - gesture_event_e event = GetGestureEvent(data); - if (GESTURE_EVENT_NONE == event) { - LoggerD("Gesture event none detected."); - return; - } - - std::string gesture_str = GestureTypeToStr(gesture); - if ("GESTURE_UNKNOWN_TYPE" == gesture_str) { - LoggerE("Unknown gesture type"); - return; - } - - obj.insert(std::make_pair(kAction, picojson::value(kOnDetect))); - - picojson::value result = picojson::value(picojson::object()); - auto& result_obj = result.get(); - - result_obj.insert(std::make_pair(kEvent, picojson::value(GestureEventToStr(event, gesture)))); - result_obj.insert(std::make_pair(kTimestamp, picojson::value(timestamp))); - result_obj.insert(std::make_pair(kType, picojson::value(gesture_str))); - - if (GESTURE_TILT == gesture) { - FillTiltData(data, &result_obj); - } - - ReportSuccess(result, obj); - } - - if (!m_callback) { - LoggerE("Callback is not defined"); - } else { - m_callback(&response); - } -} - -PlatformResult GestureManager::AddListener(gesture_type_e type, gesture_option_e option, - RecognitionMap& gesture_map, - gesture_recognition_cb callback) { - ScopeLogger(); - - gesture_h handle = nullptr; - - int ret = gesture_create(&handle); - if (GESTURE_ERROR_NONE != ret) { - return LogAndCreateResult(getErrorCode(ret), - "Creating handle failed", - ("Creating handle failed, error: %d (%s)", ret, get_error_message(ret))); - } - - ret = gesture_start_recognition(handle, type, option, callback, this); - if (GESTURE_ERROR_NONE != ret) { - gesture_release(handle); - return LogAndCreateResult(getErrorCode(ret), - "Starting recognition failed", - ("Starting recognition failed, error: %d (%s)", ret, get_error_message(ret))); - } - - gesture_map[type] = handle; - - return PlatformResult(ErrorCode::NO_ERROR); -} - - -PlatformResult GestureManager::AddGestureRecognitionListener(const std::string& type, - bool always_on, - JsonCallback cb) { - ScopeLogger(); - - gesture_type_e type_e = GESTURE_DOUBLE_TAP; - PlatformResult result = StrToGestureType(type, &type_e); - if (!result) { - return result; - } - - gesture_option_e option = GESTURE_OPTION_DEFAULT; - gesture_recognition_cb callback = GestureRecognitionDefaultCb; - RecognitionMap* gesture_map = &m_recognition_default_map; - - if (!m_callback) { - m_callback = cb; - } - - if (always_on) { - option = GESTURE_OPTION_ALWAYS_ON; - callback = GestureRecognitionAlwaysOnCb; - gesture_map = &m_recognition_always_on_map; - } - - return AddListener(type_e, option, *gesture_map, callback); -} - -PlatformResult GestureManager::RemoveGestureRecognitionListener(const std::string& type, - bool always_on) { - ScopeLogger(); - - auto& recognition_map = always_on ? m_recognition_always_on_map : m_recognition_default_map; - gesture_type_e type_e = GESTURE_DOUBLE_TAP; - PlatformResult result = StrToGestureType(type, &type_e); - if (!result) { - LoggerD("Unknown gesture type."); - return PlatformResult(ErrorCode::NO_ERROR); - } - - gesture_h handle = nullptr; - RecognitionMap::iterator it = recognition_map.find(type_e); - - if (recognition_map.end() != it) { - handle = it->second; - } - - if (handle) { - int ret = gesture_stop_recognition(handle); - if (GESTURE_ERROR_NONE != ret) { - return LogAndCreateResult(getErrorCode(ret), - "Stoping recognition failed", - ("Stoping recognition failed, error: %d (%s)", ret, get_error_message(ret))); - } - - ret = gesture_release(handle); - if (GESTURE_ERROR_NONE != ret) { - LoggerE("gesture_release() failed"); - } - - recognition_map.erase(it); - } - - return PlatformResult(ErrorCode::NO_ERROR); -} - -} // namespace humanactivitymonitor -} // namespace extension diff --git a/src/humanactivitymonitor/gesture_manager.h b/src/humanactivitymonitor/gesture_manager.h deleted file mode 100644 index 081b81d..0000000 --- a/src/humanactivitymonitor/gesture_manager.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -#ifndef HUMANACTIVITYMONITOR_GESTURE_MANAGER_H -#define HUMANACTIVITYMONITOR_GESTURE_MANAGER_H - -#include -#include -#include - -#include "common/picojson.h" -#include "common/platform_result.h" - -namespace extension { -namespace humanactivitymonitor { - -using JsonCallback = std::function; - -typedef std::map RecognitionMap; - -class GestureManager { - public: - GestureManager(); - virtual ~GestureManager(); - - common::PlatformResult IsSupported(const std::string& types, bool* is_supported); - common::PlatformResult AddGestureRecognitionListener(const std::string& type, bool always_on, - JsonCallback cb); - common::PlatformResult RemoveGestureRecognitionListener(const std::string& type, bool always_on); - void CompleteGestureListenerCb(gesture_type_e gesture, const gesture_data_h data, - double timestamp, gesture_error_e error, bool always_on); - - private: - gesture_event_e GetGestureEvent(const gesture_data_h data); - void FillTiltData(const gesture_data_h data, picojson::object* obj); - common::PlatformResult AddListener(gesture_type_e type, gesture_option_e option, - RecognitionMap& gesture_map, gesture_recognition_cb callback); - - JsonCallback m_callback; - RecognitionMap m_recognition_default_map; - RecognitionMap m_recognition_always_on_map; -}; - -} // namespace humanactivitymonitor -} // namespace extension - -#endif // HUMANACTIVITYMONITOR_GESTURE_MANAGER_H diff --git a/src/humanactivitymonitor/humanactivitymonitor.gyp b/src/humanactivitymonitor/humanactivitymonitor.gyp index c6b54a0..6c250c1 100755 --- a/src/humanactivitymonitor/humanactivitymonitor.gyp +++ b/src/humanactivitymonitor/humanactivitymonitor.gyp @@ -17,8 +17,6 @@ 'humanactivitymonitor_instance.h', 'humanactivitymonitor_manager.cc', 'humanactivitymonitor_manager.h', - 'gesture_manager.cc', - 'gesture_manager.h', ], 'conditions': [ ['tizen == 1', { diff --git a/src/humanactivitymonitor/humanactivitymonitor_api.js b/src/humanactivitymonitor/humanactivitymonitor_api.js index 7b3a8f7..3f06004 100755 --- a/src/humanactivitymonitor/humanactivitymonitor_api.js +++ b/src/humanactivitymonitor/humanactivitymonitor_api.js @@ -78,18 +78,6 @@ var SleepStatus = { AWAKE: 'AWAKE' }; -var GestureType = { - GESTURE_DOUBLE_TAP : 'GESTURE_DOUBLE_TAP', - GESTURE_MOVE_TO_EAR : 'GESTURE_MOVE_TO_EAR', - GESTURE_NO_MOVE : 'GESTURE_NO_MOVE', - GESTURE_PICK_UP : 'GESTURE_PICK_UP', - GESTURE_SHAKE : 'GESTURE_SHAKE', - GESTURE_SNAP : 'GESTURE_SNAP', - GESTURE_TILT : 'GESTURE_TILT', - GESTURE_TURN_FACE_DOWN : 'GESTURE_TURN_FACE_DOWN', - GESTURE_WRIST_UP : 'GESTURE_WRIST_UP', -}; - function convertActivityData(type, data) { switch (type) { case HumanActivityType.PEDOMETER: @@ -524,157 +512,6 @@ HumanActivityMonitorManager.prototype.readRecorderData = function() { } }; -HumanActivityMonitorManager.prototype.isGestureSupported = function() { - var args = validator_.validateMethod(arguments, [{ - name : 'type', - type: types_.ENUM, - values: Object.keys(GestureType) - } - ]); - - var callArgs = {}; - callArgs.type = args.type; - - var result = native_.callSync('GestureManager_isGestureSupported', callArgs); - if (native_.isFailure(result)) { - throw native_.getErrorObject(result); - } - - return native_.getResultObject(result); -}; - -function GestureListenerManager(native, listenerName) { - this.listeners = {}; - //below maps keep information about number of registered listeners for the specific type - //there are two maps as one keeps information about listeners which should be always called - //and one keeps information about number of the listeners which should be called only - //if power-saving mode is off - this.typeCountMapDefault = {}; - this.typeCountMapAlwaysOn = {}; - this.nextId = 1; - this.nativeSet = false; - this.native = native; - this.listenerName = listenerName; - for (var type in GestureType) { - this.typeCountMapDefault[type] = this.typeCountMapAlwaysOn[type] = 0; - } -}; - -GestureListenerManager.prototype.onListenerCalled = function(msg) { - var d = undefined; - var result = undefined; - var alwaysOn = msg.alwaysOn; - switch (msg.action) { - case 'ondetect': - d = new GestureData(this.native.getResultObject(msg)); - break; - case 'onerror': - d = this.native.getErrorObject(msg); - break; - default: - utils_.log('Unknown mode: ' + msg.action); - return; - } - - for (var watchId in this.listeners) { - if (this.listeners.hasOwnProperty(watchId)) { - var listener = this.listeners[watchId]; - var call = alwaysOn ? listener.alwaysOn : true; - if (call && listener[msg.action]) { - listener[msg.action](d); - } - } - } -}; - -GestureListenerManager.prototype.addListener = function(successCb, errorCb, type, alwaysOn) { - var listener = { - 'type' : type, - 'alwaysOn' : alwaysOn, - 'ondetect' : successCb, - 'onerror' : errorCb - }; - - var typeCountMap = alwaysOn ? this.typeCountMapAlwaysOn : this.typeCountMapDefault; - if (typeCountMap[type] === 0) { - var result = this.native.callSync('GestureManager_addGestureRecognitionListener', listener); - if (this.native.isFailure(result)) { - throw this.native.getErrorObject(result); - } - } - - typeCountMap[type]++; - var id = this.nextId++; - this.listeners[id] = listener; - - if (!this.nativeSet) { - this.native.addListener(this.listenerName, this.onListenerCalled.bind(this)); - this.nativeSet = true; - } - - return id; -}; - -GestureListenerManager.prototype.removeListener = function(watchId) { - if (this.listeners.hasOwnProperty(watchId)) { - var listener = this.listeners[watchId]; - var typeCountMap = listener.alwaysOn ? this.typeCountMapAlwaysOn : this.typeCountMapDefault; - - if (typeCountMap[listener.type] === 1) { - var result = this.native.callSync('GestureManager_removeGestureRecognitionListener', listener); - if (this.native.isFailure(result)) { - throw this.native.getErrorObject(result); - } - } - - delete this.listeners[watchId]; - typeCountMap[listener.type]--; - } - - if (this.nativeSet && type_.isEmptyObject(this.listeners)) { - this.native.removeListener(this.listenerName); - this.nativeSet = false; - } -}; - -var GESTURE_RECOGNITION_LISTENER = 'GestureRecognitionListener'; -var gestureRecognitionListener = new GestureListenerManager(native_, GESTURE_RECOGNITION_LISTENER); - -HumanActivityMonitorManager.prototype.addGestureRecognitionListener = function() { - var args = validator_.validateMethod(arguments, [{ - name : 'type', - type: types_.ENUM, - values: Object.keys(GestureType) - }, - { - name : 'eventCallback', - type : types_.FUNCTION - }, - { - name : 'errorCallback', - type : types_.FUNCTION, - optional: true, - nullable: true - }, - { - name : 'alwaysOn', - type : types_.BOOLEAN, - optional : true, - nullable : true - }]); - - return gestureRecognitionListener.addListener(args.eventCallback, args.errorCallback, args.type, args.alwaysOn); -}; - -HumanActivityMonitorManager.prototype.removeGestureRecognitionListener = function() { - var args = validator_.validateMethod(arguments, [{ - name : 'watchId', - type : types_.LONG, - }]); - - gestureRecognitionListener.removeListener(args.watchId); -}; - function StepDifference(data) { SetReadOnlyProperty(this, 'stepCountDifference', data.stepCountDifference); SetReadOnlyProperty(this, 'timestamp', data.timestamp); @@ -812,22 +649,6 @@ function HumanActivityRecorderPressureData(data) { SetReadOnlyProperty(this, 'average', data.average); } -function GestureData(data) { - if (data) { - SetReadOnlyProperty(this, 'type', data.type); - SetReadOnlyProperty(this, 'event', data.event); - SetReadOnlyProperty(this, 'timestamp', data.timestamp); - - if (data.type === 'GESTURE_TILT') { - SetReadOnlyProperty(this, 'x', data.x); - SetReadOnlyProperty(this, 'y', data.y); - } else { - SetReadOnlyProperty(this, 'x', null); - SetReadOnlyProperty(this, 'y', null); - } - } -} - HumanActivityRecorderPressureData.prototype = new HumanActivityRecorderData(); HumanActivityRecorderPressureData.prototype.constructor = HumanActivityRecorderPressureData; diff --git a/src/humanactivitymonitor/humanactivitymonitor_instance.cc b/src/humanactivitymonitor/humanactivitymonitor_instance.cc index 69c1c2a..89eeb67 100755 --- a/src/humanactivitymonitor/humanactivitymonitor_instance.cc +++ b/src/humanactivitymonitor/humanactivitymonitor_instance.cc @@ -43,8 +43,7 @@ using common::PlatformResult; using common::ErrorCode; using common::TaskQueue; -HumanActivityMonitorInstance::HumanActivityMonitorInstance() : - gesture_manager_() { +HumanActivityMonitorInstance::HumanActivityMonitorInstance() { LoggerD("Enter"); using std::placeholders::_1; using std::placeholders::_2; @@ -67,12 +66,6 @@ HumanActivityMonitorInstance::HumanActivityMonitorInstance() : HumanActivityMonitorManagerStopRecorder); REGISTER_SYNC("HumanActivityMonitorManager_readRecorderData", HumanActivityMonitorManagerReadRecorderData); - REGISTER_SYNC("GestureManager_isGestureSupported", - GestureManagerIsGestureSupported); - REGISTER_SYNC("GestureManager_addGestureRecognitionListener", - GestureManagerAddGestureRecognitionListener); - REGISTER_SYNC("GestureManager_removeGestureRecognitionListener", - GestureManagerRemoveGestureRecognitionListener); #undef REGISTER_SYNC } @@ -388,65 +381,6 @@ void HumanActivityMonitorInstance::HumanActivityMonitorManagerReadRecorderData( ReportSuccess(out); } -void HumanActivityMonitorInstance::GestureManagerIsGestureSupported( - const picojson::value& args, picojson::object& out) { - LoggerD("Enter"); - - CHECK_EXIST(args, "type", out) - const auto& type = args.get("type").get(); - bool is_supported = false; - - PlatformResult result = gesture_manager_.IsSupported(type, &is_supported); - if (result) { - ReportSuccess(picojson::value(is_supported), out); - } else { - LogAndReportError(result, &out, ("Failed: gesture_manager_->IsSupported()")); - } -} - -void HumanActivityMonitorInstance::GestureManagerAddGestureRecognitionListener( - const picojson::value& args, picojson::object& out) { - LoggerD("Enter"); - - CHECK_EXIST(args, "type", out) - CHECK_EXIST(args, "alwaysOn", out) - const auto& type = args.get("type").get(); - bool always_on = args.get("alwaysOn").get(); - - auto cb = [this](picojson::value* data) -> void { - if (!data) { - LoggerE("No data passed to json callback"); - return; - } - - Instance::PostMessage(this, data->serialize().c_str()); - }; - - PlatformResult result = gesture_manager_.AddGestureRecognitionListener(type, always_on, cb); - if (result) { - ReportSuccess(out); - } else { - LogAndReportError(result, &out, ("Failed: gesture_manager_->AddGestureRecognitionListener()")); - } -} - -void HumanActivityMonitorInstance::GestureManagerRemoveGestureRecognitionListener( - const picojson::value& args, picojson::object& out) { - LoggerD("Enter"); - - CHECK_EXIST(args, "type", out) - CHECK_EXIST(args, "alwaysOn", out) - const auto& type = args.get("type").get(); - bool always_on = args.get("alwaysOn").get(); - - PlatformResult result = gesture_manager_.RemoveGestureRecognitionListener(type, always_on); - if (result) { - ReportSuccess(out); - } else { - LogAndReportError(result, &out, ("Failed: gesture_manager_->RemoveGestureRecognitionListener()")); - } -} - #undef CHECK_EXIST } // namespace humanactivitymonitor diff --git a/src/humanactivitymonitor/humanactivitymonitor_instance.h b/src/humanactivitymonitor/humanactivitymonitor_instance.h index c58e37c..1ab6829 100755 --- a/src/humanactivitymonitor/humanactivitymonitor_instance.h +++ b/src/humanactivitymonitor/humanactivitymonitor_instance.h @@ -22,7 +22,6 @@ #include "common/extension.h" #include "common/platform_result.h" #include "humanactivitymonitor/humanactivitymonitor_manager.h" -#include "humanactivitymonitor/gesture_manager.h" namespace extension { namespace humanactivitymonitor { @@ -49,15 +48,8 @@ class HumanActivityMonitorInstance : public common::ParsedInstance { const picojson::value& args, picojson::object& out); void HumanActivityMonitorManagerReadRecorderData( const picojson::value& args, picojson::object& out); - void GestureManagerIsGestureSupported( - const picojson::value& args, picojson::object& out); - void GestureManagerAddGestureRecognitionListener( - const picojson::value& args, picojson::object& out); - void GestureManagerRemoveGestureRecognitionListener( - const picojson::value& args, picojson::object& out); std::shared_ptr manager_; - GestureManager gesture_manager_; common::PlatformResult Init(); }; diff --git a/src/nfc/nfc.gyp b/src/nfc/nfc.gyp index 79597cd..25b02f9 100644 --- a/src/nfc/nfc.gyp +++ b/src/nfc/nfc.gyp @@ -34,7 +34,7 @@ 'packages': [ 'capi-system-info', 'capi-network-nfc', - 'capi-appfw-app-control', + 'capi-appfw-application' ] }, }], diff --git a/src/notification/notification.gyp b/src/notification/notification.gyp index 766fbb3..9c219a8 100755 --- a/src/notification/notification.gyp +++ b/src/notification/notification.gyp @@ -26,16 +26,10 @@ 'packages': [ 'notification', 'capi-system-device', - 'capi-appfw-app-control', ] }, }], ], - 'direct_dependent_settings': { - 'libraries' : [ - '-ltizen_notification', - ], - }, }, ], } diff --git a/src/notification/notification_api.js b/src/notification/notification_api.js index 5c7ce37..21bcadf 100644 --- a/src/notification/notification_api.js +++ b/src/notification/notification_api.js @@ -242,42 +242,6 @@ NotificationManager.prototype.stopLEDCustomEffect = function() { } }; -NotificationManager.prototype.saveNotificationAsTemplate = function(name, notification) { - var args = validator_.validateArgs(arguments, [ - {name: 'name', type: types_.STRING}, - {name: 'notification', type: types_.PLATFORM_OBJECT, values: StatusNotification} - ]); - - var result = native_.callSync('NotificationManager_saveNotificationAsTemplate', args); - - if (native_.isFailure(result)) { - throw native_.getErrorObject(result); - } -}; - -NotificationManager.prototype.createNotificationFromTemplate = function(name) { - var args = validator_.validateArgs(arguments, [ - {name: 'name', type: types_.STRING} - ]); - - if (!arguments.length) { - throw new WebAPIException(WebAPIException.NOT_FOUND_ERR); - } - - var result = native_.callSync('NotificationManager_createNotificationFromTemplate', args); - - if (native_.isFailure(result)) { - throw native_.getErrorObject(result); - } - var n = native_.getResultObject(result); - - _edit.allow(); - var returnObject = new StatusNotification(n.statusType, n.title, n); - _edit.disallow(); - - return returnObject; -}; - function NotificationInitDict(data) { var _iconPath = null; diff --git a/src/notification/notification_instance.cc b/src/notification/notification_instance.cc index d4f06da..ec92eb5 100644 --- a/src/notification/notification_instance.cc +++ b/src/notification/notification_instance.cc @@ -52,8 +52,6 @@ NotificationInstance::NotificationInstance() { NotificationManagerPlayLEDCustomEffect); REGISTER_SYNC("NotificationManager_stopLEDCustomEffect", NotificationManagerStopLEDCustomEffect); - REGISTER_SYNC("NotificationManager_saveNotificationAsTemplate", NotificationManagerSaveTemplate); - REGISTER_SYNC("NotificationManager_createNotificationFromTemplate", NotificationManagerCreateFromTemplate); #undef REGISTER_SYNC manager_ = NotificationManager::GetInstance(); @@ -190,37 +188,6 @@ void NotificationInstance::NotificationManagerStopLEDCustomEffect( } } -void NotificationInstance::NotificationManagerSaveTemplate(const picojson::value& args, - picojson::object& out) { - LoggerD("Enter"); - CHECK_PRIVILEGE_ACCESS(kPrivilegeNotification, &out); - - PlatformResult status = manager_->SaveTemplate(args.get()); - - if (status.IsSuccess()) { - ReportSuccess(out); - } else { - LogAndReportError(status, &out); - } -} - - -void NotificationInstance::NotificationManagerCreateFromTemplate(const picojson::value& args, - picojson::object& out) { - LoggerD("Enter"); - CHECK_PRIVILEGE_ACCESS(kPrivilegeNotification, &out); - picojson::value val{picojson::object{}}; - - PlatformResult status = - manager_->CreateFromTemplate(args.get(), val.get()); - - if (status.IsSuccess()) { - ReportSuccess(val, out); - } else { - LogAndReportError(status, &out); - } -} - #undef CHECK_EXIST } // namespace notification diff --git a/src/notification/notification_instance.h b/src/notification/notification_instance.h index 4eef4f8..3a1e2e7 100644 --- a/src/notification/notification_instance.h +++ b/src/notification/notification_instance.h @@ -48,10 +48,6 @@ class NotificationInstance : public common::ParsedInstance { picojson::object& out); void NotificationManagerStopLEDCustomEffect(const picojson::value& args, picojson::object& out); - void NotificationManagerSaveTemplate(const picojson::value& args, - picojson::object& out); - void NotificationManagerCreateFromTemplate(const picojson::value& args, - picojson::object& out); }; } // namespace notification diff --git a/src/notification/notification_manager.cc b/src/notification/notification_manager.cc index 84adcd9..93f0c09 100644 --- a/src/notification/notification_manager.cc +++ b/src/notification/notification_manager.cc @@ -23,7 +23,6 @@ #include #include #include -#include #include "common/converter.h" #include "common/logger.h" @@ -245,64 +244,5 @@ PlatformResult NotificationManager::StopLEDCustomEffect() { return PlatformResult(ErrorCode::NO_ERROR); } -common::PlatformResult NotificationManager::SaveTemplate(const picojson::object& args) { - LoggerD("Enter"); - std::string name = FromJson(args, "name"); - notification_h noti_handle = nullptr; - int ret; - SCOPE_EXIT { - notification_free(noti_handle); - }; - - PlatformResult status = StatusNotification::GetNotiHandleFromJson(args, false, ¬i_handle); - - if (status.IsError()){ - return status; - } - - ret = notification_save_as_template(noti_handle, name.c_str()); - if (ret != NOTIFICATION_ERROR_NONE) { - LoggerD("Error: %d (%s)", ret, get_error_message(ret)); - if (ret == NOTIFICATION_ERROR_MAX_EXCEEDED) { - return LogAndCreateResult(ErrorCode::QUOTA_EXCEEDED_ERR, - "Maximum number of templates exceeded", - ("Maximum number of templates exceeded, error: %d", ret)); - } else { - return LogAndCreateResult(ErrorCode::ABORT_ERR, - "Saving template failed", - ("Saving template failed, error: %d", ret)); - } - } - - return PlatformResult(ErrorCode::NO_ERROR); -} - - -common::PlatformResult NotificationManager::CreateFromTemplate(const picojson::object& args, - picojson::object& out) { - LoggerD("Enter"); - std::string name = FromJson(args, "name"); - - notification_h noti_handle = nullptr; - noti_handle = notification_create_from_template(name.c_str()); - if (!noti_handle) { - return LogAndCreateResult(ErrorCode::NOT_FOUND_ERR, - "The template with given name not found", - ("The template with given name not found, handle is NULL")); - } - - SCOPE_EXIT { - notification_free(noti_handle); - }; - - PlatformResult status = StatusNotification::ToJson(0, noti_handle, nullptr, &out); - if (status.IsError()) - { - LoggerE("Failed: ToJson"); - return status; - } - return PlatformResult(ErrorCode::NO_ERROR); -} - } // namespace notification } // namespace extension diff --git a/src/notification/notification_manager.h b/src/notification/notification_manager.h index 85cd85f..eaeac9f 100644 --- a/src/notification/notification_manager.h +++ b/src/notification/notification_manager.h @@ -41,10 +41,6 @@ class NotificationManager { common::PlatformResult PlayLEDCustomEffect(const picojson::object& args); common::PlatformResult StopLEDCustomEffect(); - common::PlatformResult SaveTemplate(const picojson::object& args); - common::PlatformResult CreateFromTemplate(const picojson::object& args, - picojson::object& out); - private: NotificationManager(); virtual ~NotificationManager(); diff --git a/src/notification/status_notification.cc b/src/notification/status_notification.cc index 279182c..1b55a50 100644 --- a/src/notification/status_notification.cc +++ b/src/notification/status_notification.cc @@ -1088,21 +1088,19 @@ PlatformResult StatusNotification::ToJson(int id, return status; out["vibration"] = picojson::value(vibration); - if (app_handle) { - picojson::object app_control = picojson::object(); - status = GetApplicationControl(app_handle, &app_control); - if (status.IsError()) - return status; - if (app_control.size()) { - out["appControl"] = picojson::value(app_control); - } + picojson::object app_control = picojson::object(); + status = GetApplicationControl(app_handle, &app_control); + if (status.IsError()) + return status; + if (app_control.size()) { + out["appControl"] = picojson::value(app_control); + } - status = GetApplicationId(app_handle, &value_str); - if (status.IsError()) - return status; - if (value_str.length()) { - out["appId"] = picojson::value(value_str); - } + status = GetApplicationId(app_handle, &value_str); + if (status.IsError()) + return status; + if (value_str.length()) { + out["appId"] = picojson::value(value_str); } std::string progress_type; @@ -1146,9 +1144,9 @@ PlatformResult StatusNotification::ToJson(int id, return PlatformResult(ErrorCode::NO_ERROR); } -PlatformResult StatusNotification::GetNotiHandleFromJson(const picojson::object& args, - bool is_update, - notification_h *noti_handle){ +PlatformResult StatusNotification::FromJson(const picojson::object& args, + bool is_update, + picojson::object* out_ptr) { LoggerD("Enter"); picojson::object noti_obj = common::FromJson(args, "notification"); @@ -1162,29 +1160,32 @@ PlatformResult StatusNotification::GetNotiHandleFromJson(const picojson::object& return status; int id = NOTIFICATION_PRIV_ID_NONE; + int ret; - app_control_h app_control = nullptr; + notification_h noti_handle = nullptr; + app_control_h app_control = NULL; SCOPE_EXIT { if (app_control) { app_control_destroy(app_control); } + notification_free(noti_handle); }; if (is_update) { id = std::stoi(common::FromJson(noti_obj, "id")); - PlatformResult status = GetNotiHandle(id, noti_handle); + PlatformResult status = GetNotiHandle(id, ¬i_handle); if (status.IsError()) return status; } else { - status = Create(noti_type, noti_handle); + status = Create(noti_type, ¬i_handle); if (status.IsError()) return status; } - status = SetLayout(*noti_handle, status_type); + status = SetLayout(noti_handle, status_type); if (status.IsError()) { return status; } @@ -1194,7 +1195,7 @@ PlatformResult StatusNotification::GetNotiHandleFromJson(const picojson::object& const std::string& value_str = common::FromJson(noti_obj, "iconPath"); std::string real_path = common::FilesystemProvider::Create().GetRealPath(value_str); - status = SetImage(*noti_handle, NOTIFICATION_IMAGE_TYPE_ICON, real_path); + status = SetImage(noti_handle, NOTIFICATION_IMAGE_TYPE_ICON, real_path); if (status.IsError()) { return status; } @@ -1205,7 +1206,7 @@ PlatformResult StatusNotification::GetNotiHandleFromJson(const picojson::object& common::FromJson(noti_obj, "subIconPath"); std::string real_path = common::FilesystemProvider::Create().GetRealPath(value_str); - status = SetImage(*noti_handle, NOTIFICATION_IMAGE_TYPE_ICON_SUB, real_path); + status = SetImage(noti_handle, NOTIFICATION_IMAGE_TYPE_ICON_SUB, real_path); if (status.IsError()) { return status; } @@ -1213,7 +1214,7 @@ PlatformResult StatusNotification::GetNotiHandleFromJson(const picojson::object& if (val.contains("number") && !IsNull(noti_obj, "number")) { long number = (long)common::FromJson(noti_obj, "number"); - status = SetText(*noti_handle, NOTIFICATION_TEXT_TYPE_EVENT_COUNT, std::to_string(number)); + status = SetText(noti_handle, NOTIFICATION_TEXT_TYPE_EVENT_COUNT, std::to_string(number)); if (status.IsError()) { return status; } @@ -1221,28 +1222,28 @@ PlatformResult StatusNotification::GetNotiHandleFromJson(const picojson::object& if (val.contains("detailInfo") && !IsNull(noti_obj, "detailInfo")) { status = SetDetailInfos( - *noti_handle, common::FromJson(noti_obj, "detailInfo")); + noti_handle, common::FromJson(noti_obj, "detailInfo")); if (status.IsError()) { return status; } } if (val.contains("ledColor") && !IsNull(noti_obj, "ledColor")) { - status = SetLedColor(*noti_handle, + status = SetLedColor(noti_handle, common::FromJson(noti_obj, "ledColor")); if (status.IsError()) { return status; } } - status = SetLedOnPeriod(*noti_handle, + status = SetLedOnPeriod(noti_handle, static_cast(common::FromJson( noti_obj, "ledOnPeriod"))); if (status.IsError()) { return status; } - status = SetLedOffPeriod(*noti_handle, + status = SetLedOffPeriod(noti_handle, static_cast(common::FromJson( noti_obj, "ledOffPeriod"))); if (status.IsError()) { @@ -1254,7 +1255,7 @@ PlatformResult StatusNotification::GetNotiHandleFromJson(const picojson::object& const std::string& value_str = common::FromJson(noti_obj, "backgroundImagePath"); std::string real_path = common::FilesystemProvider::Create().GetRealPath(value_str); - status = SetImage(*noti_handle, NOTIFICATION_IMAGE_TYPE_BACKGROUND, real_path); + status = SetImage(noti_handle, NOTIFICATION_IMAGE_TYPE_BACKGROUND, real_path); if (status.IsError()) { return status; } @@ -1262,7 +1263,7 @@ PlatformResult StatusNotification::GetNotiHandleFromJson(const picojson::object& if (val.contains("thumbnails") && !IsNull(noti_obj, "thumbnails")) { status = SetThumbnails( - *noti_handle, common::FromJson(noti_obj, "thumbnails")); + noti_handle, common::FromJson(noti_obj, "thumbnails")); if (status.IsError()) { return status; } @@ -1272,14 +1273,14 @@ PlatformResult StatusNotification::GetNotiHandleFromJson(const picojson::object& const std::string& value_str = common::FromJson(noti_obj, "soundPath"); std::string real_path = common::FilesystemProvider::Create().GetRealPath(value_str); - status = SetSoundPath(*noti_handle, real_path); + status = SetSoundPath(noti_handle, real_path); if (status.IsError()) { return status; } } status = - SetVibration(*noti_handle, common::FromJson(noti_obj, "vibration")); + SetVibration(noti_handle, common::FromJson(noti_obj, "vibration")); if (status.IsError()) { return status; } @@ -1308,7 +1309,7 @@ PlatformResult StatusNotification::GetNotiHandleFromJson(const picojson::object& const std::string& progress_type = common::FromJson(noti_obj, "progressType"); - status = SetImage(*noti_handle, NOTIFICATION_IMAGE_TYPE_LIST_5, progress_type); + status = SetImage(noti_handle, NOTIFICATION_IMAGE_TYPE_LIST_5, progress_type); if (status.IsError()) { return status; } @@ -1321,14 +1322,14 @@ PlatformResult StatusNotification::GetNotiHandleFromJson(const picojson::object& progressValue = -1; } - status = SetProgressValue(*noti_handle, progress_type, progressValue, + status = SetProgressValue(noti_handle, progress_type, progressValue, is_update); if (status.IsError()) { return status; } - status = SetText(*noti_handle, + status = SetText(noti_handle, NOTIFICATION_TEXT_TYPE_TITLE, common::FromJson(noti_obj, "title")); if (status.IsError()) { @@ -1336,7 +1337,7 @@ PlatformResult StatusNotification::GetNotiHandleFromJson(const picojson::object& } if (val.contains("content") && !IsNull(noti_obj, "content")) { - status = SetText(*noti_handle, + status = SetText(noti_handle, NOTIFICATION_TEXT_TYPE_CONTENT, common::FromJson(noti_obj, "content")); if (status.IsError()) { @@ -1344,31 +1345,11 @@ PlatformResult StatusNotification::GetNotiHandleFromJson(const picojson::object& } } - status = SetAppControl(*noti_handle, app_control); - - return PlatformResult(ErrorCode::NO_ERROR); -} - -PlatformResult StatusNotification::FromJson(const picojson::object& args, - bool is_update, - picojson::object* out_ptr) { - LoggerD("Enter"); - notification_h noti_handle = nullptr; - int ret; - int id = NOTIFICATION_PRIV_ID_NONE; - - SCOPE_EXIT { - notification_free(noti_handle); - }; - - PlatformResult status = GetNotiHandleFromJson(args, is_update, ¬i_handle); - - if (status.IsError()){ - return status; - } + status = SetAppControl(noti_handle, app_control); if (is_update) { ret = notification_update(noti_handle); + } else { ret = notification_insert(noti_handle, &id); if (NOTIFICATION_ERROR_NONE != ret) { diff --git a/src/notification/status_notification.h b/src/notification/status_notification.h index 896abee..ae50e8d 100644 --- a/src/notification/status_notification.h +++ b/src/notification/status_notification.h @@ -23,8 +23,6 @@ #include "common/picojson.h" #include "common/platform_result.h" -#include "common/XW_Extension.h" - namespace extension { namespace notification { @@ -33,22 +31,17 @@ typedef std::map ImageEnumMap; class StatusNotification { public: - XW_EXPORT static common::PlatformResult ToJson(int id, + static common::PlatformResult ToJson(int id, notification_h noti_handle, app_control_h app_handle, picojson::object* out_ptr); - XW_EXPORT static common::PlatformResult GetNotiHandleFromJson(const picojson::object& args, - bool is_update, - notification_h *noti_handle); static common::PlatformResult FromJson(const picojson::object& args, bool is_update, picojson::object* out_ptr); - XW_EXPORT static common::PlatformResult GetAppControl(notification_h noti_handle, + static common::PlatformResult GetAppControl(notification_h noti_handle, app_control_h* app_control); static common::PlatformResult GetNotiHandle(int id, notification_h* noti_handle); - XW_EXPORT static common::PlatformResult SetAppControl(notification_h noti_handle, - app_control_h app_control); private: StatusNotification(); @@ -132,6 +125,8 @@ class StatusNotification { time_t* posted_time); static common::PlatformResult SetLayout(notification_h noti_handle, const std::string& noti_type); + static common::PlatformResult SetAppControl(notification_h noti_handle, + app_control_h app_control); static common::PlatformResult CreateAppControl(app_control_h* app_control); static bool IsColorFormatNumberic(const std::string& color); diff --git a/src/preference/preference.gyp b/src/preference/preference.gyp index eedd0f4..0b5161b 100644 --- a/src/preference/preference.gyp +++ b/src/preference/preference.gyp @@ -22,7 +22,7 @@ ['tizen == 1', { 'variables': { 'packages': [ - 'capi-appfw-preference', + 'capi-appfw-application', ] }, }], diff --git a/src/push/push.gyp b/src/push/push.gyp index 6028465..5cdb2ad 100644 --- a/src/push/push.gyp +++ b/src/push/push.gyp @@ -28,7 +28,7 @@ 'variables': { 'packages': [ 'push', - 'capi-appfw-app-control', + 'capi-appfw-application', 'libpcrecpp', ] }, diff --git a/src/systeminfo/systeminfo.gyp b/src/systeminfo/systeminfo.gyp index 5822c00..ae9d39f 100644 --- a/src/systeminfo/systeminfo.gyp +++ b/src/systeminfo/systeminfo.gyp @@ -47,6 +47,9 @@ ] }, }], + ['tizen_is_emulator == 1', { + 'defines': ['TIZEN_IS_EMULATOR'], + }], ], }, ], diff --git a/src/systeminfo/systeminfo_api.js b/src/systeminfo/systeminfo_api.js index 38e48da..e09c977 100644 --- a/src/systeminfo/systeminfo_api.js +++ b/src/systeminfo/systeminfo_api.js @@ -46,17 +46,6 @@ var SystemInfoPropertyId = { ADS : 'ADS' }; -var SystemInfoPropertyIdToFeature = { - BATTERY : 'http://tizen.org/feature/battery', - CAMERA_FLASH : 'http://tizen.org/feature/camera.back.flash', - CELLULAR_NETWORK : 'http://tizen.org/feature/network.telephony', - DISPLAY : 'http://tizen.org/feature/screen', - ETHERNET_NETWORK : 'http://tizen.org/feature/network.ethernet', - SIM : 'http://tizen.org/feature/network.telephony', - NET_PROXY_NETWORK : 'http://tizen.org/feature/network.net_proxy', - WIFI_NETWORK : 'http://tizen.org/feature/network.wifi' -}; - //class SystemInfoDeviceCapability //////////////////////////////////////////////////// function SystemInfoDeviceCapability(data) { Object.defineProperties(this, { @@ -424,16 +413,6 @@ function SystemInfoBattery(data) { value : data.isCharging, writable : false, enumerable : true - }, - timeToDischarge : { - value : data.timeToDischarge, - writable : false, - enumerable : true - }, - timeToFullCharge : { - value : data.timeToFullCharge, - writable : false, - enumerable : true } }); } @@ -811,15 +790,6 @@ var _createPropertyArray = function (property, data) { return propertyArray; }; -var _checkPropertySupported = function(property){ - if (SystemInfoPropertyIdToFeature[property]) { - var supported = tizen.systeminfo.getCapability(SystemInfoPropertyIdToFeature[property]); - if (!supported) { - return false; - } - } - return true; -}; var getPropertyFunction = function(cppLabel, objectCreateFunction) { return function() { @@ -848,16 +818,6 @@ var getPropertyFunction = function(cppLabel, objectCreateFunction) { if (!propObject) { throw new WebAPIException(WebAPIException.TYPE_MISMATCH_ERR, 'Property with id: ' + args.property + ' is not supported.'); } - - if (_checkPropertySupported(args.property) === false) { - setTimeout(function() { - native_.callIfPossible(args.errorCallback, - new WebAPIException(WebAPIException.NOT_SUPPORTED_ERR, - 'Property with id: ' + args.property + ' is not supported.')); - }, 0); - return; - } - var callback = function(result) { if (native_.isFailure(result)) { setTimeout(function() { @@ -1369,15 +1329,6 @@ var getListenerFunction = function (isArray) { } ]); - if (_checkPropertySupported(args.property) === false) { - setTimeout(function() { - native_.callIfPossible(args.errorCallback, - new WebAPIException(WebAPIException.NOT_SUPPORTED_ERR, - 'Property with id: ' + args.property + ' is not supported.')); - }, 0); - return; - } - var listener = { callback : args.successCallback, isArrayType : isArray, diff --git a/src/systeminfo/systeminfo_device_capability.cc b/src/systeminfo/systeminfo_device_capability.cc index cec92de..65675fc 100644 --- a/src/systeminfo/systeminfo_device_capability.cc +++ b/src/systeminfo/systeminfo_device_capability.cc @@ -566,44 +566,17 @@ bool SystemInfoDeviceCapability::IsScreen() { return true; } - -#define MODEL_NAME "http://tizen.org/system/model_name" -#define MODEL_EMULATOR "Emulator" -bool _is_emulator(void) -{ - int ret; - char *model_name = NULL; - static bool emul = false; - static int set = 0; - - if (set) - return emul; - - ret = system_info_get_platform_string(MODEL_NAME, &model_name); - if (ret < 0) { - LoggerD("Cannot get model name(%d)", ret); - return emul; - } - - if (!strncmp(MODEL_EMULATOR, model_name, strlen(model_name) + 1)) - emul = true; - - set = 1; - free(model_name); - - return emul; -} - PlatformResult SystemInfoDeviceCapability::GetPlatformCoreCpuFrequency(int* return_value) { LoggerD("Entered"); std::string freq; std::string file_name; - if(_is_emulator()) - file_name = "/proc/cpuinfo"; - else - file_name = "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq"; +#ifdef TIZEN_IS_EMULATOR + file_name = "/proc/cpuinfo"; +#else + file_name = "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq"; +#endif std::ifstream cpuinfo_freq(file_name); if (!cpuinfo_freq.is_open()) { @@ -612,24 +585,24 @@ PlatformResult SystemInfoDeviceCapability::GetPlatformCoreCpuFrequency(int* retu ("Failed to get cpu frequency")); } - if(_is_emulator()) { - //get frequency value from cpuinfo file - //example entry for frequency looks like below - //cpu MHz : 3392.046 - std::size_t found; - do { - getline(cpuinfo_freq, freq); - found = freq.find("cpu MHz"); - } while (std::string::npos == found && !cpuinfo_freq.eof()); - - found = freq.find(":"); - if (std::string::npos != found) { - *return_value = std::stoi(freq.substr(found + 2)); - } - } else { +#ifdef TIZEN_IS_EMULATOR + //get frequency value from cpuinfo file + //example entry for frequency looks like below + //cpu MHz : 3392.046 + std::size_t found; + do { getline(cpuinfo_freq, freq); - *return_value = std::stoi(freq) / 1000; // unit: MHz + found = freq.find("cpu MHz"); + } while (std::string::npos == found && !cpuinfo_freq.eof()); + + found = freq.find(":"); + if (std::string::npos != found) { + *return_value = std::stoi(freq.substr(found + 2)); } +#else + getline(cpuinfo_freq, freq); + *return_value = std::stoi(freq) / 1000; // unit: MHz +#endif cpuinfo_freq.close(); LoggerD("cpu frequency : %d", *return_value); diff --git a/src/systeminfo/systeminfo_properties_manager.cc b/src/systeminfo/systeminfo_properties_manager.cc index 955719b..8a5c6e4 100644 --- a/src/systeminfo/systeminfo_properties_manager.cc +++ b/src/systeminfo/systeminfo_properties_manager.cc @@ -32,7 +32,6 @@ #include "common/scope_exit.h" #include "systeminfo/systeminfo-utils.h" #include "common/filesystem/filesystem_provider.h" -#include "common/GDBus/connection.h" namespace extension { namespace systeminfo { @@ -47,11 +46,6 @@ const double kDisplayInchToMillimeter = 2.54; //Battery const double kRemainingBatteryChargeMax = 100.0; const int kVconfErrorNone = 0; -const char *kBatteryTarget = "org.tizen.resourced"; -const char *kBatteryObject = "/Org/Tizen/ResourceD/Logging"; -const char *kBatteryInterface = "org.tizen.resourced.logging"; -const char *kBatteryGetBatteryChargingTime = "GetBatteryChargingTime"; -const char *kBatteryGetBatteryRemainingTime = "GetBatteryRemainingTime"; //Display const double kDisplayBrightnessDivideValue = 100; //Device Orientation @@ -215,62 +209,7 @@ PlatformResult SysteminfoPropertiesManager::ReportBattery(picojson::object* out) ErrorCode::UNKNOWN_ERR, (log_msg + std::to_string(ret)), ("vconf_get_int error: %d (%s)", ret, get_error_message(ret))); } - bool isCharging = (0 != value); - out->insert(std::make_pair("isCharging", picojson::value(isCharging))); - - if (nullptr == common::dbus::Connection::getInstance().getDBus()) { - return LogAndCreateResult(ErrorCode::UNKNOWN_ERR, "dbus wasn't initialized"); - } - - GError* error = nullptr; - GVariant *variant = nullptr; - if (isCharging) { - variant = g_dbus_connection_call_sync(common::dbus::Connection::getInstance().getDBus(), - kBatteryTarget, - kBatteryObject, - kBatteryInterface, - kBatteryGetBatteryChargingTime, - g_variant_new("()"), - NULL, - G_DBUS_CALL_FLAGS_NONE, - -1, - NULL, - &error); - } else { - variant = g_dbus_connection_call_sync(common::dbus::Connection::getInstance().getDBus(), - kBatteryTarget, - kBatteryObject, - kBatteryInterface, - kBatteryGetBatteryRemainingTime, - g_variant_new("(i)", 0), // 0 - POWER_NORMAL_MODE - NULL, // 1 - POWER_SAVING_MODE - G_DBUS_CALL_FLAGS_NONE, // 2 - ULTRA_SAVING_MODE - -1, // for now, only 0 is supported - NULL, - &error); - } - - if (!variant || error) { - std::string message = error ? error->message : ""; - g_error_free(error); - return LogAndCreateResult( - ErrorCode::UNKNOWN_ERR, - "DBus returned error", - ("Failed to call %s method - %s", - isCharging ? "GetBatteryChargingTime" : "GetBatteryRemainingTime", message.c_str())); - } else { - int time = 0; - g_variant_get(variant, "(i)", &time); - g_variant_unref(variant); - if (isCharging) { - out->insert(std::make_pair("timeToFullCharge", picojson::value(static_cast(time)))); - out->insert(std::make_pair("timeToDischarge", picojson::value())); - } else { - out->insert(std::make_pair("timeToFullCharge", picojson::value())); - out->insert(std::make_pair("timeToDischarge", picojson::value(static_cast(time)))); - } - } - + out->insert(std::make_pair("isCharging", picojson::value(0 != value))); return PlatformResult(ErrorCode::NO_ERROR); } -- 2.7.4 From 68f4ee0e44acc108612a21b7252839f3165ff669 Mon Sep 17 00:00:00 2001 From: Szymon Jastrzebski Date: Fri, 19 May 2017 12:58:22 +0200 Subject: [PATCH 10/16] [SystemInfo] Throwing NOT_SUPPORTED_ERR added [Verification] TCT SystemInfo passed 100% (TM1, TW1, TV) Signed-off-by: Szymon Jastrzebski Change-Id: I30f56f7539be3baa59ec68fe75c357b4b26080e5 --- src/systeminfo/systeminfo_api.js | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/src/systeminfo/systeminfo_api.js b/src/systeminfo/systeminfo_api.js index e09c977..2e5dc4f 100644 --- a/src/systeminfo/systeminfo_api.js +++ b/src/systeminfo/systeminfo_api.js @@ -46,6 +46,17 @@ var SystemInfoPropertyId = { ADS : 'ADS' }; +var SystemInfoPropertyIdToFeature = { + BATTERY : 'http://tizen.org/feature/battery', + CAMERA_FLASH : 'http://tizen.org/feature/camera.back.flash', + CELLULAR_NETWORK : 'http://tizen.org/feature/network.telephony', + DISPLAY : 'http://tizen.org/feature/screen', + ETHERNET_NETWORK : 'http://tizen.org/feature/network.ethernet', + SIM : 'http://tizen.org/feature/network.telephony', + NET_PROXY_NETWORK : 'http://tizen.org/feature/network.net_proxy', + WIFI_NETWORK : 'http://tizen.org/feature/network.wifi' +}; + //class SystemInfoDeviceCapability //////////////////////////////////////////////////// function SystemInfoDeviceCapability(data) { Object.defineProperties(this, { @@ -790,6 +801,15 @@ var _createPropertyArray = function (property, data) { return propertyArray; }; +var _checkPropertySupported = function(property){ + if (SystemInfoPropertyIdToFeature[property]) { + var supported = tizen.systeminfo.getCapability(SystemInfoPropertyIdToFeature[property]); + if (!supported) { + return false; + } + } + return true; +}; var getPropertyFunction = function(cppLabel, objectCreateFunction) { return function() { @@ -818,6 +838,16 @@ var getPropertyFunction = function(cppLabel, objectCreateFunction) { if (!propObject) { throw new WebAPIException(WebAPIException.TYPE_MISMATCH_ERR, 'Property with id: ' + args.property + ' is not supported.'); } + + if (_checkPropertySupported(args.property) === false) { + setTimeout(function() { + native_.callIfPossible(args.errorCallback, + new WebAPIException(WebAPIException.NOT_SUPPORTED_ERR, + 'Property with id: ' + args.property + ' is not supported.')); + }, 0); + return; + } + var callback = function(result) { if (native_.isFailure(result)) { setTimeout(function() { @@ -1329,6 +1359,15 @@ var getListenerFunction = function (isArray) { } ]); + if (_checkPropertySupported(args.property) === false) { + setTimeout(function() { + native_.callIfPossible(args.errorCallback, + new WebAPIException(WebAPIException.NOT_SUPPORTED_ERR, + 'Property with id: ' + args.property + ' is not supported.')); + }, 0); + return; + } + var listener = { callback : args.successCallback, isArrayType : isArray, -- 2.7.4 From d246d13ce7ca0ee08e2731c3bd2c0e80dd7d09a5 Mon Sep 17 00:00:00 2001 From: Piotr Kosko Date: Wed, 24 May 2017 12:10:23 +0200 Subject: [PATCH 11/16] [version] 1.84 Change-Id: I96ee3646219e313a394cdf73595eaea57876aca6 --- packaging/webapi-plugins.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/webapi-plugins.spec b/packaging/webapi-plugins.spec index 48dd7ee..15e0d54 100644 --- a/packaging/webapi-plugins.spec +++ b/packaging/webapi-plugins.spec @@ -10,7 +10,7 @@ %define crosswalk_extensions_path %{_libdir}/%{crosswalk_extensions} Name: webapi-plugins -Version: 1.83 +Version: 1.84 Release: 0 License: Apache-2.0 and BSD-3-Clause and MIT Group: Development/Libraries -- 2.7.4 From bbf3bfdf07047b51b09038c612449aad562c4f58 Mon Sep 17 00:00:00 2001 From: Piotr Kosko Date: Thu, 25 May 2017 14:10:25 +0200 Subject: [PATCH 12/16] fixed setters of DownloadRequest [Verification] Code checked with chrome console. TCT passrate 100%. Change-Id: I7c9976efaf900452ee3da63fb13a3de1f0fa4466 Signed-off-by: Piotr Kosko --- src/download/download_api.js | 28 ++++++++++++++++++++++------ src/download/download_instance.cc | 10 ++++++---- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/src/download/download_api.js b/src/download/download_api.js index 8e5d9c1..331fcdc 100755 --- a/src/download/download_api.js +++ b/src/download/download_api.js @@ -19,6 +19,7 @@ var privUtils_ = xwalk.utils; var validator_ = xwalk.utils.validator; var types_ = validator_.Types; var check_ = xwalk.utils.type; +var converter_ = xwalk.utils.converter; var callbackId = 0; @@ -126,7 +127,10 @@ var DownloadNetworkType = { tizen.DownloadRequest = function(url, destination, fileName, networkType, httpHeader) { validator_.isConstructorCall(this, tizen.DownloadRequest); - var url_ = url; + var url_ = converter_.toString(url); + var destination_ = destination === undefined ? '' : converter_.toString(destination); + var fileName_ = fileName === undefined ? '' : converter_.toString(fileName); + var networkType_; if (networkType === undefined || !(networkType in DownloadNetworkType)) { @@ -143,19 +147,31 @@ tizen.DownloadRequest = function(url, destination, fileName, networkType, httpHe }, set: function(value) { if (value !== null) { - url_ = value; + url_ = converter_.toString(value); } }, }, 'destination': { - writable: true, enumerable: true, - value: destination === undefined ? '' : destination, + get: function() { + return destination_; + }, + set: function(value) { + if (value !== null) { + destination_ = converter_.toString(value); + } + }, }, 'fileName': { - writable: true, enumerable: true, - value: fileName === undefined ? '' : fileName, + get: function() { + return fileName_; + }, + set: function(value) { + if (value !== null) { + fileName_ = converter_.toString(value); + } + }, }, 'networkType': { enumerable: true, diff --git a/src/download/download_instance.cc b/src/download/download_instance.cc index 0950619..490c183 100755 --- a/src/download/download_instance.cc +++ b/src/download/download_instance.cc @@ -483,6 +483,7 @@ void DownloadInstance::DownloadManagerStart LoggerD("Entered"); CHECK_PRIVILEGE_ACCESS(kPrivilegeDownload, &out); CHECK_EXIST(args, "callbackId", out) + CHECK_EXIST(args, "url", out) int ret; std::string networkType; @@ -490,23 +491,24 @@ void DownloadInstance::DownloadManagerStart DownloadInfoPtr diPtr(new DownloadInfo); diPtr->callbackId = static_cast(args.get("callbackId").get()); - diPtr->url = args.get("url").get(); + diPtr->url = args.get("url").is() ? args.get("url").get() : ""; if (!args.get("destination").is()) { - if (args.get("destination").get() != "") { + if (args.get("destination").is() && args.get("destination").get() != "") { diPtr->destination = args.get("destination").get(); diPtr->destination = common::FilesystemProvider::Create().GetRealPath(diPtr->destination); } } if (!args.get("fileName").is()) { - if (args.get("fileName").get() != "") { + if (args.get("fileName").is() && args.get("fileName").get() != "") { diPtr->file_name = args.get("fileName").get(); } } if (!args.get("networkType").is()) { - networkType = args.get("networkType").get(); + networkType = args.get("networkType").is() ? + args.get("networkType").get() : "ALL"; } bool network_support = false; -- 2.7.4 From 333c20a255888ac638011e9b59089d1aeac576c9 Mon Sep 17 00:00:00 2001 From: Piotr Kosko Date: Wed, 31 May 2017 12:14:21 +0200 Subject: [PATCH 13/16] [version] 1.85 Change-Id: Ib8a70c3f450f4e96598b13f3018bb4bd37b74c1c --- packaging/webapi-plugins.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/webapi-plugins.spec b/packaging/webapi-plugins.spec index 15e0d54..8b2ca0d 100644 --- a/packaging/webapi-plugins.spec +++ b/packaging/webapi-plugins.spec @@ -10,7 +10,7 @@ %define crosswalk_extensions_path %{_libdir}/%{crosswalk_extensions} Name: webapi-plugins -Version: 1.84 +Version: 1.85 Release: 0 License: Apache-2.0 and BSD-3-Clause and MIT Group: Development/Libraries -- 2.7.4 From 6c88b38eca114e0c7a3ec38a046e996cfe40cc2b Mon Sep 17 00:00:00 2001 From: Szymon Jastrzebski Date: Mon, 5 Jun 2017 09:16:04 +0200 Subject: [PATCH 14/16] [Convergence] Disabling Convergence module HQ requested to remove Convergence API from Tizen 3.0. Change-Id: Ide749fe9bd2f23c1d0c845042d7530fe3146cafc --- packaging/webapi-plugins.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packaging/webapi-plugins.spec b/packaging/webapi-plugins.spec index 8b2ca0d..bf4febe 100644 --- a/packaging/webapi-plugins.spec +++ b/packaging/webapi-plugins.spec @@ -210,7 +210,7 @@ Source0: %{name}-%{version}.tar.gz %define tizen_feature_tvinputdevice_support 0 -%define tizen_feature_convergence_support 1 +%define tizen_feature_convergence_support 0 %endif # tizen_profile_mobile @@ -309,7 +309,7 @@ Source0: %{name}-%{version}.tar.gz %define tizen_feature_nbs_support 0 %endif -%define tizen_feature_convergence_support 1 +%define tizen_feature_convergence_support 0 %endif # tizen_profile_wearable @@ -367,7 +367,7 @@ Source0: %{name}-%{version}.tar.gz %define tizen_feature_wi_fi_support 1 %define tizen_feature_inputdevice_support 0 %define tizen_feature_tvinputdevice_support 1 -%define tizen_feature_convergence_support 1 +%define tizen_feature_convergence_support 0 %endif # tizen_profile_tv -- 2.7.4 From e309700d2c758ae19533a6691b867d763e02d5e7 Mon Sep 17 00:00:00 2001 From: Lukasz Bardeli Date: Fri, 2 Jun 2017 11:55:09 +0200 Subject: [PATCH 15/16] [Archive][Convergence][Sound] fix cppTest issue [verification] Code compiles without error Change-Id: Iee11cdaf9647103fa54ede1c00168413f747016b Signed-off-by: Lukasz Bardeli --- src/archive/un_zip_extract_request.cc | 2 +- src/convergence/convergence_service.cc | 6 ++++-- src/sound/sound_manager.cc | 3 +++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/archive/un_zip_extract_request.cc b/src/archive/un_zip_extract_request.cc index 8e6a11b..bd3f4d5 100644 --- a/src/archive/un_zip_extract_request.cc +++ b/src/archive/un_zip_extract_request.cc @@ -420,7 +420,7 @@ PlatformResult UnZipExtractRequest::handleFileEntry() ExtractAllProgressCallback* extract_callback = NULL; if(m_callback->getCallbackType() == EXTRACT_ALL_PROGRESS_CALLBACK || m_callback->getCallbackType() == EXTRACT_ENTRY_PROGRESS_CALLBACK) { - extract_callback = static_cast(m_callback); + extract_callback = dynamic_cast(m_callback); extract_callback->startedExtractingFile(m_file_info.uncompressed_size); } diff --git a/src/convergence/convergence_service.cc b/src/convergence/convergence_service.cc index 29992d7..e875ead 100644 --- a/src/convergence/convergence_service.cc +++ b/src/convergence/convergence_service.cc @@ -40,7 +40,8 @@ ConvergenceService::ConvergenceService() : convergence_plugin_(nullptr) , device_(nullptr) , type_(CONV_SERVICE_NONE) - , service_handle_(nullptr) { + , service_handle_(nullptr) + , connection_state_(CONV_SERVICE_CONNECTION_STATE_NONE) { ScopeLogger(); } @@ -48,7 +49,8 @@ ConvergenceService::ConvergenceService(conv_device_h device, conv_service_e type : convergence_plugin_(convergence_plugin) , device_(device) , type_(type) - , service_handle_(nullptr) { + , service_handle_(nullptr) + , connection_state_(CONV_SERVICE_CONNECTION_STATE_NONE) { ScopeLogger(); } diff --git a/src/sound/sound_manager.cc b/src/sound/sound_manager.cc index b71dfb5..a55a3a7 100644 --- a/src/sound/sound_manager.cc +++ b/src/sound/sound_manager.cc @@ -124,8 +124,11 @@ std::string SoundManager::SoundIOTypeToString(sound_device_io_direction_e type) SoundManager::SoundManager(SoundInstance& instance) : is_volume_change_listener_(false), + volume_change_listener_id_(0), soundModeChangeListening(false), is_sound_device_change_listener_(false), + sound_device_connection_listener_id_(0), + sound_device_state_listener_id_(0), instance_(instance), soundModeListener(nullptr) { FillMaxVolumeMap(); -- 2.7.4 From 25eb5e1c6749cabdc8902742c072519486d5eeac Mon Sep 17 00:00:00 2001 From: Lukasz Bardeli Date: Wed, 7 Jun 2017 08:27:26 +0200 Subject: [PATCH 16/16] [Archive] checking if dynamic_cast succeeded [Verification] Code compiles without error Change-Id: Id48b95aaea1d69573a1e50acaa12304b338b8ef8 --- src/archive/un_zip_extract_request.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/archive/un_zip_extract_request.cc b/src/archive/un_zip_extract_request.cc index bd3f4d5..12ca6de 100644 --- a/src/archive/un_zip_extract_request.cc +++ b/src/archive/un_zip_extract_request.cc @@ -421,6 +421,10 @@ PlatformResult UnZipExtractRequest::handleFileEntry() if(m_callback->getCallbackType() == EXTRACT_ALL_PROGRESS_CALLBACK || m_callback->getCallbackType() == EXTRACT_ENTRY_PROGRESS_CALLBACK) { extract_callback = dynamic_cast(m_callback); + if( NULL == extract_callback) { + SLoggerE("extract_callback is null"); + return LogAndCreateResult(ErrorCode::UNKNOWN_ERR, "Could not create extracted file"); + } extract_callback->startedExtractingFile(m_file_info.uncompressed_size); } -- 2.7.4