Skip to content

Commit

Permalink
Merge pull request #5474 from sborushevsky/RDK-43262_24Q3_sprint
Browse files Browse the repository at this point in the history
RDK-43262 : Added getPrivacyMode/setPrivacyMode calls and rbus event.
  • Loading branch information
anand-ky authored Jul 2, 2024
2 parents 5b36bf3 + 81653e7 commit 32a05fb
Show file tree
Hide file tree
Showing 6 changed files with 412 additions and 184 deletions.
20 changes: 19 additions & 1 deletion UserSettings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,24 @@ add_library(${PLUGIN_IMPLEMENTATION} SHARED
UserSettingsImplementation.cpp
Module.cpp)


find_path(RBUS_API_HEADER NAMES rbus.h PATH_SUFFIXES rbus)

if (NOT ${RBUS_API_HEADER} STREQUAL "RBUS_API_HEADER-NOTFOUND")
message("Found rbus.h ${RBUS_API_HEADER}")
add_definitions (-DHAS_RBUS)
set(RBUS_API_HEADERS ${RBUS_API_HEADER})
find_library(RBUS_LIBRARY NAMES rbus)
endif()

set(RBUS_LIBRARIES "")
if (NOT ${RBUS_LIBRARY} STREQUAL "RBUS_LIBRARY-NOTFOUND")
set(RBUS_LIBRARIES ${RBUS_LIBRARY})
endif()


include_directories(
${RBUS_API_HEADERS}
../helpers)

set_target_properties(${PLUGIN_IMPLEMENTATION} PROPERTIES
Expand All @@ -59,7 +76,8 @@ set_target_properties(${PLUGIN_IMPLEMENTATION} PROPERTIES
target_link_libraries(${PLUGIN_IMPLEMENTATION}
PRIVATE
CompileSettingsDebug::CompileSettingsDebug
${NAMESPACE}Plugins::${NAMESPACE}Plugins)
${NAMESPACE}Plugins::${NAMESPACE}Plugins
${RBUS_LIBRARIES})

install(TARGETS ${PLUGIN_IMPLEMENTATION}
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/${STORAGE_DIRECTORY}/plugins)
Expand Down
6 changes: 6 additions & 0 deletions UserSettings/UserSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ namespace Plugin {
Exchange::JUserSettings::Event::OnPreferredClosedCaptionServiceChanged(_parent, service);
}

void OnPrivacyModeChanged(const string &privacyMode) override
{
LOGINFO("PrivacyModeChanged: %s\n", privacyMode.c_str());
Exchange::JUserSettings::Event::OnPrivacyModeChanged(_parent, privacyMode);
}

private:
UserSettings& _parent;
};
Expand Down
165 changes: 65 additions & 100 deletions UserSettings/UserSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,8 @@
"common": {
"$ref": "../common/common.json"
},
"definitions": {
"enabled": {
"summary": "Enabled (`true`) or disabled (`false`)",
"type": "boolean",
"example": false
},
"preferredLanguages": {
"summary": "A prioritized list of ISO 639-2/B codes for the preferred audio languages",
"type": "string",
"example": "eng"
},
"preferredCaptionsLanguages": {
"summary": "A prioritized list of ISO 639-2/B codes for the preferred captions languages",
"type": "string",
"example": "eng"
},
"preferredClosedCaptionService": {
"summary": "A string for the preferred closed captions service. Valid values are AUTO, CC[1-4], TEXT[1-4], SERVICE[1-64] where CC and TEXT is CTA-608 and SERVICE is CTA-708. AUTO indicates that the choice is left to the player",
"type": "string",
"example": "CC3"
},
"presentationLanguage": {
"summary": "The preferred presentationLanguages in a full BCP 47 value, including script, * region, variant The language set and used by Immerse UI",
"type": "string",
"example": "en-US"
}
},
"methods": {
"setaudiodescription": {
"SetAudioDescription": {
"summary": "Setting Audio Description.",
"params": {
"summary": "Audio Description Enabled: true/false",
Expand All @@ -50,7 +23,7 @@
"example": "null"
}
},
"setpreferredaudiolanguages": {
"SetPreferredAudioLanguages": {
"summary": "Setting Preferred Audio Languages.",
"params": {
"summary": "Preferred Audio Languages: eng, wel",
Expand All @@ -63,7 +36,7 @@
"example": "null"
}
},
"setpresentationlanguages": {
"SetPresentationLanguage": {
"summary": "Setting Presentation Languages.",
"params": {
"summary": "Presentation Languages: en-US, es-US",
Expand All @@ -76,7 +49,7 @@
"example": "null"
}
},
"setcaptionsenabled": {
"SetCaptions": {
"summary": "Setting Captions.",
"params": {
"summary": "Captions Enabled: true/false",
Expand All @@ -89,7 +62,7 @@
"example": "null"
}
},
"setpreferredcaptionlanguages": {
"SetPreferredCaptionsLanguages": {
"summary": "Setting PreferredCaption Languages.",
"params": {
"summary": "PreferredCaption Languages: eng, fra",
Expand All @@ -102,7 +75,7 @@
"example": "null"
}
},
"setpreferredclosedcaptionservice": {
"SetPreferredClosedCaptionService": {
"summary": "Setting Preferred Closed Caption Service.",
"params": {
"summary": "Preferred Closed Caption Service: CC3",
Expand All @@ -115,88 +88,64 @@
"example": "null"
}
},
"getaudiodescription":{
"summary": "Returns Audio Description.",
"result": {
"SetPrivacyMode": {
"summary": "Setting Privacy Mode.",
"params": {
"type": "object",
"properties": {
"enabled": {
"$ref": "#/definitions/enabled"
"privacyMode": {
"summary": "New Privacy Mode",
"type": "string",
"example": "DO_NOT_SHARE"
}
},
"required": [
"enabled"
]
}
},
"result": {
"summary": "Null string will display",
"type": "string",
"example": "null"
}
},
"getpreferredaudiolanguages":{
"GetAudioDescription":{
"summary": "Returns Audio Description.",
"result": {
"type": "object",
"properties": {
"preferredLanguages": {
"$ref": "#/definitions/preferredLanguages"
}
},
"required": [
"preferredLanguages"
]
"type": "boolean"
}
},
"GetPreferredAudioLanguages":{
"summary": "Returns Audio Description.",
"result": {
"type": "string"
}
},
"getpresentationlanguages":{
"GetPresentationLanguage":{
"summary": "Getting Presentation Languages.",
"result": {
"type": "object",
"properties": {
"presentationlanguages": {
"$ref": "#/definitions/presentationLanguage"
}
},
"required": [
"presentationlanguages"
]
"type": "string"
}
},
"getcaptionsenabled":{
"GetCaptions":{
"summary": "Getting Captions Enabled.",
"result": {
"type": "object",
"properties": {
"enabled": {
"$ref": "#/definitions/enabled"
}
},
"required": [
"enabled"
]
"type": "boolean"
}
},
"GetPreferredCaptionLanguages":{
"GetPreferredCaptionsLanguages":{
"summary": "Getting Preferred Caption Languages.",
"result": {
"type": "object",
"properties": {
"preferredLanguages": {
"$ref": "#/definitions/preferredCaptionsLanguages"
}
},
"required": [
"preferredLanguages"
]
"type": "string"
}
},
"GetPreferredClosedCaptionService":{
"summary": "Getting Preferred ClosedCaption Service.",
"result": {
"type": "object",
"properties": {
"preferredClosedCaptionService": {
"$ref": "#/definitions/preferredClosedCaptionService"
}
},
"required": [
"preferredClosedCaptionService"
]
"type": "string"
}
},
"GetPrivacyMode":{
"summary": "Getting Privacy Mode",
"result": {
"type": "string"
}
}
},
Expand All @@ -222,14 +171,14 @@
"params": {
"type": "object",
"properties": {
"PreferredAudioLanguagesChanged":{
"preferredLanguages":{
"summary": "Receive preferred Audio languages changes",
"type": "string",
"example": "eng"
}
},
"required": [
"PreferredAudioLanguagesChanged"
"preferredLanguages"
]
}
},
Expand All @@ -238,14 +187,14 @@
"params": {
"type": "object",
"properties": {
"PresentationLanguageChanged":{
"presentationLanguages":{
"summary": "Receive Presentation Language changes",
"type": "string",
"example": "en-US"
}
},
"required": [
"PresentationLanguageChanged"
"presentationLanguages"
]
}
},
Expand All @@ -270,14 +219,14 @@
"params": {
"type": "object",
"properties": {
"PreferredCaptionsLanguagesChanged":{
"preferredLanguages":{
"summary": "Receive PreferredCaption Languages changes",
"type": "string",
"example": "eng"
}
},
"required": [
"PreferredCaptionsLanguagesChanged"
"preferredLanguages"
]
}
},
Expand All @@ -286,14 +235,30 @@
"params": {
"type": "object",
"properties": {
"PreferredClosedCaptionServiceChanged":{
"service":{
"summary": "Receive Preferred Closed Caption changes",
"type": "string",
"example": "eng"
"example": "CC3"
}
},
"required": [
"service"
]
}
},
"OnPrivacyModeChanged": {
"summary": "Triggered after the Privacy Mode changes (see `SetPrivacyMode`)",
"params": {
"type": "object",
"properties": {
"privacyMode":{
"summary": "Receive Privacy Mode changes",
"type": "string",
"example": "DO_NOT_SHARE"
}
},
"required": [
"PreferredClosedCaptionServiceChanged"
"privacyMode"
]
}
}
Expand Down
Loading

0 comments on commit 32a05fb

Please sign in to comment.