diff --git a/apis/Ids.h b/apis/Ids.h index ea87eee0..67ca0898 100755 --- a/apis/Ids.h +++ b/apis/Ids.h @@ -344,6 +344,7 @@ namespace Exchange { ID_GOOGLE_CAST_RM_DELEGATE = ID_GOOGLE_CAST + 2, ID_GOOGLE_CAST_RM_DELEGATE_NOTIFICATION = ID_GOOGLE_CAST + 3, + ID_RESOURCEMANAGER = ID_ENTOS_OFFSET + 0x480, }; // enum IDS } // namespace Exchange diff --git a/apis/ResourceManager/IResourceManager.h b/apis/ResourceManager/IResourceManager.h new file mode 100644 index 00000000..1c7c9471 --- /dev/null +++ b/apis/ResourceManager/IResourceManager.h @@ -0,0 +1,83 @@ +/* + * If not stated otherwise in this file or this component's LICENSE file the + * following copyright and licenses apply: + * + * Copyright 2026 RDK Management + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include "Module.h" + +// @stubgen:include + +namespace WPEFramework +{ + namespace Exchange + { + /* @json 1.0.0 @text:keep */ + struct EXTERNAL IResourceManager : virtual public Core::IUnknown + { + enum { ID = ID_RESOURCEMANAGER }; + + // Define string iterator for ResourceManager + using IStringIterator = RPC::IIteratorType; + + // Result struct for SetAVBlocked operation + struct EXTERNAL SetAVBlockedResult { + bool success; + Core::OptionalType message; + }; + + // Result struct for TTS operations + struct EXTERNAL TTSResult { + bool success; + Core::OptionalType message; + }; + + /**********************setAVBlocked() - start****************************/ + // @text setAVBlocked + // @brief Sets AV blocking status for an application + // @param appId - in - string + // @param blocked - in - bool + // @param result - out - SetAVBlockedResult + virtual Core::hresult SetAVBlocked(const string& appId, const bool blocked, SetAVBlockedResult& result /* @out */) = 0; + /**********************setAVBlocked() - end******************************/ + + /**********************getBlockedAVApplications() - start***************/ + // @text getBlockedAVApplications + // @brief Gets list of applications with blocked AV access + // @param clients: list of blocked applications + // @param success: success status + virtual Core::hresult GetBlockedAVApplications(IStringIterator*& clients /* @out */, bool& success /* @out */) const = 0; + /**********************getBlockedAVApplications() - end*****************/ + + /**********************reserveTTSResource() - start*********************/ + // @text reserveTTSResource + // @brief Reserves TTS resource for a single application + // @param appId - in - string + // @param ttsResult - out - TTSResult + virtual Core::hresult ReserveTTSResource(const string& appId, TTSResult& ttsResult /* @out */) = 0; + /**********************reserveTTSResource() - end***********************/ + + /**********************reserveTTSResourceForApps() - start***************/ + // @text reserveTTSResourceForApps + // @brief Reserves TTS resource for multiple applications + // @param appids: list of application IDs + // @param ttsResult: result of the TTS reservation + virtual Core::hresult ReserveTTSResourceForApps(IStringIterator* const appids, TTSResult& ttsResult /* @out */) = 0; + /**********************reserveTTSResourceForApps() - end*****************/ + }; + } // namespace Exchange +} // namespace WPEFramework \ No newline at end of file diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 99f90abf..48978778 100755 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -45,6 +45,7 @@ - [RDKShell@](apis/RDKShellPlugin.md) - [RDKWindowManager](apis/RDKWindowManager.md) - [RemoteControl@](apis/RemoteControlPlugin.md) + - [ResourceManager](apis/ResourceManager.md) - [ResourceManager@](apis/ResourceManagerPlugin.md) - [ScreenCapture](apis/ScreenCapture.md) - [SharedStorage](apis/SharedStorage.md) diff --git a/docs/apis/ResourceManager.md b/docs/apis/ResourceManager.md new file mode 100644 index 00000000..c624d968 --- /dev/null +++ b/docs/apis/ResourceManager.md @@ -0,0 +1,272 @@ + + +# ResourceManager Plugin + +**Version: [1.0.0](https://github.com/rdkcentral/entservices-apis/tree/main/apis/ResourceManager/IResourceManager.h)** + +A ResourceManager plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#abbreviation-acronyms-and-terms) +- [Description](#Description) +- [Configuration](#Configuration) +- [Methods](#Methods) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](overview/aat.md)] + + +# Description + +The `ResourceManager` plugin provides an interface for ResourceManager. + +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](https://rdkcentral.github.io/Thunder/)]. + + +# Configuration + +The table below lists configuration options of the plugin. + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| callsign | string | Plugin instance name (default: org.rdk.ResourceManager) | +| classname | string | Class name: *ResourceManager* | +| locator | string | Library name: *libWPEFrameworkResourceManager.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + +# Methods + +The following methods are provided by the ResourceManager plugin: + +ResourceManager interface methods: + +| Method | Description | +| :-------- | :-------- | +| [getBlockedAVApplications](#getBlockedAVApplications) | Gets list of applications with blocked AV access | +| [reserveTTSResource](#reserveTTSResource) | Reserves TTS resource for a single application | +| [reserveTTSResourceForApps](#reserveTTSResourceForApps) | Reserves TTS resource for multiple applications | +| [setAVBlocked](#setAVBlocked) | Sets AV blocking status for an application | + + +## *getBlockedAVApplications* + +Gets list of applications with blocked AV access + +### Events +Event details will be updated soon. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result | object | | +| result.clients | IStringIterator | list of blocked applications | +| result.clients[#] | string | | +| result.success | bool | success status | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.ResourceManager.getBlockedAVApplications" +} +``` + + +#### CURL Command + +```curl +curl -H 'content-type:text/plain;' --data-binary '{"jsonrpc": 2.0, "id": 0, "method": "org.rdk.ResourceManager.getBlockedAVApplications"}' http://127.0.0.1:9998/jsonrpc +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": { + "clients": [ + "" + ], + "success": true + } +} +``` + + +## *reserveTTSResource* + +Reserves TTS resource for a single application + +### Events +Event details will be updated soon. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appId | string | string | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result | object | | +| result.success | bool | success status | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.ResourceManager.reserveTTSResource", + "params": { + "appId": "" + } +} +``` + + +#### CURL Command + +```curl +curl -H 'content-type:text/plain;' --data-binary '{"jsonrpc": 2.0, "id": 1, "method": "org.rdk.ResourceManager.reserveTTSResource", "params": {"appId": ""}}' http://127.0.0.1:9998/jsonrpc +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "result": { + "success": true + } +} +``` + + +## *reserveTTSResourceForApps* + +Reserves TTS resource for multiple applications + +### Events +Event details will be updated soon. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appids | IStringIterator | list of application IDs | +| params.appids[#] | string | | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result | object | | +| result.success | bool | success status | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.ResourceManager.reserveTTSResourceForApps", + "params": [ + "" + ] +} +``` + + +#### CURL Command + +```curl +curl -H 'content-type:text/plain;' --data-binary '{"jsonrpc": 2.0, "id": 2, "method": "org.rdk.ResourceManager.reserveTTSResourceForApps", "params": [""]}' http://127.0.0.1:9998/jsonrpc +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "result": { + "success": true + } +} +``` + + +## *setAVBlocked* + +Sets AV blocking status for an application + +### Events +Event details will be updated soon. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appId | string | string | +| params.blocked | bool | bool | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result | object | | +| result.success | bool | success status | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.ResourceManager.setAVBlocked", + "params": { + "appId": "", + "blocked": true + } +} +``` + + +#### CURL Command + +```curl +curl -H 'content-type:text/plain;' --data-binary '{"jsonrpc": 2.0, "id": 3, "method": "org.rdk.ResourceManager.setAVBlocked", "params": {"appId": "", "blocked": true}}' http://127.0.0.1:9998/jsonrpc +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "result": { + "success": true + } +} +``` + +