From 540336db0d1c61cf4857a5757f33f018c70358fa Mon Sep 17 00:00:00 2001 From: Dosakayala Nagalakshmi Date: Fri, 20 Dec 2024 19:34:34 +0530 Subject: [PATCH] SERXIONE-6655: Xumo Content Store - Age Ratings --- .../tests/UserSettings_L2Test.cpp | 107 +++--- ...V-48604-User-Settings-Thunder-Plugin.patch | 60 +-- UserSettings/UserSettings.h | 30 +- UserSettings/UserSettings.json | 76 ++-- UserSettings/UserSettingsImplementation.cpp | 62 ++-- UserSettings/UserSettingsImplementation.h | 20 +- docs/api/UserSettingsPlugin.md | 342 +++++++++--------- 7 files changed, 351 insertions(+), 346 deletions(-) diff --git a/Tests/L2Tests/L2TestsPlugin/tests/UserSettings_L2Test.cpp b/Tests/L2Tests/L2TestsPlugin/tests/UserSettings_L2Test.cpp index 2807054a33..5098036333 100755 --- a/Tests/L2Tests/L2TestsPlugin/tests/UserSettings_L2Test.cpp +++ b/Tests/L2Tests/L2TestsPlugin/tests/UserSettings_L2Test.cpp @@ -51,13 +51,14 @@ class AsyncHandlerMock_UserSetting MOCK_METHOD(void, onPreferredCaptionsLanguagesChanged, (const string preferredLanguages)); MOCK_METHOD(void, onPreferredClosedCaptionServiceChanged, (const string service)); MOCK_METHOD(void, onPrivacyModeChanged, (const string privacyMode)); - MOCK_METHOD(void, onPinControlChanged, (const bool enabled)); + MOCK_METHOD(void, onPinControlChanged, (const bool pinControl)); MOCK_METHOD(void, onViewingRestrictionsChanged, (const string viewingRestrictions)); MOCK_METHOD(void, onViewingRestrictionsWindowChanged, (const string viewingRestrictionsWindow)); - MOCK_METHOD(void, onLiveWatershedChanged, (const bool enabled)); - MOCK_METHOD(void, onPlaybackWatershedChanged, (const bool enabled)); - MOCK_METHOD(void, onBlockNotRatedContentChanged, (const bool enabled)); - MOCK_METHOD(void, onPinOnPurchaseChanged, (const bool enabled)); + MOCK_METHOD(void, onLiveWatershedChanged, (const bool liveWatershed)); + MOCK_METHOD(void, onPlaybackWatershedChanged, (const bool playbackWatershed)); + MOCK_METHOD(void, onBlockNotRatedContentChanged, (const bool blockNotRatedContent)); + MOCK_METHOD(void, onPinOnPurchaseChanged, (const bool pinOnPurchase)); + }; class NotificationHandler : public Exchange::IUserSettings::INotification { @@ -162,11 +163,11 @@ class NotificationHandler : public Exchange::IUserSettings::INotification { m_condition_variable.notify_one(); } - void OnPinControlChanged(const bool enabled) override + void OnPinControlChanged(const bool pinControl) override { TEST_LOG("OnPinControlChanged event triggered ***\n"); std::unique_lock lock(m_mutex); - std::string str = enabled ? "true" : "false"; + std::string str = pinControl ? "true" : "false"; TEST_LOG("OnPinControlChanged received: %s\n", str.c_str()); /* Notify the requester thread. */ @@ -198,11 +199,11 @@ class NotificationHandler : public Exchange::IUserSettings::INotification { } - void OnLiveWatershedChanged(const bool enabled) override + void OnLiveWatershedChanged(const bool liveWatershed) override { TEST_LOG("OnLiveWatershedChanged event triggered ***\n"); std::unique_lock lock(m_mutex); - std::string str = enabled ? "true" : "false"; + std::string str = liveWatershed ? "true" : "false"; TEST_LOG("OnLiveWatershedChanged received: %s\n", str.c_str()); /* Notify the requester thread. */ @@ -210,11 +211,11 @@ class NotificationHandler : public Exchange::IUserSettings::INotification { m_condition_variable.notify_one(); } - void OnPlaybackWatershedChanged(const bool enabled) override + void OnPlaybackWatershedChanged(const bool playbackWatershed) override { TEST_LOG("OnPlaybackWatershedChanged event triggered ***\n"); std::unique_lock lock(m_mutex); - std::string str = enabled ? "true" : "false"; + std::string str = playbackWatershed ? "true" : "false"; TEST_LOG("OnPlaybackWatershedChanged received: %s\n", str.c_str()); /* Notify the requester thread. */ @@ -222,11 +223,11 @@ class NotificationHandler : public Exchange::IUserSettings::INotification { m_condition_variable.notify_one(); } - void OnBlockNotRatedContentChanged(const bool enabled) override + void OnBlockNotRatedContentChanged(const bool blockNotRatedContent) override { TEST_LOG("OnBlockNotRatedContentChanged event triggered ***\n"); std::unique_lock lock(m_mutex); - std::string str = enabled ? "true" : "false"; + std::string str = blockNotRatedContent ? "true" : "false"; TEST_LOG("OnBlockNotRatedContentChanged received: %s\n", str.c_str()); /* Notify the requester thread. */ @@ -234,11 +235,11 @@ class NotificationHandler : public Exchange::IUserSettings::INotification { m_condition_variable.notify_one(); } - void OnPinOnPurchaseChanged(const bool enabled) override + void OnPinOnPurchaseChanged(const bool pinOnPurchase) override { TEST_LOG("OnPinOnPurchaseChanged event triggered ***\n"); std::unique_lock lock(m_mutex); - std::string str = enabled ? "true" : "false"; + std::string str = pinOnPurchase ? "true" : "false"; TEST_LOG("OnPinOnPurchaseChanged received: %s\n", str.c_str()); /* Notify the requester thread. */ @@ -280,13 +281,13 @@ class UserSettingTest : public L2TestMocks { void onCaptionsChanged(bool enabled); void onPreferredCaptionsLanguagesChanged(const string preferredLanguages); void onPreferredClosedCaptionServiceChanged(const string service); - void onPinControlChanged(const bool enabled); + void onPinControlChanged(const bool pinControl); void onViewingRestrictionsChanged(const string viewingRestrictions); void onViewingRestrictionsWindowChanged(const string viewingRestrictionsWindow); - void onLiveWatershedChanged(const bool enabled); - void onPlaybackWatershedChanged(const bool enabled); - void onBlockNotRatedContentChanged(const bool enabled); - void onPinOnPurchaseChanged(const bool enabled); + void onLiveWatershedChanged(const bool liveWatershed); + void onPlaybackWatershedChanged(const bool playbackWatershed); + void onBlockNotRatedContentChanged(const bool blockNotRatedContent); + void onPinOnPurchaseChanged(const bool pinOnPurchase); uint32_t WaitForRequestStatus(uint32_t timeout_ms,UserSettingsL2test_async_events_t expected_status); uint32_t CreateUserSettingInterfaceObjectUsingComRPCConnection(); @@ -476,11 +477,11 @@ void UserSettingTest::onPreferredClosedCaptionServiceChanged(const string servic m_condition_variable.notify_one(); } -void UserSettingTest::onPinControlChanged(bool enabled) +void UserSettingTest::onPinControlChanged(bool pinControl) { TEST_LOG("OnPinControlChanged event triggered ***\n"); std::unique_lock lock(m_mutex); - std::string str = enabled ? "true" : "false"; + std::string str = pinControl ? "true" : "false"; TEST_LOG("OnPinControlChanged received: %s\n", str.c_str()); /* Notify the requester thread. */ @@ -512,11 +513,11 @@ void UserSettingTest::onViewingRestrictionsWindowChanged(const string viewingRes } -void UserSettingTest::onLiveWatershedChanged(const bool enabled) +void UserSettingTest::onLiveWatershedChanged(const bool liveWatershed) { TEST_LOG("OnLiveWatershedChanged event triggered ***\n"); std::unique_lock lock(m_mutex); - std::string str = enabled ? "true" : "false"; + std::string str = liveWatershed ? "true" : "false"; TEST_LOG("OnLiveWatershedChanged received: %s\n", str.c_str()); /* Notify the requester thread. */ @@ -524,11 +525,11 @@ void UserSettingTest::onLiveWatershedChanged(const bool enabled) m_condition_variable.notify_one(); } -void UserSettingTest::onPlaybackWatershedChanged(const bool enabled) +void UserSettingTest::onPlaybackWatershedChanged(const bool playbackWatershed) { TEST_LOG("OnPlaybackWatershedChanged event triggered ***\n"); std::unique_lock lock(m_mutex); - std::string str = enabled ? "true" : "false"; + std::string str = playbackWatershed ? "true" : "false"; TEST_LOG("OnPlaybackWatershedChanged received: %s\n", str.c_str()); /* Notify the requester thread. */ @@ -536,11 +537,11 @@ void UserSettingTest::onPlaybackWatershedChanged(const bool enabled) m_condition_variable.notify_one(); } -void UserSettingTest::onBlockNotRatedContentChanged(const bool enabled) +void UserSettingTest::onBlockNotRatedContentChanged(const bool blockNotRatedContent) { TEST_LOG("OnBlockNotRatedContentChanged event triggered ***\n"); std::unique_lock lock(m_mutex); - std::string str = enabled ? "true" : "false"; + std::string str = blockNotRatedContent ? "true" : "false"; TEST_LOG("OnBlockNotRatedContentChanged received: %s\n", str.c_str()); /* Notify the requester thread. */ @@ -548,11 +549,11 @@ void UserSettingTest::onBlockNotRatedContentChanged(const bool enabled) m_condition_variable.notify_one(); } -void UserSettingTest::onPinOnPurchaseChanged(const bool enabled) +void UserSettingTest::onPinOnPurchaseChanged(const bool pinOnPurchase) { TEST_LOG("OnPinOnPurchaseChanged event triggered ***\n"); std::unique_lock lock(m_mutex); - std::string str = enabled ? "true" : "false"; + std::string str = pinOnPurchase ? "true" : "false"; TEST_LOG("OnPinOnPurchaseChanged received: %s\n", str.c_str()); /* Notify the requester thread. */ @@ -906,6 +907,12 @@ TEST_F(UserSettingTest, SetAndGetMethodsUsingJsonRpcConnectionSuccessCase) uint32_t signalled = UserSettings_StateInvalid; bool enabled = true; + bool pinControl = true; + bool liveWatershed = true; + bool playbackWatershed = true; + bool blockNotRatedContent = true; + bool pinOnPurchase = true; + string preferredLanguages = "en"; string presentationLanguage = "fra"; string preferredCaptionsLanguages = "en,es"; @@ -1072,16 +1079,16 @@ TEST_F(UserSettingTest, SetAndGetMethodsUsingJsonRpcConnectionSuccessCase) status = jsonrpc.Subscribe(JSON_TIMEOUT, _T("onPinControlChanged"), [this, &async_handler](const JsonObject& parameters) { - bool enabled = parameters["enabled"].Boolean(); - async_handler.onPinControlChanged(enabled); + bool pinControl = parameters["pinControl"].Boolean(); + async_handler.onPinControlChanged(pinControl); }); EXPECT_EQ(Core::ERROR_NONE, status); - EXPECT_CALL(async_handler, onPinControlChanged(MatchRequestStatusBool(enabled))) + EXPECT_CALL(async_handler, onPinControlChanged(MatchRequestStatusBool(pinControl))) .WillOnce(Invoke(this, &UserSettingTest::onPinControlChanged)); JsonObject paramsPinControl; - paramsPinControl["enabled"] = true; + paramsPinControl["pinControl"] = true; status = InvokeServiceMethod("org.rdk.UserSettings", "setPinControl", paramsPinControl, result_json); EXPECT_EQ(status,Core::ERROR_NONE); @@ -1152,16 +1159,16 @@ TEST_F(UserSettingTest, SetAndGetMethodsUsingJsonRpcConnectionSuccessCase) status = jsonrpc.Subscribe(JSON_TIMEOUT, _T("onLiveWatershedChanged"), [this, &async_handler](const JsonObject& parameters) { - bool enabled = parameters["enabled"].Boolean(); - async_handler.onLiveWatershedChanged(enabled); + bool liveWatershed = parameters["liveWatershed"].Boolean(); + async_handler.onLiveWatershedChanged(liveWatershed); }); EXPECT_EQ(Core::ERROR_NONE, status); - EXPECT_CALL(async_handler, onLiveWatershedChanged(MatchRequestStatusBool(enabled))) + EXPECT_CALL(async_handler, onLiveWatershedChanged(MatchRequestStatusBool(liveWatershed))) .WillOnce(Invoke(this, &UserSettingTest::onLiveWatershedChanged)); JsonObject paramsLiveWatershed; - paramsLiveWatershed["enabled"] = true; + paramsLiveWatershed["liveWatershed"] = true; status = InvokeServiceMethod("org.rdk.UserSettings", "setLiveWatershed", paramsLiveWatershed, result_json); EXPECT_EQ(status,Core::ERROR_NONE); @@ -1180,16 +1187,16 @@ TEST_F(UserSettingTest, SetAndGetMethodsUsingJsonRpcConnectionSuccessCase) status = jsonrpc.Subscribe(JSON_TIMEOUT, _T("onPlaybackWatershedChanged"), [this, &async_handler](const JsonObject& parameters) { - bool enabled = parameters["enabled"].Boolean(); - async_handler.onPlaybackWatershedChanged(enabled); + bool playbackWatershed = parameters["playbackWatershed"].Boolean(); + async_handler.onPlaybackWatershedChanged(playbackWatershed); }); EXPECT_EQ(Core::ERROR_NONE, status); - EXPECT_CALL(async_handler, onPlaybackWatershedChanged(MatchRequestStatusBool(enabled))) + EXPECT_CALL(async_handler, onPlaybackWatershedChanged(MatchRequestStatusBool(playbackWatershed))) .WillOnce(Invoke(this, &UserSettingTest::onPlaybackWatershedChanged)); JsonObject paramsPlaybackWatershed; - paramsPlaybackWatershed["enabled"] = true; + paramsPlaybackWatershed["playbackWatershed"] = true; status = InvokeServiceMethod("org.rdk.UserSettings", "setPlaybackWatershed", paramsPlaybackWatershed, result_json); EXPECT_EQ(status,Core::ERROR_NONE); @@ -1208,16 +1215,16 @@ TEST_F(UserSettingTest, SetAndGetMethodsUsingJsonRpcConnectionSuccessCase) status = jsonrpc.Subscribe(JSON_TIMEOUT, _T("onBlockNotRatedContentChanged"), [this, &async_handler](const JsonObject& parameters) { - bool enabled = parameters["enabled"].Boolean(); - async_handler.onBlockNotRatedContentChanged(enabled); + bool blockNotRatedContent = parameters["blockNotRatedContent"].Boolean(); + async_handler.onBlockNotRatedContentChanged(blockNotRatedContent); }); EXPECT_EQ(Core::ERROR_NONE, status); - EXPECT_CALL(async_handler, onBlockNotRatedContentChanged(MatchRequestStatusBool(enabled))) + EXPECT_CALL(async_handler, onBlockNotRatedContentChanged(MatchRequestStatusBool(blockNotRatedContent))) .WillOnce(Invoke(this, &UserSettingTest::onBlockNotRatedContentChanged)); JsonObject paramsBlockNotRatedContent; - paramsBlockNotRatedContent["enabled"] = true; + paramsBlockNotRatedContent["blockNotRatedContent"] = true; status = InvokeServiceMethod("org.rdk.UserSettings", "setBlockNotRatedContent", paramsBlockNotRatedContent, result_json); EXPECT_EQ(status,Core::ERROR_NONE); @@ -1236,16 +1243,16 @@ TEST_F(UserSettingTest, SetAndGetMethodsUsingJsonRpcConnectionSuccessCase) status = jsonrpc.Subscribe(JSON_TIMEOUT, _T("onPinOnPurchaseChanged"), [this, &async_handler](const JsonObject& parameters) { - bool enabled = parameters["enabled"].Boolean(); - async_handler.onPinOnPurchaseChanged(enabled); + bool pinOnPurchase = parameters["pinOnPurchase"].Boolean(); + async_handler.onPinOnPurchaseChanged(pinOnPurchase); }); EXPECT_EQ(Core::ERROR_NONE, status); - EXPECT_CALL(async_handler, onPinOnPurchaseChanged(MatchRequestStatusBool(enabled))) + EXPECT_CALL(async_handler, onPinOnPurchaseChanged(MatchRequestStatusBool(pinOnPurchase))) .WillOnce(Invoke(this, &UserSettingTest::onPinOnPurchaseChanged)); JsonObject paramsPinOnPurchase; - paramsPinOnPurchase["enabled"] = true; + paramsPinOnPurchase["pinOnPurchase"] = true; status = InvokeServiceMethod("org.rdk.UserSettings", "setPinOnPurchase", paramsPinOnPurchase, result_json); EXPECT_EQ(status,Core::ERROR_NONE); diff --git a/Tests/L2Tests/patches/RDKV-48604-User-Settings-Thunder-Plugin.patch b/Tests/L2Tests/patches/RDKV-48604-User-Settings-Thunder-Plugin.patch index d037113b51..c6e94a2649 100755 --- a/Tests/L2Tests/patches/RDKV-48604-User-Settings-Thunder-Plugin.patch +++ b/Tests/L2Tests/patches/RDKV-48604-User-Settings-Thunder-Plugin.patch @@ -80,8 +80,8 @@ index 0000000..9353f6d + + // @text onPinControlChanged + // @brief The PinControl setting has changed. -+ // @param enabled: Enabled/Disabled. -+ virtual void OnPinControlChanged(const bool enabled) = 0; ++ // @param pinControl: Enabled/Disabled. ++ virtual void OnPinControlChanged(const bool pinControl) = 0; + + // @text onViewingRestrictionsChanged + // @brief The ViewingRestrictions setting has changed. @@ -95,23 +95,23 @@ index 0000000..9353f6d + + // @text onLiveWatershedChanged + // @brief The LiveWatershed setting has changed. -+ // @param enabled: Enabled/Disabled. -+ virtual void OnLiveWatershedChanged(const bool enabled) = 0; ++ // @param liveWatershed: Enabled/Disabled. ++ virtual void OnLiveWatershedChanged(const bool liveWatershed) = 0; + + // @text onPlaybackWatershedChanged + // @brief The PlaybackWatershed setting has changed. -+ // @param enabled: Enabled/Disabled. -+ virtual void OnPlaybackWatershedChanged(const bool enabled) = 0; ++ // @param playbackWatershed: Enabled/Disabled. ++ virtual void OnPlaybackWatershedChanged(const bool playbackWatershed) = 0; + + // @text onBlockNotRatedContentChanged + // @brief The BlockNotRatedContent setting has changed. -+ // @param enabled: Enabled/Disabled. -+ virtual void OnBlockNotRatedContentChanged(const bool enabled) = 0; ++ // @param blockNotRatedContent: Enabled/Disabled. ++ virtual void OnBlockNotRatedContentChanged(const bool blockNotRatedContent) = 0; + + // @text onPinOnPurchaseChanged + // @brief The PinOnPurchase setting has changed. -+ // @param enabled: Enabled/Disabled. -+ virtual void OnPinOnPurchaseChanged(const bool enabled) = 0; ++ // @param pinOnPurchase: Enabled/Disabled. ++ virtual void OnPinOnPurchaseChanged(const bool pinOnPurchase) = 0; + + }; + @@ -212,13 +212,13 @@ index 0000000..9353f6d + + // @text setPinControl + // @brief Sets PinControl ON/OFF. Parental Control as a whole is enabled or disabled. -+ // @param enabled: Enabled/Disabled -+ virtual uint32_t SetPinControl(const bool enabled /* @in */) = 0; ++ // @param pinControl: Enabled/Disabled ++ virtual uint32_t SetPinControl(const bool pinControl /* @in */) = 0; + + // @text getPinControl + // @brief Gets the PinControl setting -+ // @param enabled: Enabled/Disabled -+ virtual uint32_t GetPinControl(bool &enabled /* @out */) const = 0; ++ // @param pinControl: Enabled/Disabled ++ virtual uint32_t GetPinControl(bool &pinControl /* @out */) const = 0; + + // @text setViewingRestrictions + // @brief Sets the ViewingRestrictions. @@ -246,46 +246,46 @@ index 0000000..9353f6d + // @text setLiveWatershed + // @brief Sets LiveWatershed ON/OFF.Whether project-specific watershed rules + // should be applied for live content, if applicable for the project. -+ // @param enabled: Enabled/Disabled -+ virtual uint32_t SetLiveWatershed(const bool enabled /* @in */) = 0; ++ // @param liveWatershed: Enabled/Disabled ++ virtual uint32_t SetLiveWatershed(const bool liveWatershed /* @in */) = 0; + + // @text getLiveWatershed + // @brief Gets the LiveWatershed setting -+ // @param enabled: Enabled/Disabled -+ virtual uint32_t GetLiveWatershed(bool &enabled /* @out */) const = 0; ++ // @param liveWatershed: Enabled/Disabled ++ virtual uint32_t GetLiveWatershed(bool &liveWatershed /* @out */) const = 0; + + // @text setPlaybackWatershed + // @brief Sets PlaybackWatershed ON/OFF. Whether project-specific watershed rules + // should be applied for non-live content, if applicable for the project. -+ // @param enabled: Enabled/Disabled -+ virtual uint32_t SetPlaybackWatershed(const bool enabled /* @in */) = 0; ++ // @param playbackWatershed: Enabled/Disabled ++ virtual uint32_t SetPlaybackWatershed(const bool playbackWatershed /* @in */) = 0; + + // @text getPlaybackWatershed + // @brief Gets the PlaybackWatershed setting -+ // @param enabled: Enabled/Disabled -+ virtual uint32_t GetPlaybackWatershed(bool &enabled /* @out */) const = 0; ++ // @param playbackWatershed: Enabled/Disabled ++ virtual uint32_t GetPlaybackWatershed(bool &playbackWatershed /* @out */) const = 0; + + // @text setBlockNotRatedContent + // @brief Sets BlockNotRatedContent ON/OFF. Whether content that is not rated should be + // blocked, if applicable for the project. -+ // @param enabled: Enabled/Disabled -+ virtual uint32_t SetBlockNotRatedContent(const bool enabled /* @in */) = 0; ++ // @param blockNotRatedContent: Enabled/Disabled ++ virtual uint32_t SetBlockNotRatedContent(const bool blockNotRatedContent /* @in */) = 0; + + // @text getBlockNotRatedContent + // @brief Gets the BlockNotRatedContent setting -+ // @param enabled: Enabled/Disabled -+ virtual uint32_t GetBlockNotRatedContent(bool &enabled /* @out */) const = 0; ++ // @param blockNotRatedContent: Enabled/Disabled ++ virtual uint32_t GetBlockNotRatedContent(bool &blockNotRatedContent /* @out */) const = 0; + + // @text setPinOnPurchase + // @brief Sets PinOnPurchase ON/OFF.Whether a PIN challenge should be made + // when a purchase is attempted. -+ // @param enabled: Enabled/Disabled -+ virtual uint32_t SetPinOnPurchase(const bool enabled /* @in */) = 0; ++ // @param pinOnPurchase: Enabled/Disabled ++ virtual uint32_t SetPinOnPurchase(const bool pinOnPurchase /* @in */) = 0; + + // @text getPinOnPurchase + // @brief Gets the PinOnPurchase setting -+ // @param enabled: Enabled/Disabled -+ virtual uint32_t GetPinOnPurchase(bool &enabled /* @out */) const = 0; ++ // @param pinOnPurchase: Enabled/Disabled ++ virtual uint32_t GetPinOnPurchase(bool &pinOnPurchase /* @out */) const = 0; + +}; +} // namespace Exchange diff --git a/UserSettings/UserSettings.h b/UserSettings/UserSettings.h index b144f36c20..c0f6c038ae 100755 --- a/UserSettings/UserSettings.h +++ b/UserSettings/UserSettings.h @@ -110,10 +110,10 @@ namespace Plugin { Exchange::JUserSettings::Event::OnPrivacyModeChanged(_parent, privacyMode); } - void OnPinControlChanged(const bool enabled) override + void OnPinControlChanged(const bool pinControl) override { - LOGINFO("PinControlChanged: %d\n", enabled); - Exchange::JUserSettings::Event::OnPinControlChanged(_parent, enabled); + LOGINFO("PinControlChanged: %d\n", pinControl); + Exchange::JUserSettings::Event::OnPinControlChanged(_parent, pinControl); } void OnViewingRestrictionsChanged(const string& viewingRestrictions) override @@ -128,28 +128,28 @@ namespace Plugin { Exchange::JUserSettings::Event::OnViewingRestrictionsWindowChanged(_parent, viewingRestrictionsWindow); } - void OnLiveWatershedChanged(const bool enabled) override + void OnLiveWatershedChanged(const bool liveWatershed) override { - LOGINFO("LiveWatershedChanged: %d\n", enabled); - Exchange::JUserSettings::Event::OnLiveWatershedChanged(_parent, enabled); + LOGINFO("LiveWatershedChanged: %d\n", liveWatershed); + Exchange::JUserSettings::Event::OnLiveWatershedChanged(_parent, liveWatershed); } - void OnPlaybackWatershedChanged(const bool enabled) override + void OnPlaybackWatershedChanged(const bool playbackWatershed) override { - LOGINFO("PlaybackWatershedChanged: %d\n", enabled); - Exchange::JUserSettings::Event::OnPlaybackWatershedChanged(_parent, enabled); + LOGINFO("PlaybackWatershedChanged: %d\n", playbackWatershed); + Exchange::JUserSettings::Event::OnPlaybackWatershedChanged(_parent, playbackWatershed); } - void OnBlockNotRatedContentChanged(const bool enabled) override + void OnBlockNotRatedContentChanged(const bool blockNotRatedContent) override { - LOGINFO("BlockNotRatedContentChanged: %d\n", enabled); - Exchange::JUserSettings::Event::OnBlockNotRatedContentChanged(_parent, enabled); + LOGINFO("BlockNotRatedContentChanged: %d\n", blockNotRatedContent); + Exchange::JUserSettings::Event::OnBlockNotRatedContentChanged(_parent, blockNotRatedContent); } - void OnPinOnPurchaseChanged(const bool enabled) override + void OnPinOnPurchaseChanged(const bool pinOnPurchase) override { - LOGINFO("PinOnPurchaseChanged: %d\n", enabled); - Exchange::JUserSettings::Event::OnPinOnPurchaseChanged(_parent, enabled); + LOGINFO("PinOnPurchaseChanged: %d\n", pinOnPurchase); + Exchange::JUserSettings::Event::OnPinOnPurchaseChanged(_parent, pinOnPurchase); } private: diff --git a/UserSettings/UserSettings.json b/UserSettings/UserSettings.json index 100e2e076d..57cd42e826 100755 --- a/UserSettings/UserSettings.json +++ b/UserSettings/UserSettings.json @@ -45,7 +45,7 @@ "setAudioDescription": { "summary": "Setting Audio Description.", "events": { - "OnAudioDescriptionChanged" : "Triggered when the audio description changes." + "onAudioDescriptionChanged" : "Triggered when the audio description changes." }, "params": { "type": "object", @@ -168,7 +168,7 @@ "params": { "type": "object", "properties": { - "enabled": { + "pinControl": { "summary": "PinControl Enabled: true/false", "type": "boolean", "example":true @@ -181,10 +181,10 @@ "example": "null" } }, - "setViewingRestrictions": { + "setViewingRestrictions": { "summary": "Setting ViewingRestrictions.", "events": { - "OnViewingRestrictionsChanged" : "Triggered when the viewingRestrictions changes." + "onViewingRestrictionsChanged" : "Triggered when the viewingRestrictions changes." }, "params": { "type": "object", @@ -203,7 +203,7 @@ "setViewingRestrictionsWindow": { "summary": "Setting viewingRestrictionsWindow.", "events": { - "OnViewingRestrictionsWindowChanged" : "Triggered when the viewingRestrictionsWindow changes." + "onViewingRestrictionsWindowChanged" : "Triggered when the viewingRestrictionsWindow changes." }, "params": { "type": "object", @@ -222,12 +222,12 @@ "setLiveWatershed": { "summary": "Setting LiveWatershed.", "events": { - "OnLiveWatershedChanged" : "Triggered when the liveWatershed changes." + "onLiveWatershedChanged" : "Triggered when the liveWatershed changes." }, "params": { "type": "object", "properties": { - "enabled": { + "liveWatershed": { "summary": "LiveWatershed Enabled: true/false", "type": "boolean", "example":true @@ -240,15 +240,15 @@ "example": "null" } }, - "setPlaybackWatershed": { + "setPlaybackWatershed": { "summary": "Setting PlaybackWatershed.", "events": { - "OnPlaybackWatershedChanged" : "Triggered when the playbackWatershed changes." + "onPlaybackWatershedChanged" : "Triggered when the playbackWatershed changes." }, "params": { "type": "object", "properties": { - "enabled": { + "playbackWatershed": { "summary": "PlaybackWatershed Enabled: true/false", "type": "boolean", "example":true @@ -261,15 +261,15 @@ "example": "null" } }, - "setBlockNotRatedContent": { + "setBlockNotRatedContent": { "summary": "Setting BlockNotRatedContent.", "events": { - "OnBlockNotRatedContentChanged" : "Triggered when the blockNotRatedContent changes." + "onBlockNotRatedContentChanged" : "Triggered when the blockNotRatedContent changes." }, "params": { "type": "object", "properties": { - "enabled": { + "blockNotRatedContent": { "summary": "BlockNotRatedContent Enabled: true/false", "type": "boolean", "example":true @@ -282,15 +282,15 @@ "example": "null" } }, - "setPinOnPurchase": { + "setPinOnPurchase": { "summary": "Setting setPinOnPurchase", "events": { - "OnPinOnPurchaseChanged" : "Triggered when the pin on the purchase changes." + "onPinOnPurchaseChanged" : "Triggered when the pin on the purchase changes." }, "params": { "type": "object", "properties": { - "enabled": { + "pinOnPurchase": { "summary": "setPinOnPurchase Enabled: true/false", "type": "boolean", "example":true @@ -343,7 +343,7 @@ "$ref": "#/definitions/preferredClosedCaptionService" } }, - "getPinControl":{ + "getPinControl":{ "summary": "Returns Pin Control.", "result": { "summary": "Pin Control Enabled: true/false", @@ -493,19 +493,19 @@ ] } }, - "onPinControlChanged": { + "onPinControlChanged": { "summary": "Triggered after the pin control changes (see `setPinControl`)", "params": { "type": "object", "properties": { - "enabled":{ + "pinControl":{ "summary": "Receive pin control changes enable or not", "type": "boolean", "example": true } }, "required": [ - "enabled" + "pinControl" ] } }, @@ -514,14 +514,14 @@ "params": { "type": "object", "properties": { - "enabled":{ - "summary": "Receive viewingRestrictions changes enable or not", - "type": "boolean", - "example": true + "viewingRestrictions":{ + "summary": "Receive viewingRestrictions changes", + "type": "string", + "example": "{\"restrictions\": [{\"scheme\": \"US_TV\", \"restrict\": [\"TV-Y7/FV\"]}, {\"scheme\": \"MPAA\", \"restrict\": []}]}" } }, "required": [ - "enabled" + "viewingRestrictions" ] } }, @@ -530,14 +530,14 @@ "params": { "type": "object", "properties": { - "enabled":{ - "summary": "Receive viewingRestrictionsWindow changes enable or not", - "type": "boolean", - "example": true + "viewingRestrictionsWindow":{ + "summary": "Receive viewingRestrictionsWindow changes.", + "type": "string", + "example": "ALWAYS" } }, "required": [ - "enabled" + "viewingRestrictionsWindow" ] } }, @@ -546,14 +546,14 @@ "params": { "type": "object", "properties": { - "enabled":{ + "liveWatershed":{ "summary": "Receives liveWatershed changes enable or not", "type": "boolean", "example": true } }, "required": [ - "enabled" + "liveWatershed" ] } }, @@ -562,14 +562,14 @@ "params": { "type": "object", "properties": { - "enabled":{ + "playbackWatershed":{ "summary": "Receive playbackWatershed changes enable or not", "type": "boolean", "example": true } }, "required": [ - "enabled" + "playbackWatershed" ] } }, @@ -578,14 +578,14 @@ "params": { "type": "object", "properties": { - "enabled":{ + "blockNotRatedContent":{ "summary": "Receive blockNotRatedContent changes enable or not", "type": "boolean", "example": true } }, "required": [ - "enabled" + "blockNotRatedContent" ] } }, @@ -594,14 +594,14 @@ "params": { "type": "object", "properties": { - "enabled":{ + "pinOnPurchase":{ "summary": "Receive pinOnPurchase changes enable or not", "type": "boolean", "example": true } }, "required": [ - "enabled" + "pinOnPurchase" ] } } diff --git a/UserSettings/UserSettingsImplementation.cpp b/UserSettings/UserSettingsImplementation.cpp index ed019e1051..1a41f9e6b1 100755 --- a/UserSettings/UserSettingsImplementation.cpp +++ b/UserSettings/UserSettingsImplementation.cpp @@ -675,16 +675,16 @@ uint32_t UserSettingsImplementation::GetPrivacyMode(string &privacyMode) const return status; } -uint32_t UserSettingsImplementation::SetPinControl(const bool enabled) +uint32_t UserSettingsImplementation::SetPinControl(const bool pinControl) { uint32_t status = Core::ERROR_GENERAL; - LOGINFO("enabled: %d", enabled); - status = SetUserSettingsValue(USERSETTINGS_PIN_CONTROL_KEY, (enabled)?"true":"false"); + LOGINFO("pinControl: %d", pinControl); + status = SetUserSettingsValue(USERSETTINGS_PIN_CONTROL_KEY, (pinControl)?"true":"false"); return status; } -uint32_t UserSettingsImplementation::GetPinControl(bool &enabled) const +uint32_t UserSettingsImplementation::GetPinControl(bool &pinControl) const { uint32_t status = Core::ERROR_GENERAL; std::string value = ""; @@ -695,11 +695,11 @@ uint32_t UserSettingsImplementation::GetPinControl(bool &enabled) const { if (0 == value.compare("true")) { - enabled = true; + pinControl = true; } else { - enabled = false; + pinControl = false; } } return status; @@ -743,17 +743,17 @@ uint32_t UserSettingsImplementation::GetViewingRestrictionsWindow(string &viewin return status; } -uint32_t UserSettingsImplementation::SetLiveWatershed(const bool enabled) +uint32_t UserSettingsImplementation::SetLiveWatershed(const bool liveWatershed) { uint32_t status = Core::ERROR_GENERAL; - LOGINFO("enabled: %d", enabled); - status = SetUserSettingsValue(USERSETTINGS_LIVE_WATERSHED_KEY, (enabled)?"true":"false"); + LOGINFO("liveWatershed: %d", liveWatershed); + status = SetUserSettingsValue(USERSETTINGS_LIVE_WATERSHED_KEY, (liveWatershed)?"true":"false"); return status; } -uint32_t UserSettingsImplementation::GetLiveWatershed(bool &enabled) const +uint32_t UserSettingsImplementation::GetLiveWatershed(bool &liveWatershed) const { uint32_t status = Core::ERROR_GENERAL; std::string value = ""; @@ -764,26 +764,26 @@ uint32_t UserSettingsImplementation::GetLiveWatershed(bool &enabled) const { if (0 == value.compare("true")) { - enabled = true; + liveWatershed = true; } else { - enabled = false; + liveWatershed = false; } } return status; } -uint32_t UserSettingsImplementation::SetPlaybackWatershed(const bool enabled) +uint32_t UserSettingsImplementation::SetPlaybackWatershed(const bool playbackWatershed) { uint32_t status = Core::ERROR_GENERAL; - LOGINFO("enabled: %d", enabled); - status = SetUserSettingsValue(USERSETTINGS_PLAYBACK_WATERSHED_KEY, (enabled)?"true":"false"); + LOGINFO("playbackWatershed: %d", playbackWatershed); + status = SetUserSettingsValue(USERSETTINGS_PLAYBACK_WATERSHED_KEY, (playbackWatershed)?"true":"false"); return status; } -uint32_t UserSettingsImplementation::GetPlaybackWatershed(bool &enabled) const +uint32_t UserSettingsImplementation::GetPlaybackWatershed(bool &playbackWatershed) const { uint32_t status = Core::ERROR_GENERAL; std::string value = ""; @@ -794,26 +794,26 @@ uint32_t UserSettingsImplementation::GetPlaybackWatershed(bool &enabled) const { if (0 == value.compare("true")) { - enabled = true; + playbackWatershed = true; } else { - enabled = false; + playbackWatershed = false; } } return status; } -uint32_t UserSettingsImplementation::SetBlockNotRatedContent(const bool enabled) +uint32_t UserSettingsImplementation::SetBlockNotRatedContent(const bool blockNotRatedContent) { uint32_t status = Core::ERROR_GENERAL; - LOGINFO("enabled: %d", enabled); - status = SetUserSettingsValue(USERSETTINGS_BLOCK_NOT_RATED_CONTENT_KEY, (enabled)?"true":"false"); + LOGINFO("blockNotRatedContent: %d", blockNotRatedContent); + status = SetUserSettingsValue(USERSETTINGS_BLOCK_NOT_RATED_CONTENT_KEY, (blockNotRatedContent)?"true":"false"); return status; } -uint32_t UserSettingsImplementation::GetBlockNotRatedContent(bool &enabled) const +uint32_t UserSettingsImplementation::GetBlockNotRatedContent(bool &blockNotRatedContent) const { uint32_t status = Core::ERROR_GENERAL; std::string value = ""; @@ -824,26 +824,26 @@ uint32_t UserSettingsImplementation::GetBlockNotRatedContent(bool &enabled) cons { if (0 == value.compare("true")) { - enabled = true; + blockNotRatedContent = true; } else { - enabled = false; + blockNotRatedContent = false; } } return status; } -uint32_t UserSettingsImplementation::SetPinOnPurchase(const bool enabled) +uint32_t UserSettingsImplementation::SetPinOnPurchase(const bool pinOnPurchase) { uint32_t status = Core::ERROR_GENERAL; - LOGINFO("enabled: %d", enabled); - status = SetUserSettingsValue(USERSETTINGS_PIN_ON_PURCHASE_KEY, (enabled)?"true":"false"); + LOGINFO("pinOnPurchase: %d", pinOnPurchase); + status = SetUserSettingsValue(USERSETTINGS_PIN_ON_PURCHASE_KEY, (pinOnPurchase)?"true":"false"); return status; } -uint32_t UserSettingsImplementation::GetPinOnPurchase(bool &enabled) const +uint32_t UserSettingsImplementation::GetPinOnPurchase(bool &pinOnPurchase) const { uint32_t status = Core::ERROR_GENERAL; std::string value = ""; @@ -852,15 +852,13 @@ uint32_t UserSettingsImplementation::GetPinOnPurchase(bool &enabled) const if(Core::ERROR_NONE == status) { - LOGINFO("getPinOnPurchase: %d", enabled); - if (0 == value.compare("true")) { - enabled = true; + pinOnPurchase = true; } else { - enabled = false; + pinOnPurchase = false; } } return status; diff --git a/UserSettings/UserSettingsImplementation.h b/UserSettings/UserSettingsImplementation.h index d3a947e88e..0da307147c 100755 --- a/UserSettings/UserSettingsImplementation.h +++ b/UserSettings/UserSettingsImplementation.h @@ -174,20 +174,20 @@ namespace Plugin { uint32_t GetPreferredClosedCaptionService(string &service) const override; uint32_t SetPrivacyMode(const string& privacyMode) override; uint32_t GetPrivacyMode(string &privacyMode) const override; - uint32_t SetPinControl(const bool enabled) override; - uint32_t GetPinControl(bool &enabled) const override; + uint32_t SetPinControl(const bool pinControl) override; + uint32_t GetPinControl(bool &pinControl) const override; uint32_t SetViewingRestrictions(const string& viewingRestrictions) override; uint32_t GetViewingRestrictions(string &viewingRestrictions) const override; uint32_t SetViewingRestrictionsWindow(const string& viewingRestrictionsWindow) override; uint32_t GetViewingRestrictionsWindow(string &viewingRestrictionsWindow) const override; - uint32_t SetLiveWatershed(const bool enabled) override; - uint32_t GetLiveWatershed(bool &enabled) const override; - uint32_t SetPlaybackWatershed(const bool enabled) override; - uint32_t GetPlaybackWatershed(bool &enabled) const override; - uint32_t SetBlockNotRatedContent(const bool enabled) override; - uint32_t GetBlockNotRatedContent(bool &enabled) const override; - uint32_t SetPinOnPurchase(const bool enabled) override; - uint32_t GetPinOnPurchase(bool &enabled) const override; + uint32_t SetLiveWatershed(const bool liveWatershed) override; + uint32_t GetLiveWatershed(bool &liveWatershed) const override; + uint32_t SetPlaybackWatershed(const bool playbackWatershed) override; + uint32_t GetPlaybackWatershed(bool &playbackWatershed) const override; + uint32_t SetBlockNotRatedContent(const bool blockNotRatedContent) override; + uint32_t GetBlockNotRatedContent(bool &blockNotRatedContent) const override; + uint32_t SetPinOnPurchase(const bool pinOnPurchase) override; + uint32_t GetPinOnPurchase(bool &pinOnPurchase) const override; void registerEventHandlers(); void ValueChanged(const Exchange::IStore2::ScopeType scope, const string& ns, const string& key, const string& value); diff --git a/docs/api/UserSettingsPlugin.md b/docs/api/UserSettingsPlugin.md index 7c7fee865b..36790842f7 100644 --- a/docs/api/UserSettingsPlugin.md +++ b/docs/api/UserSettingsPlugin.md @@ -1,5 +1,5 @@ - + # UserSettings Plugin **Version: [1.2.0](https://github.com/rdkcentral/rdkservices/blob/main/UserSettings/CHANGELOG.md)** @@ -8,25 +8,25 @@ A org.rdk.UserSettings plugin for Thunder framework. ### Table of Contents -- [Abbreviation, Acronyms and Terms](#Abbreviation,_Acronyms_and_Terms) -- [Description](#Description) -- [Configuration](#Configuration) -- [Methods](#Methods) -- [Notifications](#Notifications) +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Notifications](#head.Notifications) - + # Abbreviation, Acronyms and Terms [[Refer to this link](userguide/aat.md)] - + # Description The `UserSettings` that is responsible for persisting and notifying listeners of any change of these settings. -The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#Thunder)]. +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. - + # Configuration The table below lists configuration options of the plugin. @@ -38,7 +38,7 @@ The table below lists configuration options of the plugin. | locator | string | Library name: *libWPEFrameworkUserSettings.so* | | autostart | boolean | Determines if the plugin shall be started automatically along with the framework | - + # Methods The following methods are provided by the org.rdk.UserSettings plugin: @@ -47,36 +47,36 @@ org.rdk.UserSettings interface methods: | Method | Description | | :-------- | :-------- | -| [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 | -| [setPinControl](#setPinControl) | Setting PinControl | -| [setViewingRestrictions](#setViewingRestrictions) | Setting ViewingRestrictions | -| [setViewingRestrictionsWindow](#setViewingRestrictionsWindow) | Setting viewingRestrictionsWindow | -| [setLiveWatershed](#setLiveWatershed) | Setting LiveWatershed | -| [setPlaybackWatershed](#setPlaybackWatershed) | Setting PlaybackWatershed | -| [setBlockNotRatedContent](#setBlockNotRatedContent) | Setting BlockNotRatedContent | -| [setPinOnPurchase](#setPinOnPurchase) | Setting setPinOnPurchase | -| [getAudioDescription](#getAudioDescription) | Returns Audio Description | -| [getPreferredAudioLanguages](#getPreferredAudioLanguages) | Returns Preferred Audio Languages | -| [getPresentationLanguage](#getPresentationLanguage) | Getting Presentation Languages | -| [getCaptions](#getCaptions) | Getting Captions Enabled | -| [getPreferredCaptionsLanguages](#getPreferredCaptionsLanguages) | Getting Preferred Caption Languages | -| [getPreferredClosedCaptionService](#getPreferredClosedCaptionService) | Getting Preferred ClosedCaption Service | -| [getPinControl](#getPinControl) | Returns Pin Control | -| [getViewingRestrictions](#getViewingRestrictions) | Returns Get Viewing Restrictions | -| [getViewingRestrictionsWindow](#getViewingRestrictionsWindow) | Returns Get Viewing Restrictions Window | -| [getLiveWatershed](#getLiveWatershed) | Returns Live Watershed | -| [getPlaybackWatershed](#getPlaybackWatershed) | Returns Playback Watershed | -| [getBlockNotRatedContent](#getBlockNotRatedContent) | Returns BlockNotRatedContent | -| [getPinOnPurchase](#getPinOnPurchase) | Returns PinOnPurchase | - - - -## *setAudioDescription* +| [setAudioDescription](#method.setAudioDescription) | Setting Audio Description | +| [setPreferredAudioLanguages](#method.setPreferredAudioLanguages) | Setting Preferred Audio Languages | +| [setPresentationLanguage](#method.setPresentationLanguage) | Setting Presentation Languages | +| [setCaptions](#method.setCaptions) | Setting Captions | +| [setPreferredCaptionsLanguages](#method.setPreferredCaptionsLanguages) | Setting PreferredCaption Languages | +| [setPreferredClosedCaptionService](#method.setPreferredClosedCaptionService) | Setting Preferred Closed Caption Service | +| [setPinControl](#method.setPinControl) | Setting PinControl | +| [setViewingRestrictions](#method.setViewingRestrictions) | Setting ViewingRestrictions | +| [setViewingRestrictionsWindow](#method.setViewingRestrictionsWindow) | Setting viewingRestrictionsWindow | +| [setLiveWatershed](#method.setLiveWatershed) | Setting LiveWatershed | +| [setPlaybackWatershed](#method.setPlaybackWatershed) | Setting PlaybackWatershed | +| [setBlockNotRatedContent](#method.setBlockNotRatedContent) | Setting BlockNotRatedContent | +| [setPinOnPurchase](#method.setPinOnPurchase) | Setting setPinOnPurchase | +| [getAudioDescription](#method.getAudioDescription) | Returns Audio Description | +| [getPreferredAudioLanguages](#method.getPreferredAudioLanguages) | Returns Preferred Audio Languages | +| [getPresentationLanguage](#method.getPresentationLanguage) | Getting Presentation Languages | +| [getCaptions](#method.getCaptions) | Getting Captions Enabled | +| [getPreferredCaptionsLanguages](#method.getPreferredCaptionsLanguages) | Getting Preferred Caption Languages | +| [getPreferredClosedCaptionService](#method.getPreferredClosedCaptionService) | Getting Preferred ClosedCaption Service | +| [getPinControl](#method.getPinControl) | Returns Pin Control | +| [getViewingRestrictions](#method.getViewingRestrictions) | Returns Get Viewing Restrictions | +| [getViewingRestrictionsWindow](#method.getViewingRestrictionsWindow) | Returns Get Viewing Restrictions Window | +| [getLiveWatershed](#method.getLiveWatershed) | Returns Live Watershed | +| [getPlaybackWatershed](#method.getPlaybackWatershed) | Returns Playback Watershed | +| [getBlockNotRatedContent](#method.getBlockNotRatedContent) | Returns BlockNotRatedContent | +| [getPinOnPurchase](#method.getPinOnPurchase) | Returns PinOnPurchase | + + + +## *setAudioDescription [method](#head.Methods)* Setting Audio Description. @@ -84,7 +84,7 @@ Setting Audio Description. | Event | Description | | :-------- | :-------- | -| [OnAudioDescriptionChanged](#OnAudioDescriptionChanged) | Triggered when the audio description changes. | +| [onAudioDescriptionChanged](#event.onAudioDescriptionChanged) | Triggered when the audio description changes. | ### Parameters | Name | Type | Description | @@ -123,8 +123,8 @@ Setting Audio Description. } ``` - -## *setPreferredAudioLanguages* + +## *setPreferredAudioLanguages [method](#head.Methods)* Setting Preferred Audio Languages. @@ -132,7 +132,7 @@ Setting Preferred Audio Languages. | Event | Description | | :-------- | :-------- | -| [onPreferredAudioLanguagesChanged](#onPreferredAudioLanguagesChanged) | Triggered when the audio preferred Audio languages changes. | +| [onPreferredAudioLanguagesChanged](#event.onPreferredAudioLanguagesChanged) | Triggered when the audio preferred Audio languages changes. | ### Parameters | Name | Type | Description | @@ -171,8 +171,8 @@ Setting Preferred Audio Languages. } ``` - -## *setPresentationLanguage* + +## *setPresentationLanguage [method](#head.Methods)* Setting Presentation Languages. @@ -180,7 +180,7 @@ Setting Presentation Languages. | Event | Description | | :-------- | :-------- | -| [onPresentationLanguageChanged](#onPresentationLanguageChanged) | Triggered when the presentation Language changes. | +| [onPresentationLanguageChanged](#event.onPresentationLanguageChanged) | Triggered when the presentation Language changes. | ### Parameters | Name | Type | Description | @@ -219,8 +219,8 @@ Setting Presentation Languages. } ``` - -## *setCaptions* + +## *setCaptions [method](#head.Methods)* Setting Captions. @@ -228,7 +228,7 @@ Setting Captions. | Event | Description | | :-------- | :-------- | -| [onCaptionsChanged](#onCaptionsChanged) | Triggered when the captions changes. | +| [onCaptionsChanged](#event.onCaptionsChanged) | Triggered when the captions changes. | ### Parameters | Name | Type | Description | @@ -267,8 +267,8 @@ Setting Captions. } ``` - -## *setPreferredCaptionsLanguages* + +## *setPreferredCaptionsLanguages [method](#head.Methods)* Setting PreferredCaption Languages. @@ -276,7 +276,7 @@ Setting PreferredCaption Languages. | Event | Description | | :-------- | :-------- | -| [onPreferredCaptionsLanguagesChanged](#onPreferredCaptionsLanguagesChanged) | Triggered when the PreferredCaption Languages changes. | +| [onPreferredCaptionsLanguagesChanged](#event.onPreferredCaptionsLanguagesChanged) | Triggered when the PreferredCaption Languages changes. | ### Parameters | Name | Type | Description | @@ -315,8 +315,8 @@ Setting PreferredCaption Languages. } ``` - -## *setPreferredClosedCaptionService* + +## *setPreferredClosedCaptionService [method](#head.Methods)* Setting Preferred Closed Caption Service. @@ -324,7 +324,7 @@ Setting Preferred Closed Caption Service. | Event | Description | | :-------- | :-------- | -| [onPreferredClosedCaptionServiceChanged](#onPreferredClosedCaptionServiceChanged) | Triggered when the Preferred Closed Caption changes. | +| [onPreferredClosedCaptionServiceChanged](#event.onPreferredClosedCaptionServiceChanged) | Triggered when the Preferred Closed Caption changes. | ### Parameters | Name | Type | Description | @@ -363,8 +363,8 @@ Setting Preferred Closed Caption Service. } ``` - -## *setPinControl* + +## *setPinControl [method](#head.Methods)* Setting PinControl. @@ -372,13 +372,13 @@ Setting PinControl. | Event | Description | | :-------- | :-------- | -| [onPinControlChanged](#onPinControlChanged) | Triggered when the pincontrol changes. | +| [onPinControlChanged](#event.onPinControlChanged) | Triggered when the pincontrol changes. | ### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.enabled | boolean | PinControl Enabled: true/false | +| params.pinControl | boolean | PinControl Enabled: true/false | ### Result @@ -396,7 +396,7 @@ Setting PinControl. "id": 42, "method": "org.rdk.UserSettings.setPinControl", "params": { - "enabled": true + "pinControl": true } } ``` @@ -411,8 +411,8 @@ Setting PinControl. } ``` - -## *setViewingRestrictions* + +## *setViewingRestrictions [method](#head.Methods)* Setting ViewingRestrictions. @@ -420,7 +420,7 @@ Setting ViewingRestrictions. | Event | Description | | :-------- | :-------- | -| [OnViewingRestrictionsChanged](#OnViewingRestrictionsChanged) | Triggered when the viewingRestrictions changes. | +| [onViewingRestrictionsChanged](#event.onViewingRestrictionsChanged) | Triggered when the viewingRestrictions changes. | ### Parameters | Name | Type | Description | @@ -459,8 +459,8 @@ Setting ViewingRestrictions. } ``` - -## *setViewingRestrictionsWindow* + +## *setViewingRestrictionsWindow [method](#head.Methods)* Setting viewingRestrictionsWindow. @@ -468,7 +468,7 @@ Setting viewingRestrictionsWindow. | Event | Description | | :-------- | :-------- | -| [OnViewingRestrictionsWindowChanged](#OnViewingRestrictionsWindowChanged) | Triggered when the viewingRestrictionsWindow changes. | +| [onViewingRestrictionsWindowChanged](#event.onViewingRestrictionsWindowChanged) | Triggered when the viewingRestrictionsWindow changes. | ### Parameters | Name | Type | Description | @@ -507,8 +507,8 @@ Setting viewingRestrictionsWindow. } ``` - -## *setLiveWatershed* + +## *setLiveWatershed [method](#head.Methods)* Setting LiveWatershed. @@ -516,13 +516,13 @@ Setting LiveWatershed. | Event | Description | | :-------- | :-------- | -| [OnLiveWatershedChanged](#OnLiveWatershedChanged) | Triggered when the liveWatershed changes. | +| [onLiveWatershedChanged](#event.onLiveWatershedChanged) | Triggered when the liveWatershed changes. | ### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.enabled | boolean | LiveWatershed Enabled: true/false | +| params.liveWatershed | boolean | LiveWatershed Enabled: true/false | ### Result @@ -540,7 +540,7 @@ Setting LiveWatershed. "id": 42, "method": "org.rdk.UserSettings.setLiveWatershed", "params": { - "enabled": true + "liveWatershed": true } } ``` @@ -555,8 +555,8 @@ Setting LiveWatershed. } ``` - -## *setPlaybackWatershed* + +## *setPlaybackWatershed [method](#head.Methods)* Setting PlaybackWatershed. @@ -564,13 +564,13 @@ Setting PlaybackWatershed. | Event | Description | | :-------- | :-------- | -| [OnPlaybackWatershedChanged](#OnPlaybackWatershedChanged) | Triggered when the playbackWatershed changes. | +| [onPlaybackWatershedChanged](#event.onPlaybackWatershedChanged) | Triggered when the playbackWatershed changes. | ### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.enabled | boolean | PlaybackWatershed Enabled: true/false | +| params.playbackWatershed | boolean | PlaybackWatershed Enabled: true/false | ### Result @@ -588,7 +588,7 @@ Setting PlaybackWatershed. "id": 42, "method": "org.rdk.UserSettings.setPlaybackWatershed", "params": { - "enabled": true + "playbackWatershed": true } } ``` @@ -603,8 +603,8 @@ Setting PlaybackWatershed. } ``` - -## *setBlockNotRatedContent* + +## *setBlockNotRatedContent [method](#head.Methods)* Setting BlockNotRatedContent. @@ -612,13 +612,13 @@ Setting BlockNotRatedContent. | Event | Description | | :-------- | :-------- | -| [OnBlockNotRatedContentChanged](#OnBlockNotRatedContentChanged) | Triggered when the blockNotRatedContent changes. | +| [onBlockNotRatedContentChanged](#event.onBlockNotRatedContentChanged) | Triggered when the blockNotRatedContent changes. | ### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.enabled | boolean | BlockNotRatedContent Enabled: true/false | +| params.blockNotRatedContent | boolean | BlockNotRatedContent Enabled: true/false | ### Result @@ -636,7 +636,7 @@ Setting BlockNotRatedContent. "id": 42, "method": "org.rdk.UserSettings.setBlockNotRatedContent", "params": { - "enabled": true + "blockNotRatedContent": true } } ``` @@ -651,8 +651,8 @@ Setting BlockNotRatedContent. } ``` - -## *setPinOnPurchase* + +## *setPinOnPurchase [method](#head.Methods)* Setting setPinOnPurchase. @@ -660,13 +660,13 @@ Setting setPinOnPurchase. | Event | Description | | :-------- | :-------- | -| [OnPinOnPurchaseChanged](#OnPinOnPurchaseChanged) | Triggered when the pin on the purchase changes. | +| [onPinOnPurchaseChanged](#event.onPinOnPurchaseChanged) | Triggered when the pin on the purchase changes. | ### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.enabled | boolean | setPinOnPurchase Enabled: true/false | +| params.pinOnPurchase | boolean | setPinOnPurchase Enabled: true/false | ### Result @@ -684,7 +684,7 @@ Setting setPinOnPurchase. "id": 42, "method": "org.rdk.UserSettings.setPinOnPurchase", "params": { - "enabled": true + "pinOnPurchase": true } } ``` @@ -699,8 +699,8 @@ Setting setPinOnPurchase. } ``` - -## *getAudioDescription* + +## *getAudioDescription [method](#head.Methods)* Returns Audio Description. @@ -740,8 +740,8 @@ This method takes no parameters. } ``` - -## *getPreferredAudioLanguages* + +## *getPreferredAudioLanguages [method](#head.Methods)* Returns Preferred Audio Languages. @@ -781,8 +781,8 @@ This method takes no parameters. } ``` - -## *getPresentationLanguage* + +## *getPresentationLanguage [method](#head.Methods)* Getting Presentation Languages. @@ -822,8 +822,8 @@ This method takes no parameters. } ``` - -## *getCaptions* + +## *getCaptions [method](#head.Methods)* Getting Captions Enabled. @@ -863,8 +863,8 @@ This method takes no parameters. } ``` - -## *getPreferredCaptionsLanguages* + +## *getPreferredCaptionsLanguages [method](#head.Methods)* Getting Preferred Caption Languages. @@ -904,8 +904,8 @@ This method takes no parameters. } ``` - -## *getPreferredClosedCaptionService* + +## *getPreferredClosedCaptionService [method](#head.Methods)* Getting Preferred ClosedCaption Service. @@ -945,8 +945,8 @@ This method takes no parameters. } ``` - -## *getPinControl* + +## *getPinControl [method](#head.Methods)* Returns Pin Control. @@ -986,8 +986,8 @@ This method takes no parameters. } ``` - -## *getViewingRestrictions* + +## *getViewingRestrictions [method](#head.Methods)* Returns Get Viewing Restrictions. @@ -1027,8 +1027,8 @@ This method takes no parameters. } ``` - -## *getViewingRestrictionsWindow* + +## *getViewingRestrictionsWindow [method](#head.Methods)* Returns Get Viewing Restrictions Window. @@ -1068,8 +1068,8 @@ This method takes no parameters. } ``` - -## *getLiveWatershed* + +## *getLiveWatershed [method](#head.Methods)* Returns Live Watershed. @@ -1109,8 +1109,8 @@ This method takes no parameters. } ``` - -## *getPlaybackWatershed* + +## *getPlaybackWatershed [method](#head.Methods)* Returns Playback Watershed. @@ -1150,8 +1150,8 @@ This method takes no parameters. } ``` - -## *getBlockNotRatedContent* + +## *getBlockNotRatedContent [method](#head.Methods)* Returns BlockNotRatedContent. @@ -1191,8 +1191,8 @@ This method takes no parameters. } ``` - -## *getPinOnPurchase* + +## *getPinOnPurchase [method](#head.Methods)* Returns PinOnPurchase. @@ -1232,10 +1232,10 @@ This method takes no parameters. } ``` - + # Notifications -Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#Thunder)] for information on how to register for a notification. +Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#ref.Thunder)] for information on how to register for a notification. The following events are provided by the org.rdk.UserSettings plugin: @@ -1243,23 +1243,23 @@ org.rdk.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 `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`) | -| [onPinControlChanged](#onPinControlChanged) | Triggered after the pin control changes (see `setPinControl`) | -| [onViewingRestrictionsChanged](#onViewingRestrictionsChanged) | Triggered after the viewingRestrictions changes (see `setViewingRestrictions`) | -| [onViewingRestrictionsWindowChanged](#onViewingRestrictionsWindowChanged) | Triggered after the viewingRestrictionsWindow changes (see `setViewingRestrictionsWindow`) | -| [onLiveWatershedChanged](#onLiveWatershedChanged) | Triggered after the liveWatershed changes (see `setLiveWatershed`) | -| [onPlaybackWatershedChanged](#onPlaybackWatershedChanged) | Triggered after the playbackWatershed changes (see `setPlaybackWatershed`) | -| [onBlockNotRatedContentChanged](#onBlockNotRatedContentChanged) | Triggered after the blockNotRatedContent changes (see `setBlockNotRatedContent`) | -| [onPinOnPurchaseChanged](#onPinOnPurchaseChanged) | Triggered after the pinOnPurchase changes (see `setPinOnPurchase`) | - - - -## *onAudioDescriptionChanged* +| [onAudioDescriptionChanged](#event.onAudioDescriptionChanged) | Triggered after the audio description changes (see `SetAudioDescription`) | +| [onPreferredAudioLanguagesChanged](#event.onPreferredAudioLanguagesChanged) | Triggered after the audio preferred Audio languages changes (see `SetPreferredAudioLanguages`) | +| [onPresentationLanguageChanged](#event.onPresentationLanguageChanged) | Triggered after the Presentation Language changes (see `SetPresentationLanguage`) | +| [onCaptionsChanged](#event.onCaptionsChanged) | Triggered after the captions changes (see `SetCaptions`) | +| [onPreferredCaptionsLanguagesChanged](#event.onPreferredCaptionsLanguagesChanged) | Triggered after the PreferredCaption Languages changes (see `SetPreferredCaptionsLanguages`) | +| [onPreferredClosedCaptionServiceChanged](#event.onPreferredClosedCaptionServiceChanged) | Triggered after the Preferred Closed Caption changes (see `SetPreferredClosedCaptionService`) | +| [onPinControlChanged](#event.onPinControlChanged) | Triggered after the pin control changes (see `setPinControl`) | +| [onViewingRestrictionsChanged](#event.onViewingRestrictionsChanged) | Triggered after the viewingRestrictions changes (see `setViewingRestrictions`) | +| [onViewingRestrictionsWindowChanged](#event.onViewingRestrictionsWindowChanged) | Triggered after the viewingRestrictionsWindow changes (see `setViewingRestrictionsWindow`) | +| [onLiveWatershedChanged](#event.onLiveWatershedChanged) | Triggered after the liveWatershed changes (see `setLiveWatershed`) | +| [onPlaybackWatershedChanged](#event.onPlaybackWatershedChanged) | Triggered after the playbackWatershed changes (see `setPlaybackWatershed`) | +| [onBlockNotRatedContentChanged](#event.onBlockNotRatedContentChanged) | Triggered after the blockNotRatedContent changes (see `setBlockNotRatedContent`) | +| [onPinOnPurchaseChanged](#event.onPinOnPurchaseChanged) | Triggered after the pinOnPurchase changes (see `setPinOnPurchase`) | + + + +## *onAudioDescriptionChanged [event](#head.Notifications)* Triggered after the audio description changes (see `SetAudioDescription`). @@ -1282,8 +1282,8 @@ Triggered after the audio description changes (see `SetAudioDescription`). } ``` - -## *onPreferredAudioLanguagesChanged* + +## *onPreferredAudioLanguagesChanged [event](#head.Notifications)* Triggered after the audio preferred Audio languages changes (see `SetPreferredAudioLanguages`). @@ -1306,8 +1306,8 @@ Triggered after the audio preferred Audio languages changes (see `SetPreferredAu } ``` - -## *onPresentationLanguageChanged* + +## *onPresentationLanguageChanged [event](#head.Notifications)* Triggered after the Presentation Language changes (see `SetPresentationLanguage`). @@ -1330,8 +1330,8 @@ Triggered after the Presentation Language changes (see `SetPresentationLanguage` } ``` - -## *onCaptionsChanged* + +## *onCaptionsChanged [event](#head.Notifications)* Triggered after the captions changes (see `SetCaptions`). @@ -1354,8 +1354,8 @@ Triggered after the captions changes (see `SetCaptions`). } ``` - -## *onPreferredCaptionsLanguagesChanged* + +## *onPreferredCaptionsLanguagesChanged [event](#head.Notifications)* Triggered after the PreferredCaption Languages changes (see `SetPreferredCaptionsLanguages`). @@ -1378,8 +1378,8 @@ Triggered after the PreferredCaption Languages changes (see `SetPreferredCaption } ``` - -## *onPreferredClosedCaptionServiceChanged* + +## *onPreferredClosedCaptionServiceChanged [event](#head.Notifications)* Triggered after the Preferred Closed Caption changes (see `SetPreferredClosedCaptionService`). @@ -1402,8 +1402,8 @@ Triggered after the Preferred Closed Caption changes (see `SetPreferredClosedCap } ``` - -## *onPinControlChanged* + +## *onPinControlChanged [event](#head.Notifications)* Triggered after the pin control changes (see `setPinControl`). @@ -1412,7 +1412,7 @@ Triggered after the pin control changes (see `setPinControl`). | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.enabled | boolean | Receive pin control changes enable or not | +| params.pinControl | boolean | Receive pin control changes enable or not | ### Example @@ -1421,13 +1421,13 @@ Triggered after the pin control changes (see `setPinControl`). "jsonrpc": "2.0", "method": "client.events.onPinControlChanged", "params": { - "enabled": true + "pinControl": true } } ``` - -## *onViewingRestrictionsChanged* + +## *onViewingRestrictionsChanged [event](#head.Notifications)* Triggered after the viewingRestrictions changes (see `setViewingRestrictions`). @@ -1436,7 +1436,7 @@ Triggered after the viewingRestrictions changes (see `setViewingRestrictions`). | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.enabled | boolean | Receive viewingRestrictions changes enable or not | +| params.viewingRestrictions | string | Receive viewingRestrictions changes | ### Example @@ -1445,13 +1445,13 @@ Triggered after the viewingRestrictions changes (see `setViewingRestrictions`). "jsonrpc": "2.0", "method": "client.events.onViewingRestrictionsChanged", "params": { - "enabled": true + "viewingRestrictions": "..." } } ``` - -## *onViewingRestrictionsWindowChanged* + +## *onViewingRestrictionsWindowChanged [event](#head.Notifications)* Triggered after the viewingRestrictionsWindow changes (see `setViewingRestrictionsWindow`). @@ -1460,7 +1460,7 @@ Triggered after the viewingRestrictionsWindow changes (see `setViewingRestrictio | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.enabled | boolean | Receive viewingRestrictionsWindow changes enable or not | +| params.viewingRestrictionsWindow | string | Receive viewingRestrictionsWindow changes | ### Example @@ -1469,13 +1469,13 @@ Triggered after the viewingRestrictionsWindow changes (see `setViewingRestrictio "jsonrpc": "2.0", "method": "client.events.onViewingRestrictionsWindowChanged", "params": { - "enabled": true + "viewingRestrictionsWindow": "ALWAYS" } } ``` - -## *onLiveWatershedChanged* + +## *onLiveWatershedChanged [event](#head.Notifications)* Triggered after the liveWatershed changes (see `setLiveWatershed`). @@ -1484,7 +1484,7 @@ Triggered after the liveWatershed changes (see `setLiveWatershed`). | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.enabled | boolean | Receives liveWatershed changes enable or not | +| params.liveWatershed | boolean | Receives liveWatershed changes enable or not | ### Example @@ -1493,13 +1493,13 @@ Triggered after the liveWatershed changes (see `setLiveWatershed`). "jsonrpc": "2.0", "method": "client.events.onLiveWatershedChanged", "params": { - "enabled": true + "liveWatershed": true } } ``` - -## *onPlaybackWatershedChanged* + +## *onPlaybackWatershedChanged [event](#head.Notifications)* Triggered after the playbackWatershed changes (see `setPlaybackWatershed`). @@ -1508,7 +1508,7 @@ Triggered after the playbackWatershed changes (see `setPlaybackWatershed`). | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.enabled | boolean | Receive playbackWatershed changes enable or not | +| params.playbackWatershed | boolean | Receive playbackWatershed changes enable or not | ### Example @@ -1517,13 +1517,13 @@ Triggered after the playbackWatershed changes (see `setPlaybackWatershed`). "jsonrpc": "2.0", "method": "client.events.onPlaybackWatershedChanged", "params": { - "enabled": true + "playbackWatershed": true } } ``` - -## *onBlockNotRatedContentChanged* + +## *onBlockNotRatedContentChanged [event](#head.Notifications)* Triggered after the blockNotRatedContent changes (see `setBlockNotRatedContent`). @@ -1532,7 +1532,7 @@ Triggered after the blockNotRatedContent changes (see `setBlockNotRatedContent`) | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.enabled | boolean | Receive blockNotRatedContent changes enable or not | +| params.blockNotRatedContent | boolean | Receive blockNotRatedContent changes enable or not | ### Example @@ -1541,13 +1541,13 @@ Triggered after the blockNotRatedContent changes (see `setBlockNotRatedContent`) "jsonrpc": "2.0", "method": "client.events.onBlockNotRatedContentChanged", "params": { - "enabled": true + "blockNotRatedContent": true } } ``` - -## *onPinOnPurchaseChanged* + +## *onPinOnPurchaseChanged [event](#head.Notifications)* Triggered after the pinOnPurchase changes (see `setPinOnPurchase`). @@ -1556,7 +1556,7 @@ Triggered after the pinOnPurchase changes (see `setPinOnPurchase`). | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.enabled | boolean | Receive pinOnPurchase changes enable or not | +| params.pinOnPurchase | boolean | Receive pinOnPurchase changes enable or not | ### Example @@ -1565,7 +1565,7 @@ Triggered after the pinOnPurchase changes (see `setPinOnPurchase`). "jsonrpc": "2.0", "method": "client.events.onPinOnPurchaseChanged", "params": { - "enabled": true + "pinOnPurchase": true } } ```