Make ShainrgPlatform return a shared instance of SystemInfo.

PiperOrigin-RevId: 668012698
This commit is contained in:
Francis Tsui
2024-08-27 09:12:29 -07:00
committed by Copybara-Service
parent 4bca950bc7
commit 163dbe6589
2 changed files with 4 additions and 5 deletions
+1 -2
View File
@@ -87,8 +87,7 @@ class MockSharingPlatform : public SharingPlatform {
std::function<void(absl::Status)> callback),
(override));
MOCK_METHOD(std::unique_ptr<nearby::api::SystemInfo>, CreateSystemInfo, (),
(override));
MOCK_METHOD(nearby::api::SystemInfo&, GetSystemInfo, (), (override));
MOCK_METHOD(std::unique_ptr<nearby::api::AppInfo>, CreateAppInfo, (),
(override));
+3 -3
View File
@@ -84,9 +84,9 @@ class SharingPlatform {
virtual void CopyText(absl::string_view text,
std::function<void(absl::Status)> callback) = 0;
// Creates system information class. SystemInfo provides APIs to access
// system information.
virtual std::unique_ptr<nearby::api::SystemInfo> CreateSystemInfo() = 0;
// Get an instance of the system information class. SystemInfo provides APIs
// to access system information.
virtual nearby::api::SystemInfo& GetSystemInfo() = 0;
// Creates app information class. AppInfo provides APIs to access app
// information, such as app version.