[Sound] Deprecation of 'activation' concept and adding 'running' concept 85/287185/1
authorPiotr Kosko/Tizen API (PLT) /SRPOL/Engineer/Samsung Electronics <p.kosko@samsung.com>
Mon, 23 Jan 2023 13:43:27 +0000 (14:43 +0100)
committerPiotr Kosko/Tizen API (PLT) /SRPOL/Engineer/Samsung Electronics <p.kosko@samsung.com>
Mon, 23 Jan 2023 13:43:27 +0000 (14:43 +0100)
[ACR] https://code.sec.samsung.net/jira/browse/TWDAPI-288

[Verification] TCT passrate 100%

Change-Id: Icae15c2e48f8157fb490925143fb16b25b0e966e

src/sound/sound_api.js
src/sound/sound_instance.cc
src/sound/sound_manager.cc

index fb0c376..50de95e 100644 (file)
@@ -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 }
     });
 }
 
index a9e4462..7121426 100644 (file)
@@ -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);
 }
 
index fcbe169..23c8cdb 100644 (file)
@@ -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) {