[Mediacontroller] Removed usage of removed native API 86/193686/2
authorPiotr Kosko/Native/Web API (SWP) /SRPOL/Professional/삼성전자 <p.kosko@samsung.com>
Fri, 23 Nov 2018 07:54:51 +0000 (08:54 +0100)
committerPiotr Kosko/Native/Web API (SWP) /SRPOL/Professional/삼성전자 <p.kosko@samsung.com>
Fri, 23 Nov 2018 12:30:07 +0000 (13:30 +0100)
[Feature] As the native support for old enum values was removed,
  there is no need for using multimap in webapi code. It was changed
  regular map instead.

[Native ACR] According to removal of native API
  http://suprem.sec.samsung.net/jira/browse/ACR-1314 we need to
  remove native code which creates buildbreak.

[Verification] Code compiles without errors.
  TCT 100% passrate.

Change-Id: I5f23941f12b279b83079eb3d482d651c567fc847

src/mediacontroller/mediacontroller_server.cc
src/mediacontroller/mediacontroller_types.cc
src/mediacontroller/mediacontroller_types.h

index c161554..214b891 100644 (file)
@@ -284,7 +284,7 @@ PlatformResult MediaControllerServer::CommandReply(const std::string& client_nam
   if (MEDIA_CONTROLLER_ERROR_NONE != ret) {
     return LogAndCreateResult(
         ErrorCode::UNKNOWN_ERR, "Error sending command reply",
-        ("mc_server_send_command_reply() error: %d, message: %s", ret, get_error_message(ret)));
+        ("mc_server_send_cmd_reply() error: %d, message: %s", ret, get_error_message(ret)));
   }
 
   return PlatformResult(ErrorCode::NO_ERROR);
index 5b9689b..6c92df8 100644 (file)
@@ -41,16 +41,9 @@ const PlatformEnumMap Types::platform_enum_map_ = {{kMediaControllerServerState,
                                                     {{"PLAY", MC_PLAYBACK_STATE_PLAYING},
                                                      {"PAUSE", MC_PLAYBACK_STATE_PAUSED},
                                                      {"STOP", MC_PLAYBACK_STATE_STOPPED},
-                                                     // Deprecated values of MC_PLAYBACK_STATE enum
-                                                     // still have to be supported, because native
-                                                     // applications/API might still use them.
-                                                     {"NEXT", MC_PLAYBACK_STATE_NEXT_FILE},
                                                      {"NEXT", MC_PLAYBACK_STATE_MOVING_TO_NEXT},
-                                                     {"PREV", MC_PLAYBACK_STATE_PREV_FILE},
                                                      {"PREV", MC_PLAYBACK_STATE_MOVING_TO_PREVIOUS},
-                                                     {"FORWARD", MC_PLAYBACK_STATE_FAST_FORWARD},
                                                      {"FORWARD", MC_PLAYBACK_STATE_FAST_FORWARDING},
-                                                     {"REWIND", MC_PLAYBACK_STATE_REWIND},
                                                      {"REWIND", MC_PLAYBACK_STATE_REWINDING}}},
                                                    {kMediaControllerPlaybackAction,
                                                     {{"PLAY", MC_PLAYBACK_ACTION_PLAY},
@@ -76,7 +69,7 @@ const PlatformEnumMap Types::platform_enum_map_ = {{kMediaControllerServerState,
 PlatformEnumReverseMap Types::platform_enum_reverse_map_ = {};
 
 PlatformResult Types::GetPlatformEnumMap(const std::string& type,
-                                         std::multimap<std::string, int> const** enum_map) {
+                                         std::map<std::string, int> const** enum_map) {
   ScopeLogger();
 
   auto iter = platform_enum_map_.find(type);
@@ -94,7 +87,7 @@ PlatformResult Types::StringToPlatformEnum(const std::string& type, const std::s
                                            int* platform_enum) {
   ScopeLogger();
 
-  std::multimap<std::string, int> const* def = nullptr;
+  std::map<std::string, int> const* def = nullptr;
   PlatformResult result = GetPlatformEnumMap(type, &def);
   if (!result) {
     return result;
@@ -187,7 +180,7 @@ PlatformResult Types::ConvertPlaybackPosition(mc_playback_h playback_h, double*
 PlatformResult Types::ConvertMetadata(mc_metadata_h metadata_h, picojson::object* metadata) {
   ScopeLogger();
 
-  std::multimap<std::string, int> const* metadata_fields = nullptr;
+  std::map<std::string, int> const* metadata_fields = nullptr;
   PlatformResult result =
       GetPlatformEnumMap(Types::kMediaControllerMetadataAttribute, &metadata_fields);
   if (!result) {
index 57e5920..8aaa0f8 100644 (file)
@@ -27,7 +27,7 @@
 namespace extension {
 namespace mediacontroller {
 
-typedef std::map<std::string, std::multimap<std::string, int>> PlatformEnumMap;
+typedef std::map<std::string, std::map<std::string, int>> PlatformEnumMap;
 typedef std::map<std::string, std::map<int, std::string>> PlatformEnumReverseMap;
 typedef std::function<void(picojson::value*)> JsonCallback;
 
@@ -39,7 +39,7 @@ class Types {
   static const std::string kMediaControllerMetadataAttribute;
 
   static common::PlatformResult GetPlatformEnumMap(
-      const std::string& type, std::multimap<std::string, int> const** platform_str);
+      const std::string& type, std::map<std::string, int> const** platform_str);
 
   static common::PlatformResult StringToPlatformEnum(const std::string& type,
                                                      const std::string& value, int* platform_enum);