Implemet save_device UX for fast pair windwos

PiperOrigin-RevId: 549693338
This commit is contained in:
Qin Wang
2023-07-20 11:42:21 -07:00
committed by Copybara-Service
parent 0cd8aaab25
commit be688441aa
3 changed files with 12 additions and 0 deletions
+6
View File
@@ -69,6 +69,12 @@ class FastPairService {
// same lifetime as this `FastPairService` instance.
AccountManager* GetAccountManager() { return account_manager_.get(); }
// Returns a `FastPairRepository` implementation. The returned object has the
// same lifetime as this `FastPairService` instance.
FastPairRepository* GetFastPairRepository() {
return fast_pair_repository_.get();
}
private:
struct PluginState {
// Gets the plugin for `device`. Creates the plugin if it does not exist.
@@ -72,6 +72,10 @@ class Mediator final : public ScannerBroker::Observer,
return notification_controller_.get();
}
FastPairRepository* GetFastPairRepository() {
return fast_pair_repository_.get();
}
void StartScanning();
void StopScanning();
+2
View File
@@ -75,6 +75,8 @@ void BuildFastPairInfo(::nearby::fastpair::proto::FastPairInfo* fast_pair_info,
discovery_item.set_first_observation_timestamp_millis(
absl::ToInt64Milliseconds(absl::Now() - absl::UnixEpoch()));
discovery_item.set_state(proto::StoredDiscoveryItem::STATE_ENABLED);
discovery_item.set_icon_fife_url(
metadata->GetResponse().device().image_url());
discovery_item.set_icon_png(metadata->GetResponse().image());
discovery_item.add_stored_relevances()->mutable_relevance()->set_evaluation(
proto::Evaluation::EVALUATION_GREAT);