forked from flutter/flutter
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reapply: Android background platform channels (flutter#29346)
* Revert "Revert "Android Background Platform Channels (flutter#29147)"" This reverts commit 7ed91e14ccc1f5ffc4cb13d1d37e27d370c8f7cd. * Made this PR less of a breaking change by keeping setMessageHandler's signature the same
- Loading branch information
Showing
31 changed files
with
896 additions
and
167 deletions.
There are no files selected for viewing
This file contains 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 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 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. | ||
/// 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. | ||
/// 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 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 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 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 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 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 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 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 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 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.