This repository was archived by the owner on Feb 25, 2025. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork 6k
Android Background Platform Channels #29147
Merged
fluttergithubbot merged 21 commits into flutter:master from gaaclarke:background-platform-channels-android Oct 21, 2021
Merged
Changes from all commits
Commits
Show all changes
21 commits Select commit Hold shift + click to select a range
9034cb9 Implemented background platform channels for Android
gaaclarke 68c41df Part 2: Introduced TaskQueue API
gaaclarke c8de4a1 Part 3: Introduced PlatformMessageHandler
gaaclarke 19bd38c introduced PlatformMessageHandler, renamed PlatformMessageHandler to
gaaclarke fb4402e Made it safe to invoke the reply on background threads by protecting
gaaclarke 2471665 jasons feedback
gaaclarke fb4f77f added android embedder test
gaaclarke 9b3453d 1) removed javaism from the platform_message_handler
gaaclarke d8b1dbe added shell unittest
gaaclarke 3ded42e added java unittests
gaaclarke a3e5eb5 some random cleanup
gaaclarke 30ca22e updated licenses
gaaclarke 734f5d8 added docstrings
gaaclarke a700e43 added missing docstring
gaaclarke 7fa94f2 added missing threading information in the docstring
gaaclarke 0140577 handful of feedback for dan
gaaclarke b9a87c6 jason's feedback
gaaclarke 76d6c8f started naming generated threads
gaaclarke 56b2023 submit -> execute
gaaclarke 69c47f6 blocked users from using their own taskqueues
gaaclarke 141520f updated docstring
gaaclarke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| // Copyright 2013 The Flutter Authors. All rights reserved. | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
| | ||
| #ifndef SHELL_COMMON_PLATFORM_MESSAGE_HANDLER_H_ | ||
| #define SHELL_COMMON_PLATFORM_MESSAGE_HANDLER_H_ | ||
| | ||
| #include <memory> | ||
| | ||
| #include "flutter/lib/ui/window/platform_message.h" | ||
| | ||
| namespace flutter { | ||
| | ||
| /// An interface over the ability to handle PlatformMessages that are being sent | ||
| /// from Flutter to the host platform. | ||
| class PlatformMessageHandler { | ||
| public: | ||
| virtual ~PlatformMessageHandler() = default; | ||
| | ||
| /// Ultimately sends the PlatformMessage to the host platform. | ||
| /// This method is invoked on the ui thread. | ||
| virtual void HandlePlatformMessage( | ||
| std::unique_ptr<PlatformMessage> message) = 0; | ||
| | ||
| /// Performs the return procedure for an associated call to | ||
| /// HandlePlatformMessage. | ||
gaaclarke marked this conversation as resolved. Show resolved Hide resolved | ||
| /// This method should be thread-safe and able to be invoked on any thread. | ||
| virtual void InvokePlatformMessageResponseCallback( | ||
| int response_id, | ||
| std::unique_ptr<fml::Mapping> mapping) = 0; | ||
| | ||
| /// Performs the return procedure for an associated call to | ||
| /// HandlePlatformMessage where there is no return value. | ||
gaaclarke marked this conversation as resolved. Show resolved Hide resolved | ||
| /// This method should be thread-safe and able to be invoked on any thread. | ||
| virtual void InvokePlatformMessageEmptyResponseCallback(int response_id) = 0; | ||
| }; | ||
| } // namespace flutter | ||
| | ||
| #endif // SHELL_COMMON_PLATFORM_MESSAGE_HANDLER_H_ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.