platform/core/api/webapi-plugins.git
3 years ago[ML] Fixed logger type with macro 85/252785/1 accepted/tizen/unified/20210208.134816 submit/tizen/20210202.085424
Piotr Kosko/Native/Web API (PLT) /SRPOL/Engineer/Samsung Electronics [Tue, 2 Feb 2021 07:43:47 +0000 (08:43 +0100)]
[ML] Fixed logger type with macro

For some architectures int64_t is not casted to lld, for partablitiy
stackoverflow suggests using macro.

[Verification] Code compiles for aarch64 architecture

Change-Id: I7aaa3dabeacae6ea7b212c09c5070ff011c64ab1

3 years agoMerge "[systeminfo] Prevent possible crash when failure initialization" into tizen submit/tizen/20210202.064821
Piotr Kosko [Mon, 1 Feb 2021 07:33:51 +0000 (07:33 +0000)]
Merge "[systeminfo] Prevent possible crash when failure initialization" into tizen

3 years ago[systeminfo] Prevent possible crash when failure initialization 58/252658/1
Piotr Kosko/Native/Web API (PLT) /SRPOL/Engineer/Samsung Electronics [Mon, 1 Feb 2021 06:48:15 +0000 (07:48 +0100)]
[systeminfo] Prevent possible crash when failure initialization

SVACE: 456450

[verification] Code compiles without errors

Change-Id: I0b2f0c0c8d27ff0cc6edf3099f7ec77a2d825c7c

3 years ago[ML][Common] Add TensorRawData and size/location validation on JS side 82/252482/2
Rafal Walczyna [Thu, 28 Jan 2021 16:35:08 +0000 (17:35 +0100)]
[ML][Common] Add TensorRawData and size/location validation on JS side

C++ validation will be added in future commit

Test code:
var ti = new tizen.ml.TensorsInfo();
ti.addTensorInfo("tensor1", "UINT8", [1, 1])
ti.addTensorInfo("tensor2", "INT16", [2, 4])
ti.addTensorInfo("tensor3", "FLOAT32", [2, 2])
var td = ti.getTensorsData();
console.log(td.getTensorRawData(0))
console.log(td.getTensorRawData(1))
console.log(td.getTensorRawData(2))

[Verification] Built successful. Tested in Chrome Dev console.

Change-Id: I14caa9a91b04ed2664cca241da54977a711b1abd
Signed-off-by: Rafal Walczyna <r.walczyna@samsung.com>
3 years ago[ML][Common] Add TensorsData.setTensorRawData method 90/252290/5
Rafal Walczyna [Mon, 25 Jan 2021 14:31:38 +0000 (15:31 +0100)]
[ML][Common] Add TensorsData.setTensorRawData method

ACR: TWDAPI-273

Test code:
var ti = new tizen.ml.TensorsInfo();
ti.addTensorInfo("tensor1", "UINT8", [1, 1])
var td = ti.getTensorsData();
console.log(td.getTensorRawData(0));
td.setTensorRawData(0, [13]);
console.log(td.getTensorRawData(0));

[Verification] Built successful. Tested in Chrome Dev console.

Change-Id: I522112df9a69f1a5ec7bbcbc12094296a11ec1c9
Signed-off-by: Rafal Walczyna <r.walczyna@samsung.com>
3 years ago[ML][Common] Add TensorsData.getTensorRawData method 89/252289/5
Rafal Walczyna [Mon, 25 Jan 2021 14:51:40 +0000 (15:51 +0100)]
[ML][Common] Add TensorsData.getTensorRawData method

ACR: TWDAPI-273

Test code:
var ti = new tizen.ml.TensorsInfo();
var types = ["INT8", "INT16", "INT32", "INT64", "UINT8", "UINT16",
             "UINT32", "UINT64", "FLOAT32", "FLOAT64" ]
types.forEach((t) => {
    ti.addTensorInfo("", t, [3, 3, 2]);
})
var td = ti.getTensorsData();
for(var i = 0; i < 10; i++) {
    console.log(td.getTensorRawData(i));
}

[Verification] Built successful. Tested in Chrome Dev console.

Change-Id: Ia3772b7488d48a593f03dcd158ee66092633d886
Signed-off-by: Rafal Walczyna <r.walczyna@samsung.com>
3 years ago[ML][pipeline] implement Valve::{setOpen, isOpen} 95/251995/7
Pawel Wasowski [Thu, 21 Jan 2021 09:19:14 +0000 (10:19 +0100)]
[ML][pipeline] implement Valve::{setOpen, isOpen}

ACR: TWDAPI-274

[Verification] Tested in Chrome DevTools with the snippets below, works
fine.

var pipeline_def = "videotestsrc is-live=true ! videoconvert ! videoscale"
                   + " ! video/x-raw,format=RGBx,width=16,height=16,framerate=10/1"
                   + " ! tensor_converter ! valve name=valve1 ! fakesink";

var pipeline = tizen.ml.pipeline.createPipeline(pipeline_def,
                                      function(state) {console.log(state);});
// READY
// PAUSED

var v = pipeline.getValve('valve1')
// Valve {name: "valve1", _pipeline_id: 1}

v.isOpen
// true

pipeline.isOpen = false
v.isOpen
// true

v.setOpen(false)
v.isOpen
// false

Change-Id: Ibdeaba23082356b5143c2a1796bbd181b4d5d027
Signed-off-by: Pawel Wasowski <p.wasowski2@samsung.com>
3 years agoMerge "[ML][Pipeline] GetSource implementation" into tizen
Piotr Kosko [Fri, 29 Jan 2021 07:42:50 +0000 (07:42 +0000)]
Merge "[ML][Pipeline] GetSource implementation" into tizen

3 years ago[Common] Fixed invalid parsing of decimal values 62/252462/1 submit/tizen/20210128.113801
Piotr Kosko/Native/Web API (PLT) /SRPOL/Engineer/Samsung Electronics [Thu, 28 Jan 2021 09:57:03 +0000 (10:57 +0100)]
[Common] Fixed invalid parsing of decimal values

[Bug] Decimal values fails to parse properly when locale of device
was e.g. Deutsch

[Verification]
//Below code works well for locales: English, Deutsch, Francais
// sound values are changing and show aproximately same values
// (depending on platform adjustments)

tizen.sound.setVolume("MEDIA", 0.1);
console.log(tizen.sound.getVolume("MEDIA"))
>> 0.13

Change-Id: Icde211bcfcc66cf0d66852816d2a00907adf4571

3 years ago[ML][Pipeline] GetSource implementation 39/252339/3
Lukasz Bardeli [Tue, 26 Jan 2021 12:56:06 +0000 (13:56 +0100)]
[ML][Pipeline] GetSource implementation

ACR: TWDAPI-274

[Verification] Code compiles without error. Tested in chrome console.

var pipeline = tizen.ml.pipeline.createPipeline("appsrc name=appsrc ! other/tensor,dimension=(string)4:1:1:1, type=(string)uint8,framerate=(fraction)0/1 ! tensor_if name=tif compared-value=CUSTOM compared-value-option=tif_custom_cb_name ")
var source = pipeline.getSource("appsrc")
var tensor = source.inputTensorsInfo

Change-Id: I3c09d2f91758c19e82ade9e6e5237ddc0a8ef76e
Signed-off-by: Lukasz Bardeli <l.bardeli@samsung.com>
3 years ago[ML][Single] Implemented SingleShot.input member - set 85/252085/5
Piotr Kosko/Native/Web API (PLT) /SRPOL/Engineer/Samsung Electronics [Mon, 25 Jan 2021 13:14:43 +0000 (14:14 +0100)]
[ML][Single] Implemented SingleShot.input member - set

* added set feature for SingleShot.input
* added single gathering of SingleShot.input and output (wihout checking native layer every time)

[ACR] https://code.sec.samsung.net/jira/browse/TWDAPI-273

[Verification] Code compiles without errors.
Checked in Chrome console:
var model = tizen.ml.single.openModel("documents/mobilenet_v1_1.0_224_quant.tflite")
model.input
> TensorsInfo {_previouslyConstructed: true, _id: 1}

var newTI = new tizen.ml.TensorsInfo()
newTI.addTensorInfo("input", "UINT8", [3,224,224,1])
model.input = newTI;
model.input
> TensorsInfo {_previouslyConstructed: true, _id: 2}

/// calling getter multiple times return always the same TensorsInfo

Change-Id: I16c33a0ba515aba1efe2f5d93d0d3225b410aced

3 years agoMerge "[ML][Single] Implemented SingleShot.output member - get" into tizen
Piotr Kosko [Tue, 26 Jan 2021 12:40:15 +0000 (12:40 +0000)]
Merge "[ML][Single] Implemented SingleShot.output member - get" into tizen

3 years agoMerge changes I9997467b,Id480d20c into tizen
Piotr Kosko [Tue, 26 Jan 2021 08:12:03 +0000 (08:12 +0000)]
Merge changes I9997467b,Id480d20c into tizen

* changes:
  [ML][Common] Add TensorsData.dispose method
  [ML][Common] Add TensorsInfo.getTensorsData and TensorsData

3 years ago[ML][Common] Add TensorsData.dispose method 02/252002/4
Rafal Walczyna [Wed, 20 Jan 2021 13:19:15 +0000 (14:19 +0100)]
[ML][Common] Add TensorsData.dispose method

ACR: TWDAPI-273

Test code:
var ti = new tizen.ml.TensorsInfo();
ti.addTensorInfo("tensor1", "UINT8", [1, 1])
ti.addTensorInfo("tensor2", "UINT8", [2, 4])
var td = ti.getTensorsData();
console.log(td.count)
td.dispose();
console.log(td.count)

[Verification] Built successful. Tested in Chrome Dev console.

Change-Id: I9997467b36908d6e031473e58e2b3defbf253e00
Signed-off-by: Rafal Walczyna <r.walczyna@samsung.com>
3 years ago[ML][Common] Add TensorsInfo.getTensorsData and TensorsData 01/252001/3
Rafal Walczyna [Wed, 20 Jan 2021 10:28:50 +0000 (11:28 +0100)]
[ML][Common] Add TensorsInfo.getTensorsData and TensorsData

ACR: TWDAPI-273

Test code:
var ti = new tizen.ml.TensorsInfo();
ti.addTensorInfo("tensor1", "UINT8", [1, 1])
ti.addTensorInfo("tensor2", "UINT8", [2, 4])
var td = ti.getTensorsData();
console.log(td.count)

Verification: Built successful. Tested in Chrome Dev console.

Change-Id: Id480d20c1a32d03113c6dbc73cbd81938a98931f
Signed-off-by: Rafal Walczyna <r.walczyna@samsung.com>
3 years ago[ML][Pipeline] Implementation setProperty and getProperty 97/251897/8
Lukasz Bardeli [Wed, 20 Jan 2021 12:48:43 +0000 (13:48 +0100)]
[ML][Pipeline] Implementation setProperty and getProperty

ACR: TWDAPI-274

[Verification] Code compiles without error. Tested in chrome console.

// test code
var pipeline = tizen.ml.pipeline.createPipeline("videotestsrc name=vsrc is-live=true ! videoconvert ! videoscale name=vscale ! video/x-raw,format=RGBx,width=224,height=224,framerate=60/1 ! tensor_converter ! valve name=valvex ! input-selector name=is01 ! tensor_sink name=sinkx")

//BOOLEAN
var nodeinfo_bool = pipeline.getNodeInfo("is01")

nodeinfo_bool.setProperty("sync-streams", "BOOLEAN", true)
nodeinfo_bool.getProperty("sync-streams", "BOOLEAN")
nodeinfo_bool.setProperty("sync-streams", "BOOLEAN", false)
nodeinfo_bool.getProperty("sync-streams", "BOOLEAN")

//DOUBLE
var nodeinfo_double = pipeline.getNodeInfo("vscale")
nodeinfo_double.setProperty("sharpness", "DOUBLE", 0.72)
nodeinfo_double.getProperty("sharpness", "DOUBLE")

//INT32
var nodeinfo_int32 = pipeline.getNodeInfo("vsrc")
nodeinfo_int32.setProperty("kx", "INT32", 10)
nodeinfo_int32.getProperty("kx", "INT32")

//UINT32
var nodeinfo_uint32 = pipeline.getNodeInfo("vsrc")
nodeinfo_uint32.setProperty("foreground-color", "UINT32", 123456)
nodeinfo_uint32.getProperty("foreground-color", "UINT32")

//INT64
var nodeinfo_int64 = pipeline.getNodeInfo("vsrc")
nodeinfo_int64.setProperty("timestamp-offset", "INT64", 10)
nodeinfo_int64.getProperty("timestamp-offset", "INT64")

//UINT64
var pipeline_uint64 = tizen.ml.pipeline.createPipeline("udpsrc name=usrc port=5555 caps=application/x-rtp ! queue ! fakesink")

var nodeinfo_uint64 = pipeline_uint64.getNodeInfo("usrc")
nodeinfo_uint64.setProperty("timeout", "UINT64", 166513216516510)
nodeinfo_uint64.getProperty("timeout", "UINT64")

//STRING
var pipeline_string = tizen.ml.pipeline.createPipeline("videotestsrc ! video/x-raw,format=RGB,width=640,height=480 ! videorate max-rate=1 ! tensor_converter ! tensor_mux ! tensor_demux name=demux ! tensor_sink")

var nodeinfo_string = pipeline_string.getNodeInfo("demux")
nodeinfo_string.setProperty("tensorpick", "STRING", "1,2")
nodeinfo_string.getProperty("tensorpick", "STRING")

// ENUM
var vscale_enum = {
  GST_VIDEO_SCALE_NEAREST:0,
  GST_VIDEO_SCALE_BILINEAR:1,
  GST_VIDEO_SCALE_4TAP:2,
  GST_VIDEO_SCALE_LANCZOS:3
}

var pipeline_enum = tizen.ml.pipeline.createPipeline("videotestsrc name=vsrc is-live=true ! videoconvert ! videoscale name=vscale ! video/x-raw,format=RGBx,width=224,height=224,framerate=60/1 ! tensor_converter ! valve name=valvex ! input-selector name=is01 ! tensor_sink name=sinkx")

var nodeinfo_enum = pipeline_enum.getNodeInfo("vscale")
nodeinfo_enum.setProperty("method", "ENUM", vscale_enum.GST_VIDEO_SCALE_4TAP)
nodeinfo_enum.getProperty("method", "ENUM")

Change-Id: I90f9a3986beeb6a071ce4b265965eec399679c55
Signed-off-by: Lukasz Bardeli <l.bardeli@samsung.com>
3 years ago[ML][Single] Implemented SingleShot.output member - get 64/252064/4
Piotr Kosko/Native/Web API (PLT) /SRPOL/Engineer/Samsung Electronics [Fri, 22 Jan 2021 07:27:53 +0000 (08:27 +0100)]
[ML][Single] Implemented SingleShot.output member - get

[ACR] https://code.sec.samsung.net/jira/browse/TWDAPI-273

[Verification] Code compiles without errors.
Checked in Chrome console:
// open model
var model = tizen.ml.single.openModel("documents/mobilenet_v1_1.0_224_quant.tflite")
// below works well
model.input.getDimensions(0)
model.output.getDimensions(0)

Change-Id: I43120610873a455eb813bb02db9c3eeff7a02e91

3 years ago[ML][Single] Implemented SingleShot.input member - get 51/252051/2
Piotr Kosko/Native/Web API (PLT) /SRPOL/Engineer/Samsung Electronics [Thu, 21 Jan 2021 12:09:41 +0000 (13:09 +0100)]
[ML][Single] Implemented SingleShot.input member - get

[ACR] https://code.sec.samsung.net/jira/browse/TWDAPI-273

[Verification] Code compiles without errors.
Checked in Chrome console:
// open model
var model = tizen.ml.single.openModel("documents/mobilenet_v1_1.0_224_quant.tflite")
// all implemented members of input work
model.input.getDimensions(0)

Change-Id: I132d5e6262f7142c8040c7f40f69f11a1ef63827

3 years agoMerge "[ML][pipeline] Implement Pipeline::getValve()" into tizen
Piotr Kosko [Mon, 25 Jan 2021 10:10:06 +0000 (10:10 +0000)]
Merge "[ML][pipeline] Implement Pipeline::getValve()" into tizen

3 years agoMerge "[ML][Single] Added manager file and implementation for openModel()" into tizen
Piotr Kosko [Mon, 25 Jan 2021 10:05:57 +0000 (10:05 +0000)]
Merge "[ML][Single] Added manager file and implementation for openModel()" into tizen

3 years ago[ML][Single] Added manager file and implementation for openModel() 93/251893/7
Piotr Kosko/Native/Web API (PLT) /SRPOL/Engineer/Samsung Electronics [Wed, 20 Jan 2021 10:55:36 +0000 (11:55 +0100)]
[ML][Single] Added manager file and implementation for openModel()

[ACR] https://code.sec.samsung.net/jira/browse/TWDAPI-273

[Verification] Code compiles without errors.
Checked in chrome console with few calls:
Success calls:
tizen.ml.single.openModel("documents/mobilenet_v1_1.0_224_quant.tflite")
tizen.ml.single.openModel("documents/mobilenet_v1_1.0_224_quant.tflite", null, null, "TENSORFLOW_LITE")
tizen.ml.single.openModel("documents/mobilenet_v1_1.0_224_quant.tflite", null, null, "TENSORFLOW_LITE", "ANY", true)

Fail for invalid or not-existing file:
tizen.ml.single.openModel("documents/fail.tflite") // Abort Error
tizen.ml.single.openModel("documents/notexisting") // NotFound
tizen.ml.single.openModel("notexisting") // NotFound

Change-Id: I8b2b89e60d8f265185d3ddcafcc224f4e5c15fa1

3 years agoMerge "[ML][pipeline] Implement Switch::{getPadList, select}" into tizen
Piotr Kosko [Fri, 22 Jan 2021 13:19:01 +0000 (13:19 +0000)]
Merge "[ML][pipeline] Implement Switch::{getPadList, select}" into tizen

3 years ago[ML][pipeline] Implement Pipeline::getValve() 02/251902/5
Pawel Wasowski [Wed, 20 Jan 2021 15:49:03 +0000 (16:49 +0100)]
[ML][pipeline] Implement Pipeline::getValve()

ACR: TWDAPI-274

[Verification] Tested in Chrome DevTools with the below snippets, works
fine.

var pipeline_def = "videotestsrc is-live=true ! videoconvert ! videoscale"
                   + " ! video/x-raw,format=RGBx,width=16,height=16,framerate=10/1"
                   + " ! tensor_converter ! valve name=valve1 ! fakesink";

var pipeline = tizen.ml.pipeline.createPipeline(pipeline_def,
                                      function(state) {console.log(state);});

pipeline.getValve('valve1')
// alve {name: "valve1", _pipeline_id: 1}

pipeline.getValve('valve_XXX')
// WebAPIException {code: 0, name: "InvalidValuesError", ...

pipeline.getValve()
// WebAPIException {code: 0, name: "InvalidValuesError", ...

Change-Id: Id11414f80c42a9879532dfc1c651f766c4f12834
Signed-off-by: Pawel Wasowski <p.wasowski2@samsung.com>
3 years agoMerge "[ML][Common] Add support for creating TensorsInfo from native handle" into...
Piotr Kosko [Thu, 21 Jan 2021 09:34:58 +0000 (09:34 +0000)]
Merge "[ML][Common] Add support for creating TensorsInfo from native handle" into tizen

3 years ago[Common] Moved convertUriToPath to common::tools 00/251900/3
Piotr Kosko/Native/Web API (PLT) /SRPOL/Engineer/Samsung Electronics [Wed, 20 Jan 2021 13:29:50 +0000 (14:29 +0100)]
[Common] Moved convertUriToPath to common::tools

convertingUriToPath is used in few modules and usage of one version
of this function will be beneficial.

[Verification] TCT exif, package, metadata 100% pass.

Change-Id: Ifbca0fa3a83de0757faa30b214e4b298c4678789

3 years ago[ML][Common] Add support for creating TensorsInfo from native handle 96/251896/2
Rafal Walczyna [Wed, 20 Jan 2021 11:49:15 +0000 (12:49 +0100)]
[ML][Common] Add support for creating TensorsInfo from native handle

ACR: TWDAPI-273

Some of the ml native functions require not initialized handle.
TensorsInfo::CreateTensorsInfo() uses ml_tensors_info_create which allocates
memory for tensors info - but i.e. ml_single_get_input_info allocates memory
again without freeing old handle.

[Verification] Builts successfully, TensorsInfo.count tested in Chrome dev console.

Change-Id: I6b2e9c60dbed23a2d1962e68cc9408a8faecb383
Signed-off-by: Rafal Walczyna <r.walczyna@samsung.com>
3 years ago[ML] Added placeholders for further development 76/251876/3
Piotr Kosko/Native/Web API (PLT) /SRPOL/Engineer/Samsung Electronics [Wed, 20 Jan 2021 07:39:32 +0000 (08:39 +0100)]
[ML] Added placeholders for further development

[Verification] Code compiles without errors

Change-Id: I2b69891c596e31ae87fb519b60aa3811e949c5d5

3 years ago[Datacontrol] Prevent crashes by purging code with undefined behavior 34/251834/3
Pawel Wasowski [Tue, 19 Jan 2021 01:36:44 +0000 (02:36 +0100)]
[Datacontrol] Prevent crashes by purging code with undefined behavior

The following line caused crashes:

IdMap[info->requestId] = info.release();

Argument evaluation order was not strictly defined in C++
before C++17 - behavior of the expression above was undefined.
C++17 introduced more strict rules and their implementation in GCC
caused a crash after setting -std=c++17 - it seems, that info.release()
would be now called before info->requestId.

[Verification] tct-datacontrol-tizen-tests (auto, c++14 and c++17 build):
100% pass rate

The snippet below crashed apps 100% times when webapi-plugins were
compiled with C++17. Now, the snippet works fine

var PROVIDER_ID =
        "http://tizen.org/datacontrol/provider/DictionaryDataControlProvider";
var DATA_ID = "Dictionary";
var TYPE_SQL = "SQL";
var TYPE_MAP = "MAP";

var globalDataControl = tizen.datacontrol.getDataControlConsumer(PROVIDER_ID,
                                                                 DATA_ID,
                                                                 TYPE_MAP);
function successcb(id) {
  console.log("Ok: reqid " + id);
}

function errorcb(id, error) {
  console.log("Error id: " + id + ", error msg: " + error.message);
}

try {
  globalDataControl.addValue(123, "tizen", "Foo", successcb, errorcb);
}
catch (err)
{
  console.log(err.name + ": " + err.message);
}

Change-Id: Ibd80f60d100a616b8a9607c27e9eebf8a64e7a10

3 years ago[mediacontroller] Prevent undefined behavior 25/251825/3
Pawel Wasowski [Mon, 18 Jan 2021 21:11:55 +0000 (22:11 +0100)]
[mediacontroller] Prevent undefined behavior

Constructing a std::string from nullptr is undefined behavior and
caused an exception after setting std=c++17 flag in GCC
(no exception was thrown when compiling with std=c++14).
This commit removes the UB.

The problem caused MediaControllerServerInfo_iconURI_attribute test
from tct-mediacontroller-tizen-tests failures.

[Verification] auto tct-mediacontroller-tizen-tests
1. with std=c++14: 100% pass rate
2. with std=c++17: 100% pass rate

Change-Id: I4857e3d9f8ba2940b50223e89ff952625ba37b3c
Signed-off-by: Pawel Wasowski <p.wasowski2@samsung.com>
3 years ago[common] Add std::exception handler to ParsedInstance 19/251819/3
Pawel Wasowski [Mon, 18 Jan 2021 19:35:14 +0000 (20:35 +0100)]
[common] Add std::exception handler to ParsedInstance

When an exception derived from std::exception and not PlatformException
is thrown in webapi-plugins code, only the following error message was
logged:

HandleException(393) > Exception: Unknown exception

As std::exception inheritance is a very common practice, especially in
standard library, we add logging std::exception::what() message to make
debugging easier.

[Verification] An exception thrown from std::string is caught and its
what() message is logged properly.

Change-Id: I879ebe80b609cf26a7e68be822a783aa9ef145eb
Signed-off-by: Pawel Wasowski <p.wasowski2@samsung.com>
3 years ago[ML][Common] Add TensorsInfo.getTensorSize 99/251699/2
Rafal Walczyna [Mon, 18 Jan 2021 14:19:54 +0000 (15:19 +0100)]
[ML][Common] Add TensorsInfo.getTensorSize

ACR: TWDAPI-273

Test code:
var ti = new tizen.ml.TensorsInfo();
ti.addTensorInfo("tensor1", "UINT8", [1, 1])
console.log(ti.getTensorSize(0))
ti.addTensorInfo("tensor2", "UINT8", [2, 3, 4])
console.log(ti.getTensorSize(1))
ti.addTensorInfo("tensor2", "FLOAT32", [2, 3, 4])
console.log(ti.getTensorSize(2))
console.log(ti.getTensorSize(-1))

[Verification] Built successful. Tested in Chrome Dev console.

Change-Id: I841da30d03a0590cea66ec6217130163a87f59ec
Signed-off-by: Rafal Walczyna <r.walczyna@samsung.com>
3 years ago[ML][Common] Add TensorsInfo.dispose method 16/251616/3
Rafal Walczyna [Fri, 15 Jan 2021 11:56:20 +0000 (12:56 +0100)]
[ML][Common] Add TensorsInfo.dispose method

ACR: TWDAPI-273

Test code:
var ti = new tizen.ml.TensorsInfo();
ti.addTensorInfo("tensor1", "UINT8", [1, 1])
ti.getTensorName(0)
ti.dispose()
ti.getTensorName(0)

[Verification] Built successful. Tested in Chrome Dev console.

Change-Id: Icae3447ea266de67404f05e23a5d157e5f899ee9
Signed-off-by: Rafal Walczyna <r.walczyna@samsung.com>
3 years ago[ML][Common] Add TensorsInfo.clone and TensorsInfo.equals 24/251524/4
Rafal Walczyna [Thu, 14 Jan 2021 12:13:12 +0000 (13:13 +0100)]
[ML][Common] Add TensorsInfo.clone and TensorsInfo.equals

ACR: TWDAPI-273

Test code:
var ti = new tizen.ml.TensorsInfo();
ti.addTensorInfo("tensor1", "UINT8", [1, 1])
var ti2 = ti.clone();
console.log(ti.equals(ti2))
ti2.setTensorName(0, "different")
console.log(ti.equals(ti2))
ti2.setTensorType(0, "INT8")
console.log(ti.equals(ti2))

[Verification] Built successful, tested in Chrome Dev console.

Change-Id: I30d9b1b73ab97735b6ecfaf1a408b6561912808d
Signed-off-by: Rafal Walczyna <r.walczyna@samsung.com>
3 years ago[ML][Common] Add TensorsInfo getters / setters 35/251435/9
Rafal Walczyna [Wed, 13 Jan 2021 12:52:21 +0000 (13:52 +0100)]
[ML][Common] Add TensorsInfo getters / setters

ACR: TWDAPI-273

Methods added:
TensorsInfo.getTensorName
TensorsInfo.setTensorName
TensorsInfo.getTensorType
TensorsInfo.setTensorType
TensorsInfo.getDimensions
TensorsInfo.setDimensions

Test code:

var ti = new tizen.ml.TensorsInfo();
ti.addTensorInfo("tensor1", "UINT8", [1, 1])
console.log(ti.getTensorName(0));
ti.setTensorName(0, "changedName");
console.log(ti.getTensorName(0));
console.log(ti.getTensorType(0));
ti.setTensorType(0, "INT8");
console.log(ti.getTensorType(0));
console.log(ti.getDimensions(0));
ti.setDimensions(0, [2,4]);
console.log(ti.getDimensions(0));

[Verification] Built successful, tested in Chrome Dev console.

Change-Id: I197072bfbc48812fd44a00cfaceb09ee8928f1a1
Signed-off-by: Rafal Walczyna <r.walczyna@samsung.com>
3 years ago[ML][Common] Add TensorsInfo constructor and TensorsInfo::addTensorInfo 58/251158/10
Rafal Walczyna [Fri, 8 Jan 2021 15:40:47 +0000 (16:40 +0100)]
[ML][Common] Add TensorsInfo constructor and TensorsInfo::addTensorInfo

ACR: TWDAPI-273

Added:
- TensorsInfo constructor
- TensorsInfo::addTensorInfo method
- TensorsInfo::count property

Test code:
var ti = new tizen.ml.TensorsInfo();
console.log(ti.count)
ti.addTensorInfo(null, "UINT8", [1, 1])
console.log(ti.count)
console.log(JSON.stringify(ti))

[Verification] Built successful, tested in Chrome Dev console

Change-Id: Ic194d71439e4c4ce30b9722de031e9312c1c8183
Signed-off-by: Rafal Walczyna <r.walczyna@samsung.com>
3 years ago[ML][Common] Add MLTensorsInfoManager 57/251157/8
Rafal Walczyna [Fri, 8 Jan 2021 15:39:37 +0000 (16:39 +0100)]
[ML][Common] Add MLTensorsInfoManager

ACR: TWDAPI-273

[Verification] Built successful

Change-Id: I85a0fdcbcbc42ddcce406d5c6ae5a428536d4ce7
Signed-off-by: Rafal Walczyna <r.walczyna@samsung.com>
3 years ago[ML][pipeline] Implement Switch::{getPadList, select} 12/251612/6
Pawel Wasowski [Tue, 12 Jan 2021 17:03:25 +0000 (18:03 +0100)]
[ML][pipeline] Implement Switch::{getPadList, select}

ACR: TWDAPI-274

[Verification] Tested in Chrome DevTools with the snippets below, works
fine.

var pipeline_def = "videotestsrc is-live=true"
                   + " ! videoconvert"
                   + " ! tensor_converter"
                   + " ! output-selector name=outs outs.src_0"
                   + " ! tensor_sink name=sink0 async=false outs.src_1"
                   + " ! tensor_sink name=sink1 async=false"

var pipeline = tizen.ml.pipeline.createPipeline(pipeline_def,
                                      function(state) {console.log(state);});

pipeline.getSwitch('outs').getPadList()
// ["src_0", "src_1"]

pipeline.getSwitch('outs').select('src_1')
// dlog: I/nnstreamer( 4274): Switched to [src_1] successfully at switch [outs].

pipeline.getSwitch('outs').select('src_3')
// WebAPIException: InvalidValuesError

pipeline.getSwitch('outs').select()
// WebAPIException: InvalidValuesError

Change-Id: I992e17841a8f8bec19aa60383e9d3ad0baf62975
Signed-off-by: Pawel Wasowski <p.wasowski2@samsung.com>
3 years ago[ML][pipeline] Implement Pipeline::getSwitch() 75/251075/11
Pawel Wasowski [Tue, 12 Jan 2021 15:38:43 +0000 (16:38 +0100)]
[ML][pipeline] Implement Pipeline::getSwitch()

ACR: TWDAPI-274

[Verification] Code tested in Chrome DevTools with below snippets works
fine

var pipeline_def = "videotestsrc is-live=true"
                   + " ! videoconvert"
                   + " ! tensor_converter"
                   + " ! output-selector name=outs outs.src_0"
                   + " ! tensor_sink name=sink0 async=false outs.src_1"
                   + " ! tensor_sink name=sink1 async=false"

var pipeline = tizen.ml.pipeline.createPipeline(pipeline_def, function(state) {console.log(state);})

pipeline.getSwitch('outs')
// Switch {name: "outs", type: "OUTPUT_SELECTOR", _pipeline_id: 3}

pipeline.getSwitch('non existent switch')
//  VM31:1 Uncaught WebAPIException {code: 0, name: "InvalidValuesError"

Change-Id: Ia7d6838b5e49072c35f0b796151c436d4a3b60e1
Signed-off-by: Pawel Wasowski <p.wasowski2@samsung.com>
3 years agoMerge "[ML][common] Add tizen.ml.checkNNFWAvailability method" into tizen
Piotr Kosko [Tue, 19 Jan 2021 06:16:30 +0000 (06:16 +0000)]
Merge "[ML][common] Add tizen.ml.checkNNFWAvailability method" into tizen

3 years ago[ML][Pipeline] Implement getNodeInfo 06/251306/5
Lukasz Bardeli [Tue, 12 Jan 2021 09:24:45 +0000 (10:24 +0100)]
[ML][Pipeline] Implement getNodeInfo

ACR: TWDAPI-274

[Verification] Code compiles without error. Tested in chrome console

var pipeline = tizen.ml.pipeline.createPipeline("videotestsrc ! video/x-raw,format=RGB,width=640,height=480 ! videorate max-rate=1 ! tensor_converter ! tensor_mux ! tensor_demux name=demux ! tensor_sink")
var nodeinfo = pipeline.getNodeInfo("demux")

Change-Id: I503f0a2a52b151ac676a64e2ad888f45abc51170
Signed-off-by: Lukasz Bardeli <l.bardeli@samsung.com>
3 years ago[ML][Pipeline] Implement Start and Stop method. 02/250902/10
Lukasz Bardeli [Mon, 11 Jan 2021 07:29:29 +0000 (08:29 +0100)]
[ML][Pipeline] Implement Start and Stop method.

ACR: TWDAPI-274

[Verification] Code compiles without error.

var pipeline = tizen.ml.pipeline.createPipeline("videotestsrc! tizenwlsink");

pipeline.start()

// pipeline.state = "PLAYING"

pipeline.stop()

// pipeline.state = "PAUSED"

Change-Id: I529c47fd349741d3e11b0b57e265d3a9a930f652
Signed-off-by: Lukasz Bardeli <l.bardeli@samsung.com>
3 years ago[ML][common] Add tizen.ml.checkNNFWAvailability method 88/250788/10
Rafal Walczyna [Wed, 23 Dec 2020 07:54:06 +0000 (08:54 +0100)]
[ML][common] Add tizen.ml.checkNNFWAvailability method

ACR: TWDAPI-273

Test code:

var HWType = ["ANY", "AUTO", "CPU", "CPU_NEON", "CPU_SIMD", "GPU", "NPU",
    "NPU_EDGE_TPU", "NPU_MOVIDIUS", "NPU_SR", "NPU_VIVANTE"];

var NNFWType = ["ANY", "ARM_NN", "CUSTOM_FILTER", "EDGE_TPU", "MVNC", "NNFW", "OPEN_VINO",
    "SNPE", "TENSORFLOW", "TENSORFLOW_LITE", "VIVANTE"];

HWType.forEach(hw => {
    NNFWType.forEach(nnfw => {
        console.log(nnfw + ", " + hw + ": " + tizen.ml.checkNNFWAvailability(nnfw, hw))
    });
});

[Verificaion] Tested in Google Chrome Dev Console

Change-Id: I2ac7752f410a70e98d8c0cd387ac5dfcabdbef88
Signed-off-by: Rafal Walczyna <r.walczyna@samsung.com>
3 years ago[ML][pipeline] Prepare room for a bugfix 97/251697/2
Pawel Wasowski [Mon, 18 Jan 2021 13:01:19 +0000 (14:01 +0100)]
[ML][pipeline] Prepare room for a bugfix

Native handles to all pipeline elements (switches, node infos, etc.)
have to be released BEFORE Pipeline::pipeline_ handle.
Pipeline::Dispose() will release them in proper order and from now on
will be called from ~Pipeline() to not repeat the error prone release
logic.

[Verification] Code tested with below snippets in Chrome DevTools works
fine.

var pipeline = tizen.ml.pipeline.createPipeline('videotestsrc ! tizenwlsink',
                                                function(state) {console.log(state);})
// test screen appears

pipeline.dispose() // no errors, test screen disappear;
// DLOG message about successful disposal

<press F5> // no crash; DLOG message tells that pipeline_ has been destroyed

Change-Id: Ibe8b1260bc7bf057fed375ac579b87fce59d8caf
Signed-off-by: Pawel Wasowski <p.wasowski2@samsung.com>
3 years ago[ML][pipeline] Implement Pipeline::dispose() 70/251070/8
Pawel Wasowski [Tue, 5 Jan 2021 21:47:17 +0000 (22:47 +0100)]
[ML][pipeline] Implement Pipeline::dispose()

ACR: TWDAPI-274

[Verification] Tested in Chrome DevTools with the snippet below, works
fine.

var pipeline = tizen.ml.pipeline.createPipeline('videotestsrc ! tizenwlsink',
                                                function(state) {console.log(state);})
// test screen appears

pipeline.dispose() // no errors, test screen disappears

Change-Id: I5401c3210f73619d5577380abf17139fadc390f1
Signed-off-by: Pawel Wasowski <p.wasowski2@samsung.com>
3 years ago[ML][pipeline] Implement Pipeline::state getter 75/250775/12
Pawel Wasowski [Mon, 4 Jan 2021 09:59:39 +0000 (10:59 +0100)]
[ML][pipeline] Implement Pipeline::state getter

ACR: TWDAPI-274

[Verification] Tested in Chrome DevTools with the snippets below. Works fine

 var pipeline = tizen.ml.pipeline.createPipeline('videotestsrc ! tizenwlsink',
                  function(state) {console.log(state);})

<wait a few seconds>

pipeline.state

Change-Id: Iae5e70c63d5c9fd98877defe0949024516c8c41d
Signed-off-by: Pawel Wasowski <p.wasowski2@samsung.com>
3 years ago[ML][Pipeline] Add Pipeline and PipelineManager 25/250425/19
Pawel Wasowski [Thu, 24 Dec 2020 10:36:26 +0000 (11:36 +0100)]
[ML][Pipeline] Add Pipeline and PipelineManager

ACR: TWDAPI-274

[Verification] createPipeline() tested in Chrome
DevTools with the snippet below works fine

var pipeline = tizen.ml.pipeline.createPipeline(
                 'videoteststrc ! tizenwlsink',
                  function(state) {
                    console.log(state);
                  })
//a moment later:
// READY
// PAUSED

tizen.ml.createPipeline()
// WebAPIException: InvalidValuesError

Change-Id: I68beaebf7e248b61bba9dc06ce6124c187c45fae
Signed-off-by: Pawel Wasowski <p.wasowski2@samsung.com>
3 years ago[ML][pipeline] Add placeholders for implementation 38/251138/4
Pawel Wasowski [Fri, 8 Jan 2021 11:06:03 +0000 (12:06 +0100)]
[ML][pipeline] Add placeholders for implementation

ACR: TWDAPI-274

This commit adds placeholders for implementation of PipelineManager and
Pipeline to avoid merge conflicts of changes done by different
committers.

[Verification] Code compiles

Change-Id: Id4a2b33943e390526929bb5c2dba42cd55d7ad12
Signed-off-by: Pawel Wasowski <p.wasowski2@samsung.com>
3 years agoMerge "[Download][TDAF-1353] Exception fix for 'start' function" into tizen
Piotr Kosko [Fri, 8 Jan 2021 10:38:08 +0000 (10:38 +0000)]
Merge "[Download][TDAF-1353] Exception fix for 'start' function" into tizen

3 years ago[Download][TDAF-1353] Exception fix for 'start' function 81/251081/4
Arkadiusz Pietraszek [Thu, 7 Jan 2021 19:32:28 +0000 (20:32 +0100)]
[Download][TDAF-1353] Exception fix for 'start' function

`start` function was returning unknown error exception instead of
unsupported error in case when networkType in DownloadRequest wasn't
supported by the device.

Additionally fix enables null values to be used (in accordance with the documentation).

[Verification] Code builds without errors. TCT suites deprecated, download and systeminfo pass rate: 100%.
Tested in developer console on devices with telephony set to true and false.
Below code was used with all network types, as well as invalid values.
```
var downloadRequest = new tizen.DownloadRequest(
                    "http://download.tizen.org/tct/2_1/webapi-tizen-download-test-image-lq.png",
                    null, null, "CELLULAR", null);

tizen.download.start(downloadRequest);
```

Change-Id: I4f2866a07019f129c852024970783b110ef11abc
Signed-off-by: Arkadiusz Pietraszek <a.pietraszek@samsung.com>
3 years ago[Common] Moved helper functions to decode/encode strings/binary to common 15/250915/2
Rafal Walczyna [Tue, 5 Jan 2021 13:27:05 +0000 (14:27 +0100)]
[Common] Moved helper functions to decode/encode strings/binary to common

[Verification] Built successfully. Metadata and filesystem auto tct 100%.

Change-Id: I751e5cad95f8c7dc907214225f8f27cabbb3e5e7
Signed-off-by: Rafal Walczyna <r.walczyna@samsung.com>
3 years agoMerge "[ML][utils] Add native error to PlatformResult converter" into tizen
Piotr Kosko [Tue, 5 Jan 2021 10:56:42 +0000 (10:56 +0000)]
Merge "[ML][utils] Add native error to PlatformResult converter" into tizen

3 years agoMerge "[ML][pipeline] Add files structure" into tizen
Piotr Kosko [Tue, 5 Jan 2021 10:56:32 +0000 (10:56 +0000)]
Merge "[ML][pipeline] Add files structure" into tizen

3 years agoMerge "[ML] Add files structure" into tizen
Piotr Kosko [Tue, 5 Jan 2021 10:56:07 +0000 (10:56 +0000)]
Merge "[ML] Add files structure" into tizen

3 years agoMerge branch 'tizen_6.0' into tizen 86/250786/2
Piotr Kosko/Native/Web API (PLT) /SRPOL/Engineer/Samsung Electronics [Mon, 4 Jan 2021 12:38:53 +0000 (13:38 +0100)]
Merge branch 'tizen_6.0' into tizen

Change-Id: I8134cac10af7ba5439eecba63db59fb6ea97496f

3 years agoMerge commit 'tizen_5.5' into tizen_6.0 85/250785/2
Piotr Kosko/Native/Web API (PLT) /SRPOL/Engineer/Samsung Electronics [Mon, 4 Jan 2021 12:37:04 +0000 (13:37 +0100)]
Merge commit 'tizen_5.5' into tizen_6.0

Change-Id: I7d175b5f87cdcbc8a2d701dc5228a6f4b98a92a8

3 years agoMerge branch 'tizen_5.0' into tizen_5.5 84/250784/2
Piotr Kosko/Native/Web API (PLT) /SRPOL/Engineer/Samsung Electronics [Mon, 4 Jan 2021 12:25:26 +0000 (13:25 +0100)]
Merge branch 'tizen_5.0' into tizen_5.5

Change-Id: I4663c3fd5eb5bf03bb1f421ffe39cd761c1b30ca

3 years agoMerge branch 'tizen_4.0' into tizen_5.0 83/250783/1
Piotr Kosko/Native/Web API (PLT) /SRPOL/Engineer/Samsung Electronics [Mon, 4 Jan 2021 12:08:04 +0000 (13:08 +0100)]
Merge branch 'tizen_4.0' into tizen_5.0

Change-Id: Ia3f1067915717be06164910e4efa5660cdb4f6aa

3 years agoMerge branch 'tizen_3.0' into tizen_4.0 81/250781/1
Piotr Kosko/Native/Web API (PLT) /SRPOL/Engineer/Samsung Electronics [Mon, 4 Jan 2021 12:06:20 +0000 (13:06 +0100)]
Merge branch 'tizen_3.0' into tizen_4.0

Change-Id: If6af4a7e369bb22bdd3b8817095680e6db7a0abe

3 years ago[ML][utils] Add native error to PlatformResult converter 75/250575/5
Pawel Wasowski [Tue, 29 Dec 2020 15:56:01 +0000 (16:56 +0100)]
[ML][utils] Add native error to PlatformResult converter

[Verification] The code builds fine

Change-Id: I88234f6474850f554dc617bb0ccc5343b6ed7e93
Signed-off-by: Pawel Wasowski <p.wasowski2@samsung.com>
3 years ago[version] 2.46 79/250779/2
Piotr Kosko/Native/Web API (PLT) /SRPOL/Engineer/Samsung Electronics [Mon, 4 Jan 2021 11:47:12 +0000 (12:47 +0100)]
[version] 2.46

Change-Id: I1d625296e33677999739d473d445b2c09d1ec4e7

3 years ago[Bluetooth] Prevent "Wrong listener identifier" errors for BLE scan 78/250778/2
Pawel Wasowski [Tue, 1 Dec 2020 09:30:10 +0000 (11:30 +0200)]
[Bluetooth] Prevent "Wrong listener identifier" errors for BLE scan

The following app code caused aforementioned errors:

var adapter = tizen.bluetooth.getLEAdapter();
adapter.startScan();
setTimeout(function() {
        adapter.stopScan();
}, 10000);

Now, the error is not thrown.

[Validation] tct-bluetooth-tizen-tests: auto: 100% pass rate,
             manual Bluetooth04_BLE_wearable suite: 100% pass rate
             The code above runs in ChromeDevTools without errors

Change-Id: Id9ec278b4bb1c5ce38d0b3ffb1324498152ab645
Signed-off-by: Pawel Wasowski <p.wasowski2@samsung.com>
3 years ago[ML][pipeline] Add files structure 24/250424/4
Pawel Wasowski [Tue, 22 Dec 2020 11:04:09 +0000 (12:04 +0100)]
[ML][pipeline] Add files structure

ACR: TWDAPI-274

Change-Id: I1941dba3cc1cfab2e0be514608e7b936da12b20e
Signed-off-by: Pawel Wasowski <p.wasowski2@samsung.com>
3 years ago[ML] Add files structure 69/250169/7
Rafal Walczyna [Mon, 21 Dec 2020 12:43:54 +0000 (13:43 +0100)]
[ML] Add files structure

[Verification] Build successful, tizen.ml.single and tizen.ml.pipeline
are visible in WebApplication

Change-Id: Iddd81dbff6531db9395495ecbbd94f0a9b81f95c
Signed-off-by: Rafal Walczyna <r.walczyna@samsung.com>
3 years ago[Common] Moved ArrayToString function to utils 65/250765/1
Rafal Walczyna [Mon, 4 Jan 2021 09:44:44 +0000 (10:44 +0100)]
[Common] Moved ArrayToString function to utils

[Verification] TCT-auto filesystem 100% passrate.

Change-Id: I323c80ef353ceef5723b423bed4a0ee4f9844656
Signed-off-by: Rafal Walczyna <r.walczyna@samsung.com>
3 years ago[Common] Moved StringToArray function to utils and applied auto-format 06/248506/2 accepted/tizen/unified/20201210.124550 submit/tizen/20201209.085808
Piotr Kosko/Native/Web API (PLT) /SRPOL/Engineer/Samsung Electronics [Fri, 27 Nov 2020 07:28:17 +0000 (08:28 +0100)]
[Common] Moved StringToArray function to utils and applied auto-format

[Verification] TCT filesystem 100% passrate.
Checked metadata features in chrome console.

Change-Id: I807d8514bfda1afccd136fe74b37f80ff45190ca

3 years ago[Metadata] Fixes for implementation 41/248441/2
Piotr Kosko/Native/Web API (PLT) /SRPOL/Engineer/Samsung Electronics [Thu, 26 Nov 2020 12:19:24 +0000 (13:19 +0100)]
[Metadata] Fixes for implementation

[Verification] Code works as expected by documentation, fixed crash
when calling api without arguments. Verified in chrome console

Change-Id: I80a021d1804d2b0ac55279df1d3d4cc699bc0a8b

3 years ago[Metadata] Add getSyncLyrics to MetadataHandle 23/248423/3
Piotr Kosko/Native/Web API (PLT) /SRPOL/Engineer/Samsung Electronics [Thu, 26 Nov 2020 08:55:11 +0000 (09:55 +0100)]
[Metadata] Add getSyncLyrics to MetadataHandle

[ACR] https://code.sec.samsung.net/jira/browse/TWDAPI-271

[Verification] Code compiles withotu errors.
Works well for mp3 file with SYLT data.

// Prectondition - file preparation (with python code)
// important - SYLT need to be UTF-8 or ISO-8859 encoded to be supported on Tizen device
from mutagen.id3 import ID3, SYLT, Encoding

tag = ID3("sample.mp3")
sync_lrc = [("TEST lyrics 1", 100),
            ("another TEST lyrics - 2", 2000),
            ("yet another TEST lyrics", 4000)]  # [(lrc, millisecond), ]
tag.setall("SYLT", [SYLT(encoding=Encoding.UTF8, lang='eng', format=2, type=1, text=sync_lrc)])
tag.save()

tag.getall("SYLT")

// then push file to device

// then run below code in chrome console
var path = "videos/sample.mp3";
var fileHandle = tizen.metadata.createFileHandle(path);
var lyrics_num = fileHandle.get("SYNCLYRICS_NUM");

for (var i = 0; i < lyrics_num; ++i) {
    var lyrics = fileHandle.getSyncLyrics(i);
    console.log("Lyrics " + i + " (" + lyrics.timestamp  + "ms): " + lyrics.lyrics);
}

// expected return be like
console-via-logger.js:173 Lyrics 0 (100ms): TEST lyrics 1
console-via-logger.js:173 Lyrics 1 (2000ms): another TEST lyrics - 2
console-via-logger.js:173 Lyrics 2 (4000ms): yet another TEST lyrics

Change-Id: I01a502f40655532a37fc4055480e35826bb7a697

3 years ago[Metadata] Aded getFrameAtTime method of MetadataFileHandle 90/245090/4
Piotr Kosko [Thu, 1 Oct 2020 08:10:30 +0000 (10:10 +0200)]
[Metadata] Aded getFrameAtTime method of MetadataFileHandle

[ACR] https://code.sec.samsung.net/jira/browse/TWDAPI-271

[Verification] Code compiles without errors.
Works well for mp4 video.
var path = "videos/sample_video.mp4";
function showBlob(bbb) {
    var elem = document.getElementById("blobImage") || document.createElement("img");
    elem.setAttribute("id", "blobImage");
    elem.setAttribute("height", "240");
    elem.setAttribute("width", "240");
    elem.setAttribute("alt", "invalid frame");
    document.getElementById("test").appendChild(elem)

    var objectURL = URL.createObjectURL(bbb);
    elem.src = objectURL;
}
var fileHandle = tizen.metadata.createFileHandle(path);
var frame = fileHandle.getFrameAtTime(2000, true);
console.log(frame);
showBlob(frame)

Change-Id: Ib39c32566fe1d63711d7ce5ce991f216d7a84389

3 years ago[Metadata] Aded getFrame method of MetadataFileHandle 71/245071/7
Piotr Kosko [Thu, 1 Oct 2020 06:02:45 +0000 (08:02 +0200)]
[Metadata] Aded getFrame method of MetadataFileHandle

[ACR] https://code.sec.samsung.net/jira/browse/TWDAPI-271

[Verification] Code compiles withotu errors.
Works well for mp4 video.
var path = "videos/sample_video.mp4";
function showBlob(bbb) {
    var elem = document.getElementById("blobImage") || document.createElement("img");
    elem.setAttribute("id", "blobImage");
    elem.setAttribute("height", "240");
    elem.setAttribute("width", "240");
    elem.setAttribute("alt", "invalid frame");
    document.getElementById("test").appendChild(elem)

    var objectURL = URL.createObjectURL(bbb);
    elem.src = objectURL;
}
var fileHandle = tizen.metadata.createFileHandle(path);
var frame = fileHandle.getFrame();
console.log(frame);
showBlob(frame)

Change-Id: I2d5e81b19d7f11ff2c08a0096a0b58fb7e3bfc48

3 years ago[Metadata] Added getArtwork method of MetadataFileHandle 64/245064/6
Piotr Kosko [Wed, 30 Sep 2020 06:23:20 +0000 (08:23 +0200)]
[Metadata] Added getArtwork method of MetadataFileHandle

[ACR] https://code.sec.samsung.net/jira/browse/TWDAPI-271

[Verification]
Code compiles without errors.
Checked in chrome console with below code.
Precondition: sample.mp3 with artwork need to be pushed on device

// test artwork
var path = "videos/sample.mp3";
function showBlob(bbb) {
    var elem = document.getElementById("blobImage") || document.createElement("img");
    elem.setAttribute("id", "blobImage");
    elem.setAttribute("height", "240");
    elem.setAttribute("width", "240");
    elem.setAttribute("alt", "invalid blob");
    document.getElementById("test").appendChild(elem)

    var objectURL = URL.createObjectURL(bbb);
    elem.src = objectURL;
}
var fileHandle = tizen.metadata.createFileHandle(path);
var artwork = fileHandle.getArtwork();
console.log(artwork);
showBlob(artwork)

Change-Id: Ia0cbe5ade542ad71224a91c0c1a4618072b5538e

3 years agoMerge branch 'tizen_6.0' into tizen 30/247930/2
Piotr Kosko/Native/Web API (PLT) /SRPOL/Engineer/Samsung Electronics [Wed, 18 Nov 2020 11:28:05 +0000 (12:28 +0100)]
Merge branch 'tizen_6.0' into tizen

Change-Id: I2d08f181e8b6b7f3673d959c22f17cc67e8358f1

3 years agoMerge branch 'tizen_5.5' into tizen_6.0 29/247929/2
Piotr Kosko/Native/Web API (PLT) /SRPOL/Engineer/Samsung Electronics [Wed, 18 Nov 2020 11:27:12 +0000 (12:27 +0100)]
Merge branch 'tizen_5.5' into tizen_6.0

Change-Id: If24e8f3bf63cc1315e49ea67801d2742b8f7eb55

3 years agoMerge branch 'tizen_5.0' into tizen_5.5 27/247927/2
Piotr Kosko/Native/Web API (PLT) /SRPOL/Engineer/Samsung Electronics [Wed, 18 Nov 2020 11:25:23 +0000 (12:25 +0100)]
Merge branch 'tizen_5.0' into tizen_5.5

Change-Id: I813db4cffb3862ced142c7a94e62679259f53c6d

3 years agoMerge branch 'tizen_4.0' into tizen_5.0 26/247926/2
Piotr Kosko/Native/Web API (PLT) /SRPOL/Engineer/Samsung Electronics [Wed, 18 Nov 2020 11:21:12 +0000 (12:21 +0100)]
Merge branch 'tizen_4.0' into tizen_5.0

Change-Id: I660b3b2b74fb33acbb89b9d06b7a230abee28315

3 years agoMerge branch 'tizen_3.0' into tizen_4.0 24/247924/4
Piotr Kosko/Native/Web API (PLT) /SRPOL/Engineer/Samsung Electronics [Wed, 18 Nov 2020 11:15:48 +0000 (12:15 +0100)]
Merge branch 'tizen_3.0' into tizen_4.0

Change-Id: Ia0f2c393b1aa339c1881c084636dbfb91245602d

3 years ago[version] 2.45 35/247935/1
Piotr Kosko/Native/Web API (PLT) /SRPOL/Engineer/Samsung Electronics [Wed, 18 Nov 2020 11:13:52 +0000 (12:13 +0100)]
[version] 2.45

Change-Id: I96f465c583720abbb514635a56adf50988bdac4f

3 years ago[Filesystem] Fix the position property when writing non-single-byte-signs 18/247918/3
Piotr Kosko/Native/Web API (PLT) /SRPOL/Engineer/Samsung Electronics [Wed, 18 Nov 2020 08:15:07 +0000 (09:15 +0100)]
[Filesystem] Fix the position property when writing non-single-byte-signs

[Bug] When FileStream object writes non-single-byte-signs, position members
was not properly updated.

[Verification] TCT filesystem - 100%
Below code:
(function writeKoreanOldAPI(fileName) {
    var dirPath = "documents/";
    var fullPath = dirPath + fileName;
    console.log("fullPath : " + fullPath);
    console.log("fileName : " + fileName);

    tizen.filesystem.resolve(fullPath, function (fileResult) {
        fileResult.openStream("w", function (fileStream) {
            fileStream.write("한글 확인 파일입니다\n");
            fileStream.write("한글111 확인 파일입니다\n");
            fileStream.write("한글22222 확인 파일입니다\n");

            fileStream.write("한글 확인 파일입니다\n");
            fileStream.write("한글 확인111 파일입니다\n");
            fileStream.write("한글 확인22222 파일입니다\n");

            fileStream.write("한글 확인 파일입니다\n");
            fileStream.write("한글 확인 파일입니다111\n");
            fileStream.write("한글 확인 파일입니다22222\n");
            fileStream.write("겆\n");
            fileStream.write("돐\n");

            fileStream.close();
        },
            function (e) {
                console.log("Error " + e.message);
            }, "UTF-8");

        fileResult.readAsText(
            function (str) {
                console.log("The file content:\n" + str);
                oldAPIResult = str;
            },
            function (e) {
                console.log("Error " + e.message);
            },
            "UTF-8");
    },
        function (e) {
            console.log("Error:" + e + " Create a file.");
            tizen.filesystem.resolve(dirPath, (dir) => { newFile = dir.createFile(fileName); });
            writeKoreanOldAPI(fileName);
        }, "rw");

})("test")

creates file with size of 302 bytes and content:
한글 확인 파일입니다
한글111 확인 파일입니다
한글22222 확인 파일입니다
한글 확인 파일입니다
한글 확인111 파일입니다
한글 확인22222 파일입니다
한글 확인 파일입니다
한글 확인 파일입니다111
한글 확인 파일입니다22222



Change-Id: I8ff3c158ed2b284e1cdeaa93c339952fef6915b0

3 years ago[Filesystem] Add support for ISO-8859-1 23/247923/2
Jakub Skowron [Tue, 23 Jan 2018 12:19:10 +0000 (13:19 +0100)]
[Filesystem] Add support for ISO-8859-1

Latin-1 encoding in FileReadString and FileWriteString

Change-Id: I2cd7942481619989891c3019d3f7d4325b962892
Signed-off-by: Jakub Skowron <j.skowron@samsung.com>
3 years ago[NBS] Add validation of instance to prevent crash 57/247857/1
Piotr Kosko [Thu, 5 Nov 2020 11:20:21 +0000 (12:20 +0100)]
[NBS] Add validation of instance to prevent crash

[Bug] In case of destroying instance before the operation:
* requestRouteToHost
* releaseRouteToHost
is finished, invalidated instance was used in code.

[Reproduction] In my case it was execution of below code max 10 times:
function crashApplicationWithNBS() {
    try {
        tizen.networkbearerselection.releaseRouteToHost(
            "CELLULAR", "www.onet.pl", addRouteAndReload, addRouteAndReload);
    } catch (e) {
        addRouteAndReload();
    }
}

function addRouteAndReload() {
    var statuscb =
    {
        onsuccess: function () {
            console.log("onsuccess func is called");
        },
        ondisconnected: function () {
            console.log("ondisconnected func is called");
        }
    };
    function ecb(e) {
        console.log("error callback is called: " + e.message + ": " + e.code);
    }
    setTimeout(() => {
        try {
            tizen.networkbearerselection.requestRouteToHost(
                "CELLULAR", "www.onet.pl", statuscb, ecb)
        } catch (e) { console.log(e) }
    }, 500);
    setTimeout(() => { location.href = "index.html"; }, 490);
}

[Verification]
* Crash does not occur. Crash situation is only signalled
with log:
DoAndPostMessage(264) > Trying to post message to non-existing instance: [0xb8cb1730], ignoring
* Success and error callbacks are properly triggered

Change-Id: I6adac13a8a99dbc114102bbd2ffced6bf012cfce

3 years agoMerge "[Systeminfo] Refactor for getCapability" into tizen
Piotr Kosko [Tue, 17 Nov 2020 07:15:06 +0000 (07:15 +0000)]
Merge "[Systeminfo] Refactor for getCapability" into tizen

3 years ago[Systeminfo] Refactor for getCapability 16/247416/5
Piotr Kosko [Tue, 10 Nov 2020 13:26:25 +0000 (14:26 +0100)]
[Systeminfo] Refactor for getCapability

The goal of this change is to avoid some strange error logs when 'trying' to gather
each type in the pipeline one after another. Now the type is checked first, then the value
is gathered.

[Verification] Code compiles without errors.
TCT passrate 100%.
Below calls behaviour didn't change (all capabilities listed in Web API documentation):

var caps = [
    'http://tizen.org/feature/content.scanning.others',
    'http://tizen.org/feature/datasync',
    'http://tizen.org/feature/download',
    'http://tizen.org/feature/network.telephony',
    'http://tizen.org/feature/network.wifi',
    'http://tizen.org/feature/systemsetting',
    'http://tizen.org/feature/systemsetting.home_screen',
    'http://tizen.org/feature/systemsetting.lock_screen',
    'http://tizen.org/feature/systemsetting.incoming_call',
    'http://tizen.org/feature/systemsetting.notification_email',
    'http://tizen.org/feature/network.bluetooth.audio.media',
    'http://tizen.org/feature/network.telephony',
    'http://tizen.org/feature/network.telephony.mms',
    'http://tizen.org/feature/battery',
    'http://tizen.org/feature/camera',
    'http://tizen.org/feature/camera.back',
    'http://tizen.org/feature/camera.back.flash',
    'http://tizen.org/feature/camera.front',
    'http://tizen.org/feature/camera.front.flash',
    'http://tizen.org/feature/database.encryption',
    'http://tizen.org/feature/fmradio',
    'http://tizen.org/feature/humanactivitymonitor',
    'http://tizen.org/feature/graphics.acceleration',
    'http://tizen.org/feature/led',
    'http://tizen.org/feature/input.keyboard',
    'http://tizen.org/feature/input.keyboard.layout',
    'http://tizen.org/feature/input.rotating_bezel',
    'http://tizen.org/feature/security.tee',
    'http://tizen.org/feature/location',
    'http://tizen.org/feature/location.batch',
    'http://tizen.org/feature/location.gps',
    'http://tizen.org/feature/location.wps',
    'http://tizen.org/feature/multimedia.transcoder',
    'http://tizen.org/feature/microphone',
    'http://tizen.org/feature/multi_point_touch.pinch_zoom',
    'http://tizen.org/feature/multi_point_touch.point_count',
    'http://tizen.org/feature/network.bluetooth',
    'http://tizen.org/feature/network.bluetooth.audio.call',
    'http://tizen.org/feature/network.bluetooth.audio.media',
    'http://tizen.org/feature/network.bluetooth.health',
    'http://tizen.org/feature/network.bluetooth.hid',
    'http://tizen.org/feature/network.bluetooth.le',
    'http://tizen.org/feature/network.bluetooth.opp',
    'http://tizen.org/feature/network.ethernet',
    'http://tizen.org/feature/network.internet',
    'http://tizen.org/feature/network.nfc',
    'http://tizen.org/feature/network.nfc.card_emulation',
    'http://tizen.org/feature/network.nfc.card_emulation.hce',
    'http://tizen.org/feature/network.nfc.p2p',
    'http://tizen.org/feature/network.nfc.reserved_push',
    'http://tizen.org/feature/network.nfc.tag',
    'http://tizen.org/feature/network.push',
    'http://tizen.org/feature/network.secure_element',
    'http://tizen.org/feature/network.telephony',
    'http://tizen.org/feature/network.telephony.mms',
    'http://tizen.org/feature/network.wifi',
    'http://tizen.org/feature/network.wifi.direct',
    'http://tizen.org/feature/opengles',
    'http://tizen.org/feature/opengles.texture_format',
    'http://tizen.org/feature/opengles.texture_format.3dc',
    'http://tizen.org/feature/opengles.texture_format.atc',
    'http://tizen.org/feature/opengles.texture_format.etc',
    'http://tizen.org/feature/opengles.texture_format.ptc',
    'http://tizen.org/feature/opengles.texture_format.pvrtc',
    'http://tizen.org/feature/opengles.texture_format.utc',
    'http://tizen.org/feature/opengles.version.1_1',
    'http://tizen.org/feature/opengles.version.2_0',
    'http://tizen.org/feature/platform.core.api.version',
    'http://tizen.org/feature/platform.core.cpu.arch',
    'http://tizen.org/feature/platform.core.cpu.arch.armv6',
    'http://tizen.org/feature/platform.core.cpu.arch.armv7',
    'http://tizen.org/feature/platform.core.cpu.arch.x86',
    'http://tizen.org/feature/platform.core.cpu.frequency',
    'http://tizen.org/feature/platform.core.fpu.arch',
    'http://tizen.org/feature/platform.core.fpu.arch.sse2',
    'http://tizen.org/feature/platform.core.fpu.arch.sse3',
    'http://tizen.org/feature/platform.core.fpu.arch.ssse3',
    'http://tizen.org/feature/platform.core.fpu.arch.vfpv2',
    'http://tizen.org/feature/platform.core.fpu.arch.vfpv3',
    'http://tizen.org/feature/platform.native.api.version',
    'http://tizen.org/feature/platform.native.osp_compatible',
    'http://tizen.org/feature/platform.version',
    'http://tizen.org/feature/platform.web.api.version',
    'http://tizen.org/feature/platform.version.name',
    'http://tizen.org/feature/profile',
    'http://tizen.org/feature/screen',
    'http://tizen.org/feature/screen.auto_rotation',
    'http://tizen.org/feature/screen.bpp',
    'http://tizen.org/feature/screen.coordinate_system.size.large',
    'http://tizen.org/feature/screen.coordinate_system.size.normal',
    'http://tizen.org/feature/screen.dpi',
    'http://tizen.org/feature/screen.height',
    'http://tizen.org/feature/screen.output.hdmi',
    'http://tizen.org/feature/screen.output.rca',
    'http://tizen.org/feature/screen.shape.circle',
    'http://tizen.org/feature/screen.shape.rectangle',
    'http://tizen.org/feature/screen.size.all',
    'http://tizen.org/feature/screen.size.large',
    'http://tizen.org/feature/screen.size.normal',
    'http://tizen.org/feature/screen.size.normal.240.400',
    'http://tizen.org/feature/screen.size.normal.320.320',
    'http://tizen.org/feature/screen.size.normal.320.480',
    'http://tizen.org/feature/screen.size.normal.360.360',
    'http://tizen.org/feature/screen.size.normal.360.480',
    'http://tizen.org/feature/screen.size.normal.480.800',
    'http://tizen.org/feature/screen.size.normal.540.960',
    'http://tizen.org/feature/screen.size.normal.600.1024',
    'http://tizen.org/feature/screen.size.normal.720.1280',
    'http://tizen.org/feature/screen.size.normal.1080.1920',
    'http://tizen.org/feature/screen.width',
    'http://tizen.org/feature/sensor.accelerometer',
    'http://tizen.org/feature/sensor.accelerometer.wakeup',
    'http://tizen.org/feature/sensor.activity_recognition',
    'http://tizen.org/feature/sensor.barometer',
    'http://tizen.org/feature/sensor.barometer.wakeup',
    'http://tizen.org/feature/sensor.gesture_recognition',
    'http://tizen.org/feature/sensor.gravity',
    'http://tizen.org/feature/sensor.gyroscope',
    'http://tizen.org/feature/sensor.gyroscope_rotation_vector',
    'http://tizen.org/feature/sensor.gyroscope.wakeup',
    'http://tizen.org/feature/sensor.heart_rate_monitor',
    'http://tizen.org/feature/sensor.heart_rate_monitor.led_green',
    'http://tizen.org/feature/sensor.heart_rate_monitor.led_ir',
    'http://tizen.org/feature/sensor.heart_rate_monitor.led_red',
    'http://tizen.org/feature/sensor.humidity',
    'http://tizen.org/feature/sensor.linear_acceleration',
    'http://tizen.org/feature/sensor.magnetometer',
    'http://tizen.org/feature/sensor.magnetometer.wakeup',
    'http://tizen.org/feature/sensor.pedometer',
    'http://tizen.org/feature/sensor.photometer',
    'http://tizen.org/feature/sensor.photometer.wakeup',
    'http://tizen.org/feature/sensor.proximity',
    'http://tizen.org/feature/sensor.proximity.wakeup',
    'http://tizen.org/feature/sensor.rotation_vector',
    'http://tizen.org/feature/sensor.sleep_monitor',
    'http://tizen.org/feature/sensor.temperature',
    'http://tizen.org/feature/sensor.tiltmeter',
    'http://tizen.org/feature/sensor.tiltmeter.wakeup',
    'http://tizen.org/feature/sensor.ultraviolet',
    'http://tizen.org/feature/sensor.wrist_up',
    'http://tizen.org/feature/shell.appwidget',
    'http://tizen.org/feature/sip.voip',
    'http://tizen.org/feature/speech.recognition',
    'http://tizen.org/feature/speech.synthesis',
    'http://tizen.org/feature/usb.accessory',
    'http://tizen.org/feature/usb.host',
    'http://tizen.org/feature/web.service',
    'http://tizen.org/feature/vision.face_recognition',
    'http://tizen.org/feature/vision.image_recognition',
    'http://tizen.org/feature/vision.qrcode_generation',
    'http://tizen.org/feature/vision.qrcode_recognition'
];

for (var i in caps) {
    try {
        console.log(
            'Value of ' + caps[i] + ': ' + tizen.systeminfo.getCapability(caps[i])
        );
    } catch (e) {
        console.log('Exception for ' + caps[i] + ': ' + e);
    }
}

Change-Id: Ia154396e3ec19dcb8b30f1c3b4f90a37bdd05738

3 years agoMerge "[Archive] Changing handling of Zip Path Traversal Vulnerability" into tizen
Piotr Kosko [Thu, 12 Nov 2020 13:22:01 +0000 (13:22 +0000)]
Merge "[Archive] Changing handling of Zip Path Traversal Vulnerability" into tizen

3 years ago[Archive] Changing handling of Zip Path Traversal Vulnerability 68/246868/4
Arkadiusz Pietraszek [Wed, 4 Nov 2020 18:20:42 +0000 (19:20 +0100)]
[Archive] Changing handling of Zip Path Traversal Vulnerability

This commit introduces verification of destination of extracted elements.
Before this commit ".." occurrence in archive entry resulted in
exception.

[Verification]
Manual test in developer console with prepared archive file shows
correct exception for ArchiveFile::extractAll and
ArchiveFileEntry::extract methods on TM1 and TW2.
tct-archive-tizen-tests pass rate: 100% on TM1 and TW2.

Change-Id: I823ff3d161bf1897fe98b6746cc0a1f60c874543
Signed-off-by: Arkadiusz Pietraszek <a.pietraszek@samsung.com>
3 years agoMerge "[Bluetooth] Prevent accessing inappropriate memory areas" into tizen
Piotr Kosko [Tue, 10 Nov 2020 10:26:46 +0000 (10:26 +0000)]
Merge "[Bluetooth] Prevent accessing inappropriate memory areas" into tizen

3 years ago[NBS] Add validation of instance to prevent crash 79/246979/5
Piotr Kosko [Thu, 5 Nov 2020 11:20:21 +0000 (12:20 +0100)]
[NBS] Add validation of instance to prevent crash

[Bug] In case of destroying instance before the operation:
* requestRouteToHost
* releaseRouteToHost
is finished, invalidated instance was used in code.

[Reproduction] In my case it was execution of below code max 10 times:
function crashApplicationWithNBS() {
    try {
        tizen.networkbearerselection.releaseRouteToHost(
            "CELLULAR", "www.onet.pl", addRouteAndReload, addRouteAndReload);
    } catch (e) {
        addRouteAndReload();
    }
}

function addRouteAndReload() {
    var statuscb =
    {
        onsuccess: function () {
            console.log("onsuccess func is called");
        },
        ondisconnected: function () {
            console.log("ondisconnected func is called");
        }
    };
    function ecb(e) {
        console.log("error callback is called: " + e.message + ": " + e.code);
    }
    setTimeout(() => {
        try {
            tizen.networkbearerselection.requestRouteToHost(
                "CELLULAR", "www.onet.pl", statuscb, ecb)
        } catch (e) { console.log(e) }
    }, 500);
    setTimeout(() => { location.href = "index.html"; }, 490);
}

[Verification]
* Crash does not occur. Crash situation is only signalled
with log:
DoAndPostMessage(264) > Trying to post message to non-existing instance: [0xb8cb1730], ignoring
* Success and error callbacks are properly triggered

Change-Id: I6adac13a8a99dbc114102bbd2ffced6bf012cfce

3 years ago[Bluetooth] Prevent accessing inappropriate memory areas 88/246188/10
Pawel Wasowski [Wed, 21 Oct 2020 23:13:27 +0000 (01:13 +0200)]
[Bluetooth] Prevent accessing inappropriate memory areas

This commit prevents from accessing inappropriate memory areas,
leading to crashes.

The first crash scenario:
1. connect to a remote GATT server:
device.connect(<callbacks>) // "device" was passed as an argument to
BluetoothLEAdapter::startScan() callback
2. save one of the services to a variable:
var service = device.getService(<a UUID>);
3. disconnect from the server:
device.disconnect(<callbacks>)
4. connect to the same GATT server again:
device.connect(<callbacks>); // "device" represents the same
device as in the 1st step
5. get the same service as before:
var service_new = device.getService(<the same UUID as in 2.>)
6. access one of the "service"'s members:
service.services
7. The app has crashed

The second crash scenario has not been observed, but we anticipate that
crashes could happen if the old code were run on 64-bit CPUs
(XWALK-2106).
The old code has stored bt_gatt_h (typedef for just void*) values
from C++ in the JS layer, as "double" variables. On 32-bit architectures,
a conversion of a pointer to double (from C++ to JS) and from double to
a pointer (from JS back to C++) gives us the same pointer.
On 64-bit systems, a pointer may be greater than the greatest integer,
guaranteed to have a double representation (Number.MAX_SAFE_INTEGER
in JS) and using a memory address, casted back from double may lead to
a crash or another unpredictable behavior.

[Verification]
tct-bluetooth-tizen-tests:
        auto: 100% pass rate
        manual Bluetooth04_BLE_wearable: 100% pass rate
When the first crash scenario has been followed in ChromeDev Tools, no
crash has happened.

Change-Id: I52dead1398b2d0aaf21c34c68f6bbcb04ebd3dba
Signed-off-by: Pawel Wasowski <p.wasowski2@samsung.com>
3 years agoMerge branch 'tizen_5.5' into tizen 54/246854/1 accepted/tizen/6.0/unified/20201109.024725 accepted/tizen/unified/20201109.123531 submit/tizen/20201104.133613 submit/tizen_6.0/20201105.091219
Piotr Kosko [Wed, 4 Nov 2020 11:38:51 +0000 (12:38 +0100)]
Merge branch 'tizen_5.5' into tizen

Change-Id: I8a11ece18424a2f71dac69b4ec9cf586bd20723f

3 years ago[version] 2.68 37/246837/1 accepted/tizen_5.5_unified accepted/tizen/5.5/unified/20201109.020201 submit/tizen_5.5/20201104.133647
Piotr Kosko [Wed, 4 Nov 2020 11:36:44 +0000 (12:36 +0100)]
[version] 2.68

Change-Id: Ic8c9c7cb091cc178e9ba51914e561ba9a61d9cab

3 years agoMerge "[Application] Add check for user_data availability in AppControl callback...
Piotr Kosko [Wed, 4 Nov 2020 11:12:36 +0000 (11:12 +0000)]
Merge "[Application] Add check for user_data availability in AppControl callback" into tizen

3 years ago[Application] Add check for user_data availability in AppControl callback 32/246832/1
Rafal Walczyna [Fri, 9 Oct 2020 11:52:55 +0000 (13:52 +0200)]
[Application] Add check for user_data availability in AppControl callback

Sometimes result_callback from app-control fires after
ApplicationInstance destructor.

[verification] Build successful

Change-Id: If60467db9e97573aedc4b888dfbe68f5e16390fc
Signed-off-by: Rafal Walczyna <r.walczyna@samsung.com>
3 years agoMerge changes I2573a59c,If524bc4f into tizen
Piotr Kosko [Mon, 26 Oct 2020 12:53:23 +0000 (12:53 +0000)]
Merge changes I2573a59c,If524bc4f into tizen

* changes:
  [Datacontrol] Prevent possible race conditions
  [datacontrol] Fix a few issues

3 years ago[Datacontrol] Prevent possible race conditions 51/246051/2
Pawel Wasowski [Wed, 21 Oct 2020 03:15:01 +0000 (05:15 +0200)]
[Datacontrol] Prevent possible race conditions

DataconstrolInstance::reply_map is accessed in callbacks
that can run in threads other than that, which runs API calls.
This commit adds a mutex and proper locks to prevent race
conditions.

[Verification] tct-datacontrol-tizen-tests: 100% pass rate

Change-Id: I2573a59c36af3e12a0d5e77598b170192d24f225
Signed-off-by: Pawel Wasowski <p.wasowski2@samsung.com>
3 years ago[datacontrol] Fix a few issues 14/245914/3
Pawel Wasowski [Fri, 16 Oct 2020 22:02:05 +0000 (00:02 +0200)]
[datacontrol] Fix a few issues

This commit:
- adds freeing of the result passed to MAPGetResponseCallback
TODO: after fixing this problem, the app crashes. It was reported to
native developers and we need to wait for their answer, which will tell
us, if the result should be freed or not
- removes unused DatacontrolInstance::DataControlManagerGetConsumer
method
- adds handling errors of bundle_create() and bundle_add_str()
- adds the code destroying handles created in
DatacontrolInstance::Create{MAP, SQL}Handle() methods in case of
failures
- adds missing "const" and/or "&" in one of the functions to unify the
code style in the module
- fixes a grammar issue of one log message

[Verification] tct-datacontrol-tizen-tests: 100% pass rate

Change-Id: If524bc4f733762658a07993e39b8eaa9fe59d56d
Signed-off-by: Pawel Wasowski <p.wasowski2@samsung.com>
3 years ago[Application] Add check for user_data availability in AppControl callback 61/245461/10
Rafal Walczyna [Fri, 9 Oct 2020 11:52:55 +0000 (13:52 +0200)]
[Application] Add check for user_data availability in AppControl callback

Sometimes result_callback from app-control fires after
ApplicationInstance destructor.

[verification] Build successful

Change-Id: If60467db9e97573aedc4b888dfbe68f5e16390fc
Signed-off-by: Rafal Walczyna <r.walczyna@samsung.com>
3 years agoMerge "[datacontrol] Fix synchronisation issue" into tizen accepted/tizen_6.0_unified_hotfix tizen_6.0_hotfix accepted/tizen/6.0/unified/20201030.122119 accepted/tizen/6.0/unified/hotfix/20201103.004423 accepted/tizen/6.0/unified/hotfix/20201103.051525 accepted/tizen/unified/20201020.101858 submit/tizen/20201020.095518 submit/tizen_6.0/20201029.205102 submit/tizen_6.0_hotfix/20201102.192502 submit/tizen_6.0_hotfix/20201103.114802 tizen_6.0.m2_release
Piotr Kosko [Tue, 20 Oct 2020 07:52:36 +0000 (07:52 +0000)]
Merge "[datacontrol] Fix synchronisation issue" into tizen

3 years ago[Utils] Remove invalid line 40/245940/1
Rafal Walczyna [Tue, 20 Oct 2020 07:43:27 +0000 (09:43 +0200)]
[Utils] Remove invalid line

Line occurred due to merge issue. It caused LightWeightWeb engine to fail.

Change-Id: I78ed5b083cfa007c2e396464b9a50ad6398f3bcc
Signed-off-by: Rafal Walczyna <r.walczyna@samsung.com>
3 years ago[datacontrol] Fix synchronisation issue 87/245687/4
k2.nagaraju [Wed, 14 Oct 2020 07:58:38 +0000 (13:28 +0530)]
[datacontrol] Fix synchronisation issue

k2.nagaraju:
In |RunMAPDataControlJob| updating the |IdMap| value and same value is
used in callback function |MAPAddResponseCallback| for any request id is
added. But before |RunMAPDataControlJob| updating value of |IdMap|,
getting |MAPAddResponseCallback| which is causing the failure with
|Invalid context|. Handled this scenario.

p.wasowski2:
Changed k2.nagaraju's commit a little to conform with the coding used in
the datacontrol module implementation and Web API.

[Verification] No synchronization issues in several runs of WebService2.wgt
app, attached to the related XWALK-2183 task (before, the problem,
signalled by "Invalid context" dlog entry, was reproducible on every run).
tct-datacontrol-tizen-tests: 100% pass rate

Signed-off-by: k2.nagaraju <k2.nagaraju@samsung.com>
Signed-off-by: Pawel Wasowski <p.wasowski2@samsung.com>
Change-Id: I247aaff45071331255528a62ffc5d8afa4b8e8af

3 years ago[Mediacontroller] Added refreshing the list of handles 94/245294/1 accepted/tizen/5.5/unified/20201103.003327 submit/tizen_5.5/20201026.095948
Piotr Kosko/Native/Web API (PLT) /SRPOL/Engineer/Samsung Electronics [Thu, 3 Sep 2020 08:35:44 +0000 (10:35 +0200)]
[Mediacontroller] Added refreshing the list of handles

[Bug] If native application (e.g. service) adds the playlist,
web api is able to gather it, but cannot perform any actions on it,
because web API stores only handles to playlists created by itself.

[Solution] Added functionality of refreshing handles always when gathering
a playlists handles using native API

[Verification] Code compiles without errors.

Change-Id: I9bb757f50c3bc4167b0a97c923d49a1ccbbe0195

3 years ago[Mediacontroller] Added refreshing the list of handles 23/243123/12 accepted/tizen/unified/20201007.090611 submit/tizen/20201006.121826
Piotr Kosko/Native/Web API (PLT) /SRPOL/Engineer/Samsung Electronics [Thu, 3 Sep 2020 08:35:44 +0000 (10:35 +0200)]
[Mediacontroller] Added refreshing the list of handles

[Bug] If native application (e.g. service) adds the playlist,
web api is able to gather it, but cannot perform any actions on it,
because web API stores only handles to playlists created by itself.

[Solution] Added functionality of refreshing handles always when gathering
a playlists handles using native API

[Verification] Code compiles without errors.

Change-Id: I9bb757f50c3bc4167b0a97c923d49a1ccbbe0195

3 years ago[Bluetooth][bugfix] Call success callbacks in registerService() 40/245140/1 submit/tizen/20201005.050422
Pawel Wasowski [Fri, 2 Oct 2020 16:28:27 +0000 (18:28 +0200)]
[Bluetooth][bugfix] Call success callbacks in registerService()

registerService() used to call successCallback only when registered
service had at least 1 component with read/write value request callback.
Now, the function will call successCallback even, if the service
has no components with such read/write value request calbacks.

[Verification] registerService() calls successCallback when no
read/write value request callbacks are registered

Change-Id: I4f4af260179fb21ac785dc1ccb0f5dab6d986496
Signed-off-by: Pawel Wasowski <p.wasowski2@samsung.com>