-
Notifications
You must be signed in to change notification settings - Fork 17
RDKEMW-9895: IAppNotifications: move Emit to callback #592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature/RDKEMW-9458
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -80,14 +80,33 @@ namespace WPEFramework | |||||||||
| ID = ID_APP_NOTIFICATIONS_HANDLER_INTERNAL | ||||||||||
| }; | ||||||||||
|
|
||||||||||
|
|
||||||||||
| struct EXTERNAL IEmitter : virtual public Core::IUnknown | ||||||||||
| { | ||||||||||
| enum { ID = ID_APP_NOTIFICATIONS_HANDLER_INTERNAL_EMITTER }; | ||||||||||
| virtual ~IEmitter() override = default; | ||||||||||
|
|
||||||||||
| // @json:omit | ||||||||||
| // @text emit | ||||||||||
| // @brief Dispatch event for a given registration, if appId is provided the dispatch happens for a given App. | ||||||||||
| // @param event: the event to emit | ||||||||||
| // @param payload: the payload to emit | ||||||||||
| // @param appId (optional): the appId to emit the event for, if empty the event is emitted for all Apps | ||||||||||
| virtual void Emit(const string &event /* @in */, | ||||||||||
| const string &payload /* @in @opaque */, | ||||||||||
| const string &appId /* @in */) = 0; | ||||||||||
|
|
||||||||||
| }; | ||||||||||
|
|
||||||||||
| // @json:omit | ||||||||||
| // @text handleAppEventNotifier | ||||||||||
| // @brief Handle AppEvent Notfier expectations for a given event | ||||||||||
| // @brief Handle AppEvent Notifier expectations for a given event | ||||||||||
| // @param emitCb: the emit callback interface | ||||||||||
| // @param event: the event for registration | ||||||||||
| // @param listen: whether to listen | ||||||||||
| // @param status: status to be filled in | ||||||||||
| // @returns Core::hresult | ||||||||||
| virtual Core::hresult HandleAppEventNotifier(const string& event , const bool& listen , bool& status /* @out */) = 0; | ||||||||||
| virtual Core::hresult HandleAppEventNotifier(IEmitter *emitCb, const string& event /* @in */, bool listen /* @in */, bool& status /* @out */) = 0; | ||||||||||
|
||||||||||
| virtual Core::hresult HandleAppEventNotifier(IEmitter *emitCb, const string& event /* @in */, bool listen /* @in */, bool& status /* @out */) = 0; | |
| virtual Core::hresult HandleAppEventNotifier(IEmitter *emitCb /* @in */, const string& event /* @in */, bool listen /* @in */, bool& status /* @out */) = 0; |
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameter listen is changed from const bool& to bool. For consistency with the existing codebase style where the original signature used const bool&, consider whether this change in parameter passing style is intentional. If this is a breaking API change, ensure it's documented.
| virtual Core::hresult HandleAppEventNotifier(IEmitter *emitCb, const string& event /* @in */, bool listen /* @in */, bool& status /* @out */) = 0; | |
| virtual Core::hresult HandleAppEventNotifier(IEmitter *emitCb, const string& event /* @in */, const bool& listen /* @in */, bool& status /* @out */) = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The return type changed from
Core::hresulttovoid, removing the ability to report errors during emission. Consider keepingCore::hresultas the return type to allow error handling and propagation when emission fails.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For notification we do not return a value