From 3e7d086add409f25a1f7099f7ab4d2aa237639ac Mon Sep 17 00:00:00 2001
From: "Piotr Kosko/Tizen API (PLT) /SRPOL/Engineer/Samsung Electronics"
Date: Mon, 23 Jan 2023 14:43:27 +0100
Subject: [PATCH] [Sound] Deprecation of 'activation' concept and adding
'running' concept
[ACR] https://code.sec.samsung.net/jira/browse/TWDAPI-288
[Verification] TCT passrate 100%
Change-Id: Icae15c2e48f8157fb490925143fb16b25b0e966e
---
src/sound/sound_api.js | 9 ++++++++-
src/sound/sound_instance.cc | 5 +++++
src/sound/sound_manager.cc | 2 +-
3 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/sound/sound_api.js b/src/sound/sound_api.js
index fb0c376f..50de95e9 100644
--- a/src/sound/sound_api.js
+++ b/src/sound/sound_api.js
@@ -229,6 +229,12 @@ SoundManager.prototype.getConnectedDeviceList = function() {
};
SoundManager.prototype.getActivatedDeviceList = function() {
+ utils_.deprecationWarn(
+ 'getActivatedDeviceList() is deprecated and will be ' +
+ 'removed from next release. ' +
+ 'Use getRunningDeviceList() instead.',
+ '7.5'
+ );
var result = native_.callSync('SoundManagerGetActivatedDeviceList', {});
if (native_.isFailure(result)) {
throw native_.getErrorObject(result);
@@ -267,7 +273,8 @@ function SoundDeviceInfo(data) {
device: { value: data.device, writable: false, enumerable: true },
direction: { value: data.direction, writable: false, enumerable: true },
isConnected: { value: data.isConnected, writable: false, enumerable: true },
- isActivated: { value: data.isActivated, writable: false, enumerable: true }
+ isActivated: { value: data.isRunning, writable: false, enumerable: true }, // isActivated already uses isRunning concept for a while
+ isRunning: { value: data.isRunning, writable: false, enumerable: true }
});
}
diff --git a/src/sound/sound_instance.cc b/src/sound/sound_instance.cc
index a9e4462d..71214267 100644
--- a/src/sound/sound_instance.cc
+++ b/src/sound/sound_instance.cc
@@ -177,6 +177,11 @@ void SoundInstance::SoundManagerGetConnectedDeviceList(const picojson::value& ar
void SoundInstance::SoundManagerGetActivatedDeviceList(const picojson::value& args,
picojson::object& out) {
ScopeLogger();
+ DEPRECATION_WARN(
+ "'Activated' concept is deprecated and replated with 'running' concept. "
+ "getActivatedDeviceList() is deprecated and will be removed from next release."
+ "Use getConnectedDeviceList() instead and check isRunning property to get running devices.",
+ "7.5");
manager_.GetDeviceList((sound_device_mask_e)SOUND_DEVICE_STATE_DEPRECATED_ACTIVATED_MASK, out);
}
diff --git a/src/sound/sound_manager.cc b/src/sound/sound_manager.cc
index fcbe1691..23c8cdb1 100644
--- a/src/sound/sound_manager.cc
+++ b/src/sound/sound_manager.cc
@@ -514,7 +514,7 @@ PlatformResult SoundManager::GetDeviceInfo(sound_device_h device, bool is_connec
ErrorCode::UNKNOWN_ERR, "Getting device state failed",
("sound_manager_is_device_running error: %d (%s)", ret, get_error_message(ret)));
}
- obj->insert(std::make_pair("isActivated", picojson::value(state)));
+ obj->insert(std::make_pair("isRunning", picojson::value(state)));
// get connection
if (check_connection) {
--
2.34.1