diff --git a/UserSettings/CMakeLists.txt b/UserSettings/CMakeLists.txt index 02f848239a..e0c39d2e71 100755 --- a/UserSettings/CMakeLists.txt +++ b/UserSettings/CMakeLists.txt @@ -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 @@ -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) diff --git a/UserSettings/UserSettings.h b/UserSettings/UserSettings.h index cdc83d4312..7ad29fd87e 100755 --- a/UserSettings/UserSettings.h +++ b/UserSettings/UserSettings.h @@ -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; }; diff --git a/UserSettings/UserSettings.json b/UserSettings/UserSettings.json index 3e01c6b911..c49993d204 100755 --- a/UserSettings/UserSettings.json +++ b/UserSettings/UserSettings.json @@ -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", @@ -50,7 +23,7 @@ "example": "null" } }, - "setpreferredaudiolanguages": { + "SetPreferredAudioLanguages": { "summary": "Setting Preferred Audio Languages.", "params": { "summary": "Preferred Audio Languages: eng, wel", @@ -63,7 +36,7 @@ "example": "null" } }, - "setpresentationlanguages": { + "SetPresentationLanguage": { "summary": "Setting Presentation Languages.", "params": { "summary": "Presentation Languages: en-US, es-US", @@ -76,7 +49,7 @@ "example": "null" } }, - "setcaptionsenabled": { + "SetCaptions": { "summary": "Setting Captions.", "params": { "summary": "Captions Enabled: true/false", @@ -89,7 +62,7 @@ "example": "null" } }, - "setpreferredcaptionlanguages": { + "SetPreferredCaptionsLanguages": { "summary": "Setting PreferredCaption Languages.", "params": { "summary": "PreferredCaption Languages: eng, fra", @@ -102,7 +75,7 @@ "example": "null" } }, - "setpreferredclosedcaptionservice": { + "SetPreferredClosedCaptionService": { "summary": "Setting Preferred Closed Caption Service.", "params": { "summary": "Preferred Closed Caption Service: CC3", @@ -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" } } }, @@ -222,14 +171,14 @@ "params": { "type": "object", "properties": { - "PreferredAudioLanguagesChanged":{ + "preferredLanguages":{ "summary": "Receive preferred Audio languages changes", "type": "string", "example": "eng" } }, "required": [ - "PreferredAudioLanguagesChanged" + "preferredLanguages" ] } }, @@ -238,14 +187,14 @@ "params": { "type": "object", "properties": { - "PresentationLanguageChanged":{ + "presentationLanguages":{ "summary": "Receive Presentation Language changes", "type": "string", "example": "en-US" } }, "required": [ - "PresentationLanguageChanged" + "presentationLanguages" ] } }, @@ -270,14 +219,14 @@ "params": { "type": "object", "properties": { - "PreferredCaptionsLanguagesChanged":{ + "preferredLanguages":{ "summary": "Receive PreferredCaption Languages changes", "type": "string", "example": "eng" } }, "required": [ - "PreferredCaptionsLanguagesChanged" + "preferredLanguages" ] } }, @@ -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" ] } } diff --git a/UserSettings/UserSettingsImplementation.cpp b/UserSettings/UserSettingsImplementation.cpp index 5dd186fd0b..ea0629b1e8 100755 --- a/UserSettings/UserSettingsImplementation.cpp +++ b/UserSettings/UserSettingsImplementation.cpp @@ -31,6 +31,12 @@ #define USERSETTINGS_CAPTIONS_KEY "captions" #define USERSETTINGS_PREFERRED_CAPTIONS_LANGUAGES_KEY "preferredCaptionsLanguages" #define USERSETTINGS_PREFERRED_CLOSED_CAPTIONS_SERVICE_KEY "preferredClosedCaptionsService" +#define USERSETTINGS_PRIVACY_MODE_KEY "privacyMode" + +#ifdef HAS_RBUS +#define RBUS_COMPONENT_NAME "UserSettingsThunderPlugin" +#define RBUS_PRIVACY_MODE_EVENT_NAME "Device.X_RDKCENTRAL-COM_UserSettings.PrivacyModeChanged" +#endif namespace WPEFramework { namespace Plugin { @@ -45,6 +51,9 @@ UserSettingsImplementation::UserSettingsImplementation() , _remotStoreObject(nullptr) , _storeNotification(*this) , _registeredEventHandlers(false) +#ifdef HAS_RBUS +, _rbusHandleStatus(RBUS_ERROR_NOT_INITIALIZED) +#endif { LOGINFO("Create UserSettingsImplementation Instance"); @@ -122,6 +131,15 @@ UserSettingsImplementation::~UserSettingsImplementation() _remotStoreObject->Release(); } _registeredEventHandlers = false; + +#ifdef HAS_RBUS + if (RBUS_ERROR_SUCCESS == _rbusHandleStatus) + { + rbus_close(_rbusHandle); + _rbusHandleStatus = RBUS_ERROR_NOT_INITIALIZED; + } + +#endif } void UserSettingsImplementation::registerEventHandlers() @@ -246,6 +264,14 @@ void UserSettingsImplementation::Dispatch(Event event, const JsonValue params) } break; + case PRIVACY_MODE_CHANGED: + while (index != _userSettingNotification.end()) + { + (*index)->OnPrivacyModeChanged(params.String()); + ++index; + } + break; + default: break; } @@ -281,6 +307,10 @@ void UserSettingsImplementation::ValueChanged(const Exchange::IStore2::ScopeType { dispatchEvent(PREFERRED_CLOSED_CAPTIONS_SERVICE_CHANGED, JsonValue((string)value)); } + else if((ns.compare(USERSETTINGS_NAMESPACE) == 0) && (key.compare(USERSETTINGS_PRIVACY_MODE_KEY) == 0)) + { + dispatchEvent(PRIVACY_MODE_CHANGED, JsonValue((string)value)); + } else { LOGERR("Not supported"); @@ -550,5 +580,99 @@ uint32_t UserSettingsImplementation::GetPreferredClosedCaptionService(string &se return status; } + +uint32_t UserSettingsImplementation::SetPrivacyMode(const string& privacyMode) +{ + uint32_t status = Core::ERROR_GENERAL; + + LOGINFO("privacyMode: %s", privacyMode.c_str()); + + if (privacyMode != "SHARE" && privacyMode != "DO_NOT_SHARE") + { + LOGERR("Wrong privacyMode value: '%s', returning default", privacyMode.c_str()); + return status; + } + + _adminLock.Lock(); + + ASSERT (nullptr != _remotStoreObject); + + if (nullptr != _remotStoreObject) + { + uint32_t ttl = 0; + string oldPrivacyMode; + status = _remotStoreObject->GetValue(Exchange::IStore2::ScopeType::DEVICE, USERSETTINGS_NAMESPACE, USERSETTINGS_PRIVACY_MODE_KEY, oldPrivacyMode, ttl); + LOGINFO("oldPrivacyMode: %s", oldPrivacyMode.c_str()); + + if (privacyMode != oldPrivacyMode) + { +#ifdef HAS_RBUS + if (Core::ERROR_NONE == status) + { + if (RBUS_ERROR_SUCCESS != _rbusHandleStatus) + { + _rbusHandleStatus = rbus_open(&_rbusHandle, RBUS_COMPONENT_NAME); + } + + if (RBUS_ERROR_SUCCESS == _rbusHandleStatus) + { + rbusValue_t value; + rbusSetOptions_t opts = {true, 0}; + + rbusValue_Init(&value); + rbusValue_SetString(value, privacyMode.c_str()); + int rc = rbus_set(_rbusHandle, RBUS_PRIVACY_MODE_EVENT_NAME, value, &opts); + if (rc != RBUS_ERROR_SUCCESS) + { + std::stringstream str; + str << "Failed to set property " << RBUS_PRIVACY_MODE_EVENT_NAME << ": " << rc; + LOGERR("%s", str.str().c_str()); + } + rbusValue_Release(value); + } + else + { + std::stringstream str; + str << "rbus_open failed with error code " << _rbusHandleStatus; + LOGERR("%s", str.str().c_str()); + } + } +#endif + status = _remotStoreObject->SetValue(Exchange::IStore2::ScopeType::DEVICE, USERSETTINGS_NAMESPACE, USERSETTINGS_PRIVACY_MODE_KEY, privacyMode, 0); + } + } + + _adminLock.Unlock(); + + return status; +} + +uint32_t UserSettingsImplementation::GetPrivacyMode(string &privacyMode) const +{ + uint32_t status = Core::ERROR_NONE; + std::string value = ""; + uint32_t ttl = 0; + privacyMode = ""; + + _adminLock.Lock(); + + ASSERT (nullptr != _remotStoreObject); + + if (nullptr != _remotStoreObject) + { + _remotStoreObject->GetValue(Exchange::IStore2::ScopeType::DEVICE, USERSETTINGS_NAMESPACE, USERSETTINGS_PRIVACY_MODE_KEY, privacyMode, ttl); + } + + _adminLock.Unlock(); + + if (privacyMode != "SHARE" && privacyMode != "DO_NOT_SHARE") + { + LOGWARN("Wrong privacyMode value: '%s', returning default", privacyMode.c_str()); + privacyMode = "SHARE"; + } + + return status; +} + } // namespace Plugin } // namespace WPEFramework diff --git a/UserSettings/UserSettingsImplementation.h b/UserSettings/UserSettingsImplementation.h index 83d967627b..d2cb8169ed 100755 --- a/UserSettings/UserSettingsImplementation.h +++ b/UserSettings/UserSettingsImplementation.h @@ -30,6 +30,10 @@ #include #include +#ifdef HAS_RBUS +#include "rbus.h" +#endif + namespace WPEFramework { namespace Plugin { class UserSettingsImplementation : public Exchange::IUserSettings{ @@ -82,7 +86,8 @@ namespace Plugin { PRESENTATION_LANGUAGE_CHANGED, CAPTIONS_CHANGED, PREFERRED_CAPTIONS_LANGUAGE_CHANGED, - PREFERRED_CLOSED_CAPTIONS_SERVICE_CHANGED + PREFERRED_CLOSED_CAPTIONS_SERVICE_CHANGED, + PRIVACY_MODE_CHANGED }; class EXTERNAL Job : public Core::IDispatch { @@ -139,6 +144,8 @@ namespace Plugin { uint32_t GetPreferredCaptionsLanguages(string &preferredLanguages) const override; uint32_t SetPreferredClosedCaptionService(const string& service) override; uint32_t GetPreferredClosedCaptionService(string &service) const override; + uint32_t SetPrivacyMode(const string& privacyMode) override; + uint32_t GetPrivacyMode(string &privacyMode) const override; void registerEventHandlers(); void ValueChanged(const Exchange::IStore2::ScopeType scope, const string& ns, const string& key, const string& value); @@ -153,6 +160,10 @@ namespace Plugin { Core::Sink _storeNotification; bool _registeredEventHandlers; +#ifdef HAS_RBUS + rbusError_t _rbusHandleStatus; + rbusHandle_t _rbusHandle; +#endif void dispatchEvent(Event, const JsonValue ¶ms); void Dispatch(Event event, const JsonValue params); diff --git a/docs/api/UserSettingsPlugin.md b/docs/api/UserSettingsPlugin.md index 0b12ac820e..c422dbc281 100755 --- a/docs/api/UserSettingsPlugin.md +++ b/docs/api/UserSettingsPlugin.md @@ -47,22 +47,24 @@ UserSettings interface methods: | Method | Description | | :-------- | :-------- | -| [setaudiodescription](#setaudiodescription) | Setting Audio Description | -| [setpreferredaudiolanguages](#setpreferredaudiolanguages) | Setting Preferred Audio Languages | -| [setpresentationlanguages](#setpresentationlanguages) | Setting Presentation Languages | -| [setcaptionsenabled](#setcaptionsenabled) | Setting Captions | -| [setpreferredcaptionlanguages](#setpreferredcaptionlanguages) | Setting PreferredCaption Languages | -| [setpreferredclosedcaptionservice](#setpreferredclosedcaptionservice) | Setting Preferred Closed Caption Service | -| [getaudiodescription](#getaudiodescription) | Returns Audio Description | -| [getpreferredaudiolanguages](#getpreferredaudiolanguages) | Returns Audio Description | -| [getpresentationlanguages](#getpresentationlanguages) | Getting Presentation Languages | -| [getcaptionsenabled](#getcaptionsenabled) | Getting Captions Enabled | -| [GetPreferredCaptionLanguages](#GetPreferredCaptionLanguages) | Getting Preferred Caption Languages | +| [SetAudioDescription](#SetAudioDescription) | Setting Audio Description | +| [SetPreferredAudioLanguages](#SetPreferredAudioLanguages) | Setting Preferred Audio Languages | +| [SetPresentationLanguage](#SetPresentationLanguage) | Setting Presentation Languages | +| [SetCaptions](#SetCaptions) | Setting Captions | +| [SetPreferredCaptionsLanguages](#SetPreferredCaptionsLanguages) | Setting PreferredCaption Languages | +| [SetPreferredClosedCaptionService](#SetPreferredClosedCaptionService) | Setting Preferred Closed Caption Service | +| [SetPrivacyMode](#SetPrivacyMode) | Setting PrivacyMode | +| [GetAudioDescription](#GetAudioDescription) | Returns Audio Description | +| [GetPreferredAudioLanguages](#GetPreferredAudioLanguages) | Returns Audio Description | +| [GetPresentationLanguage](#GetPresentationLanguage) | Getting Presentation Languages | +| [GetCaptions](#GetCaptions) | Getting Captions Enabled | +| [GetPreferredCaptionsLanguages](#GetPreferredCaptionsLanguages) | Getting Preferred Caption Languages | | [GetPreferredClosedCaptionService](#GetPreferredClosedCaptionService) | Getting Preferred ClosedCaption Service | +| [GetPrivacyMode](#GetPrivacyMode) | Getting PrivacyMode | - -## *setaudiodescription* + +## *SetAudioDescription* Setting Audio Description. @@ -90,7 +92,7 @@ No Events { "jsonrpc": "2.0", "id": 42, - "method": "org.rdk.UserSettings.setaudiodescription", + "method": "org.rdk.UserSettings.SetAudioDescription", "params": true } ``` @@ -105,8 +107,8 @@ No Events } ``` - -## *setpreferredaudiolanguages* + +## *SetPreferredAudioLanguages* Setting Preferred Audio Languages. @@ -134,7 +136,7 @@ No Events { "jsonrpc": "2.0", "id": 42, - "method": "org.rdk.UserSettings.setpreferredaudiolanguages", + "method": "org.rdk.UserSettings.SetPreferredAudioLanguages", "params": "eng" } ``` @@ -149,8 +151,8 @@ No Events } ``` - -## *setpresentationlanguages* + +## *SetPresentationLanguage* Setting Presentation Languages. @@ -178,7 +180,7 @@ No Events { "jsonrpc": "2.0", "id": 42, - "method": "org.rdk.UserSettings.setpresentationlanguages", + "method": "org.rdk.UserSettings.SetPresentationLanguage", "params": "en-US" } ``` @@ -193,8 +195,8 @@ No Events } ``` - -## *setcaptionsenabled* + +## *SetCaptions* Setting Captions. @@ -222,7 +224,7 @@ No Events { "jsonrpc": "2.0", "id": 42, - "method": "org.rdk.UserSettings.setcaptionsenabled", + "method": "org.rdk.UserSettings.SetCaptions", "params": true } ``` @@ -237,8 +239,8 @@ No Events } ``` - -## *setpreferredcaptionlanguages* + +## *SetPreferredCaptionsLanguages* Setting PreferredCaption Languages. @@ -266,7 +268,7 @@ No Events { "jsonrpc": "2.0", "id": 42, - "method": "org.rdk.UserSettings.setpreferredcaptionlanguages", + "method": "org.rdk.UserSettings.SetPreferredCaptionsLanguages", "params": "eng" } ``` @@ -281,8 +283,8 @@ No Events } ``` - -## *setpreferredclosedcaptionservice* + +## *SetPreferredClosedCaptionService* Setting Preferred Closed Caption Service. @@ -310,7 +312,7 @@ No Events { "jsonrpc": "2.0", "id": 42, - "method": "org.rdk.UserSettings.setpreferredclosedcaptionservice", + "method": "org.rdk.UserSettings.SetPreferredClosedCaptionService", "params": "CC3" } ``` @@ -325,8 +327,56 @@ No Events } ``` - -## *getaudiodescription* + +## *SetPrivacyMode* + +Setting PrivacyMode + +### Events + +No Events + +### Parameters + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.privacyMode | string | PrivacyMode: SHARE or DO_NOT_SHARE | + + +### Result + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result | string | Null string will display | + +### Example + +#### Request + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "method": "org.rdk.UserSettings.SetPrivacyMode", + "params": { + {"privacyMode":"DO_NOT_SHARE"} + } +} +``` + +#### Response + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "result": "null" +} +``` + + +## *GetAudioDescription* Returns Audio Description. @@ -353,7 +403,7 @@ This method takes no parameters. { "jsonrpc": "2.0", "id": 42, - "method": "org.rdk.UserSettings.getaudiodescription" + "method": "org.rdk.UserSettings.GetAudioDescription" } ``` @@ -363,14 +413,12 @@ This method takes no parameters. { "jsonrpc": "2.0", "id": 42, - "result": { - "enabled": false - } + "result":false } ``` - -## *getpreferredaudiolanguages* + +## *GetPreferredAudioLanguages* Returns Audio Description. @@ -397,7 +445,7 @@ This method takes no parameters. { "jsonrpc": "2.0", "id": 42, - "method": "org.rdk.UserSettings.getpreferredaudiolanguages" + "method": "org.rdk.UserSettings.GetPreferredAudioLanguages" } ``` @@ -407,14 +455,12 @@ This method takes no parameters. { "jsonrpc": "2.0", "id": 42, - "result": { - "preferredLanguages": "eng" - } + "result":"eng" } ``` - -## *getpresentationlanguages* + +## *GetPresentationLanguage* Getting Presentation Languages. @@ -441,7 +487,7 @@ This method takes no parameters. { "jsonrpc": "2.0", "id": 42, - "method": "org.rdk.UserSettings.getpresentationlanguages" + "method": "org.rdk.UserSettings.GetPresentationLanguage" } ``` @@ -451,14 +497,12 @@ This method takes no parameters. { "jsonrpc": "2.0", "id": 42, - "result": { - "presentationlanguages": "en-US" - } + "result":"en-US" } ``` - -## *getcaptionsenabled* + +## *GetCaptions* Getting Captions Enabled. @@ -485,7 +529,7 @@ This method takes no parameters. { "jsonrpc": "2.0", "id": 42, - "method": "org.rdk.UserSettings.getcaptionsenabled" + "method": "org.rdk.UserSettings.GetCaptions" } ``` @@ -495,14 +539,12 @@ This method takes no parameters. { "jsonrpc": "2.0", "id": 42, - "result": { - "enabled": false - } + "result":false } ``` - -## *GetPreferredCaptionLanguages* + +## *GetPreferredCaptionsLanguages* Getting Preferred Caption Languages. @@ -529,7 +571,7 @@ This method takes no parameters. { "jsonrpc": "2.0", "id": 42, - "method": "org.rdk.UserSettings.GetPreferredCaptionLanguages" + "method": "org.rdk.UserSettings.GetPreferredCaptionsLanguages" } ``` @@ -539,9 +581,7 @@ This method takes no parameters. { "jsonrpc": "2.0", "id": 42, - "result": { - "preferredLanguages": "eng" - } + "result":"eng" } ``` @@ -583,9 +623,49 @@ This method takes no parameters. { "jsonrpc": "2.0", "id": 42, - "result": { - "preferredClosedCaptionService": "CC3" - } + "result":"CC3" +} +``` + + +## *GetPrivacyMode* + +Getting PrivacyMode + +### Events + +No Events + +### Parameters + +This method takes no parameters. + +### Result + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result | object | | +| result.privacymode | string | A string for the privacy mode. Valid values are SHARE(Default), DO_NOT_SHARE. | + +### Example + +#### Request + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "method": "org.rdk.UserSettings.GetPrivacyMode" +} +``` + +#### Response + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "result":"SHARE" } ``` @@ -600,18 +680,19 @@ UserSettings interface events: | Event | Description | | :-------- | :-------- | -| [OnAudioDescriptionChanged](#OnAudioDescriptionChanged) | Triggered after the audio description changes (see `setaudiodescription`) | -| [OnPreferredAudioLanguagesChanged](#OnPreferredAudioLanguagesChanged) | Triggered after the audio preferred Audio languages changes (see `setpreferredaudiolanguages`) | -| [OnPresentationLanguageChanged](#OnPresentationLanguageChanged) | Triggered after the Presentation Language changes (see `setpresentationlanguages`) | -| [OnCaptionsChanged](#OnCaptionsChanged) | Triggered after the captions changes (see `setcaptionsenabled`) | -| [OnPreferredCaptionsLanguagesChanged](#OnPreferredCaptionsLanguagesChanged) | Triggered after the PreferredCaption Languages changes (see `setpreferredcaptionlanguages`) | -| [OnPreferredClosedCaptionServiceChanged](#OnPreferredClosedCaptionServiceChanged) | Triggered after the Preferred Closed Caption changes (see `setpreferredclosedcaptionservice`) | +| [OnAudioDescriptionChanged](#OnAudioDescriptionChanged) | Triggered after the audio description changes (see `SetAudioDescription`) | +| [OnPreferredAudioLanguagesChanged](#OnPreferredAudioLanguagesChanged) | Triggered after the audio preferred Audio languages changes (see `SetPreferredAudioLanguages`) | +| [OnPresentationLanguageChanged](#OnPresentationLanguageChanged) | Triggered after the Presentation Language changes (see `SetPresentationLanguage`) | +| [OnCaptionsChanged](#OnCaptionsChanged) | Triggered after the captions changes (see `SetCaptions`) | +| [OnPreferredCaptionsLanguagesChanged](#OnPreferredCaptionsLanguagesChanged) | Triggered after the PreferredCaption Languages changes (see `SetPreferredCaptionsLanguages`) | +| [OnPreferredClosedCaptionServiceChanged](#OnPreferredClosedCaptionServiceChanged) | Triggered after the Preferred Closed Caption changes (see `SetPreferredClosedCaptionService`) | +| [OnPrivacyModeChanged](#OnPrivacyModeChanged) | Triggered after the Privacy Mode changes (see `SetPrivacyMode`) | ## *OnAudioDescriptionChanged* -Triggered after the audio description changes (see `setaudiodescription`). +Triggered after the audio description changes (see `SetAudioDescription`). ### Parameters @@ -635,14 +716,14 @@ Triggered after the audio description changes (see `setaudiodescription`). ## *OnPreferredAudioLanguagesChanged* -Triggered after the audio preferred Audio languages changes (see `setpreferredaudiolanguages`). +Triggered after the audio preferred Audio languages changes (see `SetPreferredAudioLanguages`). ### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.PreferredAudioLanguagesChanged | string | Receive preferred Audio languages changes | +| params.preferredLanguages | string | Receive preferred Audio languages changes | ### Example @@ -651,7 +732,7 @@ Triggered after the audio preferred Audio languages changes (see `setpreferredau "jsonrpc": "2.0", "method": "client.events.OnPreferredAudioLanguagesChanged", "params": { - "PreferredAudioLanguagesChanged": "eng" + "preferredLanguages": "eng" } } ``` @@ -659,14 +740,14 @@ Triggered after the audio preferred Audio languages changes (see `setpreferredau ## *OnPresentationLanguageChanged* -Triggered after the Presentation Language changes (see `setpresentationlanguages`). +Triggered after the Presentation Language changes (see `SetPresentationLanguage`). ### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.PresentationLanguageChanged | string | Receive Presentation Language changes | +| params.presentationLanguages | string | Receive Presentation Language changes | ### Example @@ -675,7 +756,7 @@ Triggered after the Presentation Language changes (see `setpresentationlanguages "jsonrpc": "2.0", "method": "client.events.OnPresentationLanguageChanged", "params": { - "PresentationLanguageChanged": "en-US" + "presentationLanguages": "en-US" } } ``` @@ -683,7 +764,7 @@ Triggered after the Presentation Language changes (see `setpresentationlanguages ## *OnCaptionsChanged* -Triggered after the captions changes (see `setcaptionsenabled`). +Triggered after the captions changes (see `SetCaptions`). ### Parameters @@ -707,14 +788,14 @@ Triggered after the captions changes (see `setcaptionsenabled`). ## *OnPreferredCaptionsLanguagesChanged* -Triggered after the PreferredCaption Languages changes (see `setpreferredcaptionlanguages`). +Triggered after the PreferredCaption Languages changes (see `SetPreferredCaptionsLanguages`). ### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.PreferredCaptionsLanguagesChanged | string | Receive PreferredCaption Languages changes | +| params.preferredLanguages | string | Receive PreferredCaption Languages changes | ### Example @@ -723,7 +804,7 @@ Triggered after the PreferredCaption Languages changes (see `setpreferredcaption "jsonrpc": "2.0", "method": "client.events.OnPreferredCaptionsLanguagesChanged", "params": { - "PreferredCaptionsLanguagesChanged": "eng" + "preferredLanguages": "eng" } } ``` @@ -731,14 +812,14 @@ Triggered after the PreferredCaption Languages changes (see `setpreferredcaption ## *OnPreferredClosedCaptionServiceChanged* -Triggered after the Preferred Closed Caption changes (see `setpreferredclosedcaptionservice`). +Triggered after the Preferred Closed Caption changes (see `SetPreferredClosedCaptionService`). ### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.PreferredClosedCaptionServiceChanged | string | Receive Preferred Closed Caption changes | +| params.service | string | Receive Preferred Closed Caption changes | ### Example @@ -747,8 +828,31 @@ Triggered after the Preferred Closed Caption changes (see `setpreferredclosedcap "jsonrpc": "2.0", "method": "client.events.OnPreferredClosedCaptionServiceChanged", "params": { - "PreferredClosedCaptionServiceChanged": "eng" + "service": "CC3" } } ``` + +## *OnPrivacyModeChanged [event](#head.Notifications)* + +Triggered after the Privacy Mode changes (see `SetPrivacyMode`). + +### Parameters + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.privacyMode | string | Receive Privacy Mode changes | + +### Example + +```json +{ + "jsonrpc": "2.0", + "method": "client.events.OnPrivacyModeChanged", + "params": { + "privacyMode": "DO_NOT_SHARE" + } +} +```