From 3b0ffdef5e219da480ac57ec4c122b79a938c8aa Mon Sep 17 00:00:00 2001 From: Arsentiy Milchakov Date: Tue, 15 Jan 2019 15:05:08 +0300 Subject: [PATCH] [power manager] concrete facilities and levels for auto scheme are added --- android/jni/com/mapswithme/maps/Framework.cpp | 8 +- android/jni/com/mapswithme/maps/Framework.hpp | 8 +- map/CMakeLists.txt | 6 +- map/framework.cpp | 2 +- map/framework.hpp | 11 +- map/map_tests/power_manager_tests.cpp | 245 +++++++++++++++--- .../power_management_schemas.cpp | 120 +++++++++ .../power_management_schemas.hpp | 52 ++++ .../power_manager.cpp | 97 +++---- .../power_manager.hpp | 37 +-- xcode/map/map.xcodeproj/project.pbxproj | 40 +-- 11 files changed, 463 insertions(+), 163 deletions(-) create mode 100644 map/power_management/power_management_schemas.cpp create mode 100644 map/power_management/power_management_schemas.hpp rename map/{power_manager => power_management}/power_manager.cpp (69%) rename map/{power_manager => power_management}/power_manager.hpp (59%) diff --git a/android/jni/com/mapswithme/maps/Framework.cpp b/android/jni/com/mapswithme/maps/Framework.cpp index 1f3fabe2e6..9d95eaee61 100644 --- a/android/jni/com/mapswithme/maps/Framework.cpp +++ b/android/jni/com/mapswithme/maps/Framework.cpp @@ -671,13 +671,13 @@ void Framework::LogLocalAdsEvent(local_ads::EventType type, double lat, double l m_work.GetLocalAdsManager().GetStatistics().RegisterEvent(std::move(event)); } -void Framework::OnPowerFacilityChanged(PowerManager::Facility const facility, bool enabled) +void Framework::OnPowerFacilityChanged(power_management::Facility const facility, bool enabled) { // Dummy // TODO: provide information for UI Properties. } -void Framework::OnPowerSchemeChanged(PowerManager::Scheme const actualScheme) +void Framework::OnPowerSchemeChanged(power_management::Scheme const actualScheme) { // Dummy // TODO: provide information for UI Properties. @@ -1970,14 +1970,14 @@ JNIEXPORT void JNICALL Java_com_mapswithme_maps_Framework_nativeSetPowerManagerFacility(JNIEnv *, jclass, jint facilityType, jboolean state) { - frm()->GetPowerManager().SetFacility(static_cast(facilityType), + frm()->GetPowerManager().SetFacility(static_cast(facilityType), static_cast(state)); } JNIEXPORT void JNICALL Java_com_mapswithme_maps_Framework_nativeSetPowerManagerScheme(JNIEnv *, jclass, jint schemeType) { - frm()->GetPowerManager().SetScheme(static_cast(schemeType)); + frm()->GetPowerManager().SetScheme(static_cast(schemeType)); } JNIEXPORT void JNICALL diff --git a/android/jni/com/mapswithme/maps/Framework.hpp b/android/jni/com/mapswithme/maps/Framework.hpp index 5115f85f05..506b3ac221 100644 --- a/android/jni/com/mapswithme/maps/Framework.hpp +++ b/android/jni/com/mapswithme/maps/Framework.hpp @@ -4,7 +4,7 @@ #include "map/framework.hpp" #include "map/place_page_info.hpp" -#include "map/power_manager/power_manager.hpp" +#include "map/power_management/power_manager.hpp" #include "ugc/api.hpp" @@ -49,7 +49,7 @@ struct BlockParams; namespace android { - class Framework : private PowerManager::Subscriber + class Framework : private power_management::PowerManager::Subscriber { private: drape_ptr m_contextFactory; @@ -218,8 +218,8 @@ namespace android void LogLocalAdsEvent(local_ads::EventType event, double lat, double lon, uint16_t accuracy); // PowerManager::Subscriber overrides: - void OnPowerFacilityChanged(PowerManager::Facility const facility, bool enabled) override; - void OnPowerSchemeChanged(PowerManager::Scheme const actualScheme) override; + void OnPowerFacilityChanged(power_management::Facility const facility, bool enabled) override; + void OnPowerSchemeChanged(power_management::Scheme const actualScheme) override; }; } diff --git a/map/CMakeLists.txt b/map/CMakeLists.txt index b453ec3f42..1cf150c7b1 100644 --- a/map/CMakeLists.txt +++ b/map/CMakeLists.txt @@ -87,8 +87,10 @@ set( notifications/notification_queue_storage.hpp place_page_info.cpp place_page_info.hpp - power_manager/power_manager.cpp - power_manager/power_manager.hpp + power_management/power_manager.cpp + power_management/power_manager.hpp + power_management/power_management_schemas.cpp + power_management/power_management_schemas.hpp purchase.cpp purchase.hpp reachable_by_taxi_checker.cpp diff --git a/map/framework.cpp b/map/framework.cpp index e759f13b0b..d5c1bd98a7 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -3774,7 +3774,7 @@ booking::AvailabilityParams Framework::GetLastBookingAvailabilityParams() const return m_bookingAvailabilityParams; } -void Framework::OnPowerFacilityChanged(PowerManager::Facility const facility, bool enabled) +void Framework::OnPowerFacilityChanged(power_management::Facility const facility, bool enabled) { // Dummy. // TODO: process facilities which do not have switch in UI. diff --git a/map/framework.hpp b/map/framework.hpp index 1c71e7cc5b..023355a9d2 100644 --- a/map/framework.hpp +++ b/map/framework.hpp @@ -12,7 +12,8 @@ #include "map/mwm_url.hpp" #include "map/notifications/notification_manager.hpp" #include "map/place_page_info.hpp" -#include "map/power_manager/power_manager.hpp" +#include "map/power_management/power_manager.hpp" +#include "map/power_management/power_management_schemas.hpp" #include "map/purchase.hpp" #include "map/routing_manager.hpp" #include "map/routing_mark.hpp" @@ -144,7 +145,7 @@ class Framework : public SearchAPI::Delegate, public RoutingManager::Delegate, public TipsApi::Delegate, public notifications::NotificationManager::Delegate, - private PowerManager::Subscriber + private power_management::PowerManager::Subscriber { DISALLOW_COPY(Framework); @@ -906,7 +907,7 @@ private: std::unique_ptr m_purchase; TipsApi m_tipsApi; notifications::NotificationManager m_notificationManager; - PowerManager m_powerManager; + power_management::PowerManager m_powerManager; public: TipsApi const & GetTipsApi() const; @@ -917,8 +918,8 @@ public: bool MakePlacePageInfo(eye::MapObject const & mapObject, place_page::Info & info) const; - PowerManager & GetPowerManager() { return m_powerManager; } + power_management::PowerManager & GetPowerManager() { return m_powerManager; } // PowerManager::Subscriber override. - void OnPowerFacilityChanged(PowerManager::Facility const facility, bool enabled) override; + void OnPowerFacilityChanged(power_management::Facility const facility, bool enabled) override; }; diff --git a/map/map_tests/power_manager_tests.cpp b/map/map_tests/power_manager_tests.cpp index 2b34a42af8..e190b03fc8 100644 --- a/map/map_tests/power_manager_tests.cpp +++ b/map/map_tests/power_manager_tests.cpp @@ -1,38 +1,68 @@ #include "testing/testing.hpp" -#include "map/power_manager/power_manager.hpp" +#include "map/power_management/power_manager.hpp" +#include "map/power_management/power_management_schemas.hpp" #include "platform/platform_tests_support/scoped_file.hpp" #include #include +using namespace power_management; + +namespace +{ using namespace platform::tests_support; struct SubscriberForTesting : public PowerManager::Subscriber { public: // PowerManager::Subscriber overrides: - void OnPowerFacilityChanged(PowerManager::Facility const facility, bool enabled) override + void OnPowerFacilityChanged(Facility const facility, bool enabled) override { m_onFacilityEvents.push_back({facility, enabled}); } - void OnPowerSchemeChanged(PowerManager::Scheme const actualConfig) override + void OnPowerSchemeChanged(Scheme const actualConfig) override { m_onShemeEvents.push_back(actualConfig); } struct FacilityState { - PowerManager::Facility m_facility; + Facility m_facility; bool m_state; }; std::vector m_onFacilityEvents; - std::vector m_onShemeEvents; + std::vector m_onShemeEvents; }; +void TestIsAllFacilitiesInState(PowerManager const & manager, bool state) +{ + auto const count = static_cast(Facility::Count); + for (size_t i = 0; i < count; ++i) + { + TEST_EQUAL(manager.IsFacilityEnabled(static_cast(i)), state, ()); + } +} + +void TestAllFacilitiesEnabledExcept(PowerManager const & manager, + std::vector const & disabledFacilities) +{ + auto const count = static_cast(Facility::Count); + for (size_t i = 0; i < count; ++i) + { + auto const facility = static_cast(i); + auto const it = std::find(disabledFacilities.cbegin(), disabledFacilities.cend(), facility); + + if (it == disabledFacilities.cend()) + TEST(manager.IsFacilityEnabled(facility), ()); + else + TEST(!manager.IsFacilityEnabled(facility), ()); + } +} + UNIT_TEST(PowerManager_SetFacility) { ScopedFile sf("power_manager_config", ScopedFile::Mode::DoNotCreate); @@ -41,33 +71,29 @@ UNIT_TEST(PowerManager_SetFacility) manager.Subscribe(&subscriber); - TEST_EQUAL(manager.IsFacilityEnabled(PowerManager::Facility::Buildings3d), true, ()); - TEST_EQUAL(manager.IsFacilityEnabled(PowerManager::Facility::TrackRecord), true, ()); - TEST_EQUAL(manager.GetScheme(), PowerManager::Scheme::Normal, ()); - manager.SetFacility(PowerManager::Facility::Buildings3d, false); - TEST_EQUAL(manager.IsFacilityEnabled(PowerManager::Facility::Buildings3d), false, ()); - TEST_EQUAL(manager.IsFacilityEnabled(PowerManager::Facility::TrackRecord), true, ()); - TEST_EQUAL(manager.GetScheme(), PowerManager::Scheme::None, ()); + TestIsAllFacilitiesInState(manager, true); + TEST_EQUAL(manager.GetScheme(), Scheme::Normal, ()); + manager.SetFacility(Facility::Buildings3d, false); + TestAllFacilitiesEnabledExcept(manager, {Facility::Buildings3d}); + TEST_EQUAL(manager.GetScheme(), Scheme::None, ()); TEST_EQUAL(subscriber.m_onFacilityEvents.size(), 1, ()); - TEST_EQUAL(subscriber.m_onFacilityEvents[0].m_facility, - PowerManager::Facility::Buildings3d, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[0].m_facility, Facility::Buildings3d, ()); TEST_EQUAL(subscriber.m_onFacilityEvents[0].m_state, false, ()); TEST_EQUAL(subscriber.m_onShemeEvents.size(), 1, ()); - TEST_EQUAL(subscriber.m_onShemeEvents[0], PowerManager::Scheme::None, ()); + TEST_EQUAL(subscriber.m_onShemeEvents[0], Scheme::None, ()); subscriber.m_onFacilityEvents.clear(); subscriber.m_onShemeEvents.clear(); - manager.SetFacility(PowerManager::Facility::TrackRecord, false); - TEST_EQUAL(manager.IsFacilityEnabled(PowerManager::Facility::TrackRecord), false, ()); - TEST_EQUAL(manager.GetScheme(), PowerManager::Scheme::Economy, ()); + manager.SetFacility(Facility::MapDownloader, false); + TestAllFacilitiesEnabledExcept(manager, {Facility::Buildings3d, Facility::MapDownloader}); + TEST_EQUAL(manager.GetScheme(), Scheme::None, ()); TEST_EQUAL(subscriber.m_onFacilityEvents.size(), 1, ()); - TEST_EQUAL(subscriber.m_onFacilityEvents[0].m_facility, PowerManager::Facility::TrackRecord, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[0].m_facility, Facility::MapDownloader, ()); TEST_EQUAL(subscriber.m_onFacilityEvents[0].m_state, false, ()); - TEST_EQUAL(subscriber.m_onShemeEvents.size(), 1, ()); - TEST_EQUAL(subscriber.m_onShemeEvents[0], PowerManager::Scheme::Economy, ()); + TEST_EQUAL(subscriber.m_onShemeEvents.size(), 0, ()); } UNIT_TEST(PowerManager_SetConfig) @@ -78,37 +104,172 @@ UNIT_TEST(PowerManager_SetConfig) manager.Subscribe(&subscriber); - TEST_EQUAL(manager.GetScheme(), PowerManager::Scheme::Normal, ()); - TEST_EQUAL(manager.IsFacilityEnabled(PowerManager::Facility::Buildings3d), true, ()); - TEST_EQUAL(manager.IsFacilityEnabled(PowerManager::Facility::TrackRecord), true, ()); - manager.SetScheme(PowerManager::Scheme::Economy); - TEST_EQUAL(manager.GetScheme(), PowerManager::Scheme::Economy, ()); - TEST_EQUAL(manager.IsFacilityEnabled(PowerManager::Facility::Buildings3d), false, ()); - TEST_EQUAL(manager.IsFacilityEnabled(PowerManager::Facility::TrackRecord), false, ()); + TestIsAllFacilitiesInState(manager, true); + TEST_EQUAL(manager.GetScheme(), Scheme::Normal, ()); + manager.SetScheme(Scheme::EconomyMaximum); + TEST_EQUAL(manager.GetScheme(), Scheme::EconomyMaximum, ()); + TestAllFacilitiesEnabledExcept(manager, {Facility::Buildings3d, + Facility::PerspectiveView, + Facility::TrackRecording, + Facility::TrafficJams, + Facility::GpsTrackingForTraffic, + Facility::OsmEditsUploading, + Facility::UgcUploading, + Facility::BookmarkCloudUploading}); TEST_EQUAL(subscriber.m_onShemeEvents.size(), 1, ()); - TEST_EQUAL(subscriber.m_onShemeEvents[0], PowerManager::Scheme::Economy, ()); - TEST_EQUAL(subscriber.m_onFacilityEvents.size(), 2, ()); - TEST_EQUAL(subscriber.m_onFacilityEvents[0].m_facility, - PowerManager::Facility::Buildings3d, ()); + TEST_EQUAL(subscriber.m_onShemeEvents[0], Scheme::EconomyMaximum, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents.size(), 8, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[0].m_facility, Facility::Buildings3d, ()); TEST_EQUAL(subscriber.m_onFacilityEvents[0].m_state, false, ()); - TEST_EQUAL(subscriber.m_onFacilityEvents[1].m_facility, PowerManager::Facility::TrackRecord, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[1].m_facility, Facility::PerspectiveView, ()); TEST_EQUAL(subscriber.m_onFacilityEvents[1].m_state, false, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[2].m_facility, Facility::TrackRecording, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[2].m_state, false, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[3].m_facility, Facility::TrafficJams, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[3].m_state, false, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[4].m_facility, Facility::GpsTrackingForTraffic, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[4].m_state, false, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[5].m_facility, Facility::OsmEditsUploading, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[5].m_state, false, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[6].m_facility, Facility::UgcUploading, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[6].m_state, false, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[7].m_facility, Facility::BookmarkCloudUploading, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[7].m_state, false, ()); subscriber.m_onFacilityEvents.clear(); subscriber.m_onShemeEvents.clear(); - manager.SetScheme(PowerManager::Scheme::Normal); - TEST_EQUAL(manager.GetScheme(), PowerManager::Scheme::Normal, ()); - TEST_EQUAL(manager.IsFacilityEnabled(PowerManager::Facility::Buildings3d), true, ()); - TEST_EQUAL(manager.IsFacilityEnabled(PowerManager::Facility::TrackRecord), true, ()); + manager.SetScheme(Scheme::EconomyMedium); + TEST_EQUAL(manager.GetScheme(), Scheme::EconomyMedium, ()); + + TestAllFacilitiesEnabledExcept(manager, + {Facility::PerspectiveView, Facility::BookmarkCloudUploading}); TEST_EQUAL(subscriber.m_onShemeEvents.size(), 1, ()); - TEST_EQUAL(subscriber.m_onShemeEvents[0], PowerManager::Scheme::Normal, ()); - TEST_EQUAL(subscriber.m_onFacilityEvents.size(), 2, ()); - TEST_EQUAL(subscriber.m_onFacilityEvents[0].m_facility, - PowerManager::Facility::Buildings3d, ()); + TEST_EQUAL(subscriber.m_onShemeEvents[0], Scheme::EconomyMedium, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents.size(), 6, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[0].m_facility, Facility::Buildings3d, ()); TEST_EQUAL(subscriber.m_onFacilityEvents[0].m_state, true, ()); - TEST_EQUAL(subscriber.m_onFacilityEvents[1].m_facility, PowerManager::Facility::TrackRecord, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[1].m_facility, Facility::TrackRecording, ()); TEST_EQUAL(subscriber.m_onFacilityEvents[1].m_state, true, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[2].m_facility, Facility::TrafficJams, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[2].m_state, true, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[3].m_facility, Facility::GpsTrackingForTraffic, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[3].m_state, true, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[4].m_facility, Facility::OsmEditsUploading, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[4].m_state, true, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[5].m_facility, Facility::UgcUploading, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[5].m_state, true, ()); } + +UNIT_TEST(PowerManager_OnBatteryLevelChanged) +{ + ScopedFile sf("power_manager_config", ScopedFile::Mode::DoNotCreate); + PowerManager manager; + SubscriberForTesting subscriber; + + manager.Subscribe(&subscriber); + + TestIsAllFacilitiesInState(manager, true); + TEST_EQUAL(manager.GetScheme(), Scheme::Normal, ()); + + manager.OnBatteryLevelChanged(50); + + TestIsAllFacilitiesInState(manager, true); + TEST_EQUAL(manager.GetScheme(), Scheme::Normal, ()); + + TEST_EQUAL(subscriber.m_onShemeEvents.size(), 0, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents.size(), 0, ()); + + manager.OnBatteryLevelChanged(10); + + TestIsAllFacilitiesInState(manager, true); + TEST_EQUAL(manager.GetScheme(), Scheme::Normal, ()); + + TEST_EQUAL(subscriber.m_onShemeEvents.size(), 0, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents.size(), 0, ()); + + manager.SetScheme(Scheme::Auto); + + TEST_EQUAL(subscriber.m_onShemeEvents.size(), 1, ()); + TEST_EQUAL(subscriber.m_onShemeEvents[0], Scheme::Auto, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents.size(), 0, ()); + + subscriber.m_onShemeEvents.clear(); + subscriber.m_onFacilityEvents.clear(); + + manager.OnBatteryLevelChanged(50); + + TestIsAllFacilitiesInState(manager, true); + TEST_EQUAL(manager.GetScheme(), Scheme::Auto, ()); + + TEST_EQUAL(subscriber.m_onShemeEvents.size(), 0, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents.size(), 0, ()); + + manager.OnBatteryLevelChanged(28); + + TestAllFacilitiesEnabledExcept(manager, {Facility::PerspectiveView, + Facility::GpsTrackingForTraffic, + Facility::BookmarkCloudUploading, + Facility::MapDownloader, + Facility::StatisticsUploading}); + TEST_EQUAL(manager.GetScheme(), Scheme::Auto, ()); + + TEST_EQUAL(subscriber.m_onShemeEvents.size(), 0, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents.size(), 5, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[0].m_facility, Facility::PerspectiveView, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[0].m_state, false, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[1].m_facility, Facility::GpsTrackingForTraffic, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[1].m_state, false, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[2].m_facility, Facility::BookmarkCloudUploading, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[2].m_state, false, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[3].m_facility, Facility::MapDownloader, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[3].m_state, false, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[4].m_facility, Facility::StatisticsUploading, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[4].m_state, false, ()); + + subscriber.m_onShemeEvents.clear(); + subscriber.m_onFacilityEvents.clear(); + + manager.OnBatteryLevelChanged(10); + + TestIsAllFacilitiesInState(manager, false); + TEST_EQUAL(manager.GetScheme(), Scheme::Auto, ()); + + TEST_EQUAL(subscriber.m_onShemeEvents.size(), 0, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents.size(), 7, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[0].m_facility, Facility::Buildings3d, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[0].m_state, false, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[1].m_facility, Facility::TrackRecording, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[1].m_state, false, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[2].m_facility, Facility::TrafficJams, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[2].m_state, false, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[3].m_facility, Facility::OsmEditsUploading, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[3].m_state, false, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[4].m_facility, Facility::UgcUploading, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[4].m_state, false, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[5].m_facility, Facility::LocalAdsDataDownloading, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[5].m_state, false, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[6].m_facility, Facility::AdsDownloading, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[6].m_state, false, ()); + + subscriber.m_onShemeEvents.clear(); + subscriber.m_onFacilityEvents.clear(); + + manager.OnBatteryLevelChanged(100); + + TestIsAllFacilitiesInState(manager, true); + TEST_EQUAL(manager.GetScheme(), Scheme::Auto, ()); + + TEST_EQUAL(subscriber.m_onShemeEvents.size(), 0, ()); + TEST_EQUAL(subscriber.m_onFacilityEvents.size(), 12, ()); + + auto const & facilityEvents = subscriber.m_onFacilityEvents; + for (size_t i = 0; i < facilityEvents.size(); ++i) + { + TEST_EQUAL(facilityEvents[i].m_facility, static_cast(i), ()); + TEST_EQUAL(subscriber.m_onFacilityEvents[i].m_state, true, ()); + } +} +} // namespace diff --git a/map/power_management/power_management_schemas.cpp b/map/power_management/power_management_schemas.cpp new file mode 100644 index 0000000000..f050247cf6 --- /dev/null +++ b/map/power_management/power_management_schemas.cpp @@ -0,0 +1,120 @@ +#include "map/power_management/power_management_schemas.hpp" + +#include "base/assert.hpp" + +#include + +using namespace power_management; + +namespace +{ +std::unordered_map const kSchemeToState = +{ + { + Scheme::Normal, + {{ + /* Buildings3d */ true, /* PerspectiveView */ true, /* TrackRecording */ true, + /* TrafficJams */ true, /* GpsTrackingForTraffic */ true, /* OsmEditsUploading */ true, + /* UgcUploading */ true, /* BookmarkCloudUploading */ true, /* LocalAdsDataDownloading */ true, + /* MapDownloader */ true, /* StatisticsUploading */ true, /* AdsDownloading */ true + }} + }, + { + Scheme::EconomyMedium, + {{ + /* Buildings3d */ true, /* PerspectiveView */ false, /* TrackRecording */ true, + /* TrafficJams */ true, /* GpsTrackingForTraffic */ true, /* OsmEditsUploading */ true, + /* UgcUploading */ true, /* BookmarkCloudUploading */ false, /* LocalAdsDataDownloading */ true, + /* MapDownloader */ true, /* StatisticsUploading */ true, /* AdsDownloading */ true + }} + }, + { + Scheme::EconomyMaximum, + {{ + /* Buildings3d */ false, /* PerspectiveView */ false, /* TrackRecording */ false, + /* TrafficJams */ false, /* GpsTrackingForTraffic */ false, /* OsmEditsUploading */ false, + /* UgcUploading */ false, /* BookmarkCloudUploading */ false, /* LocalAdsDataDownloading */ true, + /* MapDownloader */ true, /* StatisticsUploading */ true, /* AdsDownloading */ true + }} + }, +}; + +std::unordered_map const kAutoSchemeToState = +{ + { + AutoScheme::Normal, + {{ + /* Buildings3d */ true, /* PerspectiveView */ true, /* TrackRecording */ true, + /* TrafficJams */ true, /* GpsTrackingForTraffic */ true, /* OsmEditsUploading */ true, + /* UgcUploading */ true, /* BookmarkCloudUploading */ true, /* LocalAdsDataDownloading */ true, + /* MapDownloader */ true, /* StatisticsUploading */ true, /* AdsDownloading */ true + }} + }, + { + AutoScheme::EconomyMedium, + {{ + /* Buildings3d */ true, /* PerspectiveView */ false, /* TrackRecording */ true, + /* TrafficJams */ true, /* GpsTrackingForTraffic */ false, /* OsmEditsUploading */ true, + /* UgcUploading */ true, /* BookmarkCloudUploading */ false, /* LocalAdsDataDownloading */ true, + /* MapDownloader */ false, /* StatisticsUploading */ false, /* AdsDownloading */ true + }} + }, + { + AutoScheme::EconomyMaximum, + {{ + /* Buildings3d */ false, /* PerspectiveView */ false, /* TrackRecording */ false, + /* TrafficJams */ false, /* GpsTrackingForTraffic */ false, /* OsmEditsUploading */ false, + /* UgcUploading */ false, /* BookmarkCloudUploading */ false, /* LocalAdsDataDownloading */ false, + /* MapDownloader */ false, /* StatisticsUploading */ false, /* AdsDownloading */ false + }} + }, +}; +} // namespace + +namespace power_management +{ +FacilitiesState const & GetFacilitiesState(Scheme const scheme) +{ + CHECK_NOT_EQUAL(scheme, Scheme::None, ()); + CHECK_NOT_EQUAL(scheme, Scheme::Auto, ()); + + return kSchemeToState.at(scheme); +} + +FacilitiesState const & GetFacilitiesState(AutoScheme const autoScheme) +{ + return kAutoSchemeToState.at(autoScheme); +} + +std::string DebugPrint(Facility const facility) +{ + switch (facility) + { + case Facility::Buildings3d: return "Buildings3d"; + case Facility::PerspectiveView: return "PerspectiveView"; + case Facility::TrackRecording: return "TrackRecording"; + case Facility::TrafficJams: return "TrafficJams"; + case Facility::GpsTrackingForTraffic: return "GpsTrackingForTraffic"; + case Facility::OsmEditsUploading: return "OsmEditsUploading"; + case Facility::UgcUploading: return "UgcUploading"; + case Facility::BookmarkCloudUploading: return "BookmarkCloudUploading"; + case Facility::LocalAdsDataDownloading: return "LocalAdsDataDownloading"; + case Facility::MapDownloader: return "MapDownloader"; + case Facility::StatisticsUploading: return "StatisticsUploading"; + case Facility::AdsDownloading: return "AdsDownloading"; + case Facility::Count: return "Count"; + } +} + +std::string DebugPrint(Scheme const scheme) +{ + switch (scheme) + { + case Scheme::None: return "None"; + case Scheme::Normal: return "Normal"; + case Scheme::EconomyMedium: return "EconomyMedium"; + case Scheme::EconomyMaximum: return "EconomyMaximum"; + case Scheme::Auto: return "Auto"; + } +} +} // namespace power_management diff --git a/map/power_management/power_management_schemas.hpp b/map/power_management/power_management_schemas.hpp new file mode 100644 index 0000000000..efcfe1deeb --- /dev/null +++ b/map/power_management/power_management_schemas.hpp @@ -0,0 +1,52 @@ +#pragma once + +#include +#include + +namespace power_management +{ +// Note: the order is important. +// Note: new facilities must be added before Facility::Count. +// Note: do not use Facility::Count in external code, this value for internal use only. +enum class Facility : uint8_t +{ + Buildings3d, + PerspectiveView, + TrackRecording, + TrafficJams, + GpsTrackingForTraffic, + OsmEditsUploading, + UgcUploading, + BookmarkCloudUploading, + LocalAdsDataDownloading, + MapDownloader, + StatisticsUploading, + AdsDownloading, + + Count +}; + +enum class Scheme : uint8_t +{ + None, + Normal, + EconomyMedium, + EconomyMaximum, + Auto, +}; + +enum class AutoScheme : uint8_t +{ + Normal, + EconomyMedium, + EconomyMaximum, +}; + +using FacilitiesState = std::array(Facility::Count)>; + +FacilitiesState const & GetFacilitiesState(Scheme const scheme); +FacilitiesState const & GetFacilitiesState(AutoScheme const autoScheme); + +std::string DebugPrint(Facility const facility); +std::string DebugPrint(Scheme const scheme); +} // namespace power_management diff --git a/map/power_manager/power_manager.cpp b/map/power_management/power_manager.cpp similarity index 69% rename from map/power_manager/power_manager.cpp rename to map/power_management/power_manager.cpp index fc22e89389..14fcc73d60 100644 --- a/map/power_manager/power_manager.cpp +++ b/map/power_management/power_manager.cpp @@ -1,4 +1,4 @@ -#include "map/power_manager/power_manager.hpp" +#include "map/power_management/power_manager.hpp" #include "platform/platform.hpp" @@ -11,37 +11,32 @@ #include "base/assert.hpp" #include "base/logging.hpp" -#include +using namespace power_management; namespace { using Subscribers = std::vector; -std::unordered_map const kSchemeToState = -{ - {PowerManager::Scheme::Normal, {{true, true}}}, - {PowerManager::Scheme::Economy, {{false, false}}} -}; - std::string GetFilePath() { return base::JoinPath(GetPlatform().SettingsDir(), "power_manager_config"); } -void NotifySubscribers(Subscribers & subscribers, PowerManager::Scheme const scheme) +void NotifySubscribers(Subscribers & subscribers, Scheme const scheme) { for (auto & subscriber : subscribers) subscriber->OnPowerSchemeChanged(scheme); } -void NotifySubscribers(Subscribers & subscribers, PowerManager::Facility const facility, - bool enabled) +void NotifySubscribers(Subscribers & subscribers, Facility const facility, bool enabled) { for (auto & subscriber : subscribers) subscriber->OnPowerFacilityChanged(facility, enabled); } } // namespace +namespace power_management +{ void PowerManager::Load() { try @@ -84,7 +79,8 @@ void PowerManager::SetFacility(Facility const facility, bool enabled) m_config.m_facilities[static_cast(facility)] = enabled; - auto const isSchemeChanged = BalanceScheme(); + auto const isSchemeChanged = m_config.m_scheme != Scheme::None; + m_config.m_scheme = Scheme::None; if (!Save()) return; @@ -103,9 +99,12 @@ void PowerManager::SetScheme(Scheme const scheme) m_config.m_scheme = scheme; if (m_config.m_scheme == Scheme::None || m_config.m_scheme == Scheme::Auto) + { + NotifySubscribers(m_subscribers, m_config.m_scheme); return; + } - auto actualState = kSchemeToState.at(scheme); + auto actualState = GetFacilitiesState(scheme); if (m_config.m_facilities == actualState) return; @@ -131,12 +130,12 @@ bool PowerManager::IsFacilityEnabled(Facility const facility) const return m_config.m_facilities[static_cast(facility)]; } -PowerManager::FacilitiesState const & PowerManager::GetFacilities() const +FacilitiesState const & PowerManager::GetFacilities() const { return m_config.m_facilities; } -PowerManager::Scheme const & PowerManager::GetScheme() const +Scheme const & PowerManager::GetScheme() const { return m_config.m_scheme; } @@ -148,7 +147,27 @@ void PowerManager::OnBatteryLevelChanged(uint8_t level) if (m_config.m_scheme != Scheme::Auto) return; - // TODO. + AutoScheme actualScheme = AutoScheme::Normal; + if (level < 20) + actualScheme = AutoScheme::EconomyMaximum; + else if (level < 30) + actualScheme = AutoScheme::EconomyMedium; + + auto actualState = GetFacilitiesState(actualScheme); + + if (m_config.m_facilities == actualState) + return; + + std::swap(m_config.m_facilities, actualState); + + if (!Save()) + return; + + for (size_t i = 0; i < actualState.size(); ++i) + { + if (m_config.m_facilities[i] != actualState[i]) + NotifySubscribers(m_subscribers, static_cast(i), m_config.m_facilities[i]); + } } void PowerManager::Subscribe(Subscriber * subscriber) @@ -162,30 +181,6 @@ void PowerManager::UnsubscribeAll() m_subscribers.clear(); } -bool PowerManager::BalanceScheme() -{ - bool found = false; - Scheme actualScheme = m_config.m_scheme; - for (auto const & item : kSchemeToState) - { - if (item.second == m_config.m_facilities) - { - actualScheme = item.first; - found = true; - break; - } - } - - if (!found) - actualScheme = Scheme::None; - - if (m_config.m_scheme == actualScheme) - return false; - - m_config.m_scheme = actualScheme; - return true; -} - bool PowerManager::Save() { auto const result = base::WriteToTempAndRenameToFile(GetFilePath(), [this](string const & fileName) @@ -216,24 +211,4 @@ bool PowerManager::Save() Load(); return false; } - -std::string DebugPrint(PowerManager::Facility const facility) -{ - switch (facility) - { - case PowerManager::Facility::Buildings3d: return "Buildings3d"; - case PowerManager::Facility::TrackRecord: return "TrackRecord"; - case PowerManager::Facility::Count: return "Count"; - } -} - -std::string DebugPrint(PowerManager::Scheme const scheme) -{ - switch (scheme) - { - case PowerManager::Scheme::None: return "None"; - case PowerManager::Scheme::Normal: return "Normal"; - case PowerManager::Scheme::Economy: return "Economy"; - case PowerManager::Scheme::Auto: return "Auto"; - } -} +} // namespace power_management diff --git a/map/power_manager/power_manager.hpp b/map/power_management/power_manager.hpp similarity index 59% rename from map/power_manager/power_manager.hpp rename to map/power_management/power_manager.hpp index c4acdf909a..2b2afc61df 100644 --- a/map/power_manager/power_manager.hpp +++ b/map/power_management/power_manager.hpp @@ -1,37 +1,19 @@ #pragma once +#include "map/power_management/power_management_schemas.hpp" + #include "base/visitor.hpp" -#include #include #include #include +namespace power_management +{ // Note: this class is NOT thread-safe. class PowerManager { public: - // Note: the order is important. - // Note: new facilities must be added before Facility::Count. - // Note: do not use Facility::Count in external code, this value for internal use only. - enum class Facility : uint8_t - { - Buildings3d, - TrackRecord, - - Count - }; - - using FacilitiesState = std::array(Facility::Count)>; - - enum class Scheme : uint8_t - { - None, - Normal, - Economy, - Auto - }; - class Subscriber { public: @@ -42,6 +24,7 @@ public: }; void Load(); + // Set some facility state manually, it turns current scheme to Scheme::None. void SetFacility(Facility const facility, bool enabled); void SetScheme(Scheme const scheme); bool IsFacilityEnabled(Facility const facility) const; @@ -58,18 +41,16 @@ private: { DECLARE_VISITOR(visitor(m_facilities, "current_state"), visitor(m_scheme, "scheme")); - FacilitiesState m_facilities = {{true, true}}; + Config() { m_facilities.fill(true); } + + FacilitiesState m_facilities; Scheme m_scheme = Scheme::Normal; }; - // Returns true when scheme was changed. - bool BalanceScheme(); bool Save(); std::vector m_subscribers; Config m_config; }; - -std::string DebugPrint(PowerManager::Facility const facility); -std::string DebugPrint(PowerManager::Scheme const scheme); +} // namespace power_management diff --git a/xcode/map/map.xcodeproj/project.pbxproj b/xcode/map/map.xcodeproj/project.pbxproj index fe9a3bc58f..9062b2a748 100644 --- a/xcode/map/map.xcodeproj/project.pbxproj +++ b/xcode/map/map.xcodeproj/project.pbxproj @@ -10,8 +10,6 @@ 0831F23C200E53600034C365 /* bookmarks_search_params.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 0831F23B200E53600034C365 /* bookmarks_search_params.hpp */; }; 0C2B73DE1E92AB9900530BB8 /* local_ads_manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0C2B73DC1E92AB9900530BB8 /* local_ads_manager.cpp */; }; 0C2B73DF1E92AB9900530BB8 /* local_ads_manager.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 0C2B73DD1E92AB9900530BB8 /* local_ads_manager.hpp */; }; - 33C3A59B21D0EB7A00BE927F /* power_manager.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 33C3A59921D0EB7A00BE927F /* power_manager.hpp */; }; - 33C3A59C21D0EB7A00BE927F /* power_manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33C3A59A21D0EB7A00BE927F /* power_manager.cpp */; }; 342D833A1D5233E8000D8AEA /* displacement_mode_manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 342D83381D5233E8000D8AEA /* displacement_mode_manager.cpp */; }; 342D833B1D5233E8000D8AEA /* displacement_mode_manager.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 342D83391D5233E8000D8AEA /* displacement_mode_manager.hpp */; }; 34583BCF1C88556800F94664 /* place_page_info.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34583BCD1C88556800F94664 /* place_page_info.cpp */; }; @@ -89,6 +87,10 @@ 3DD1166C21888AAD007A2ED4 /* notification_queue_serdes.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 3DD1166521888AAC007A2ED4 /* notification_queue_serdes.hpp */; }; 3DD122BB2135708900EDFB53 /* libmetrics_tests_support.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DD122BA2135708900EDFB53 /* libmetrics_tests_support.a */; }; 3DD122BD2135708900EDFB53 /* libmetrics.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DD122BC2135708900EDFB53 /* libmetrics.a */; }; + 3DEE1ADE21EE03B400054A91 /* power_management_schemas.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 3DEE1ADA21EE03B400054A91 /* power_management_schemas.hpp */; }; + 3DEE1ADF21EE03B400054A91 /* power_manager.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 3DEE1ADB21EE03B400054A91 /* power_manager.hpp */; }; + 3DEE1AE021EE03B400054A91 /* power_manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3DEE1ADC21EE03B400054A91 /* power_manager.cpp */; }; + 3DEE1AE121EE03B400054A91 /* power_management_schemas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3DEE1ADD21EE03B400054A91 /* power_management_schemas.cpp */; }; 3DF54F80219DD21000D12E37 /* utils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3DF54F7E219DD21000D12E37 /* utils.cpp */; }; 3DF54F81219DD21000D12E37 /* utils.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 3DF54F7F219DD21000D12E37 /* utils.hpp */; }; 3DF54F8A21AEA04A00D12E37 /* framework_light.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3DF54F8921AEA04900D12E37 /* framework_light.cpp */; }; @@ -245,8 +247,6 @@ 0831F23B200E53600034C365 /* bookmarks_search_params.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bookmarks_search_params.hpp; sourceTree = ""; }; 0C2B73DC1E92AB9900530BB8 /* local_ads_manager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = local_ads_manager.cpp; sourceTree = ""; }; 0C2B73DD1E92AB9900530BB8 /* local_ads_manager.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = local_ads_manager.hpp; sourceTree = ""; }; - 33C3A59921D0EB7A00BE927F /* power_manager.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = power_manager.hpp; sourceTree = ""; }; - 33C3A59A21D0EB7A00BE927F /* power_manager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = power_manager.cpp; sourceTree = ""; }; 342D83381D5233E8000D8AEA /* displacement_mode_manager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = displacement_mode_manager.cpp; sourceTree = ""; }; 342D83391D5233E8000D8AEA /* displacement_mode_manager.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = displacement_mode_manager.hpp; sourceTree = ""; }; 34583BCD1C88556800F94664 /* place_page_info.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = place_page_info.cpp; sourceTree = ""; }; @@ -327,6 +327,10 @@ 3DD1166521888AAC007A2ED4 /* notification_queue_serdes.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = notification_queue_serdes.hpp; sourceTree = ""; }; 3DD122BA2135708900EDFB53 /* libmetrics_tests_support.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libmetrics_tests_support.a; sourceTree = BUILT_PRODUCTS_DIR; }; 3DD122BC2135708900EDFB53 /* libmetrics.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libmetrics.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 3DEE1ADA21EE03B400054A91 /* power_management_schemas.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = power_management_schemas.hpp; sourceTree = ""; }; + 3DEE1ADB21EE03B400054A91 /* power_manager.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = power_manager.hpp; sourceTree = ""; }; + 3DEE1ADC21EE03B400054A91 /* power_manager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = power_manager.cpp; sourceTree = ""; }; + 3DEE1ADD21EE03B400054A91 /* power_management_schemas.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = power_management_schemas.cpp; sourceTree = ""; }; 3DF54F7E219DD21000D12E37 /* utils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = utils.cpp; sourceTree = ""; }; 3DF54F7F219DD21000D12E37 /* utils.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = utils.hpp; sourceTree = ""; }; 3DF54F8921AEA04900D12E37 /* framework_light.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = framework_light.cpp; sourceTree = ""; }; @@ -584,15 +588,6 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 33C3A59821D0EB7A00BE927F /* power_manager */ = { - isa = PBXGroup; - children = ( - 33C3A59921D0EB7A00BE927F /* power_manager.hpp */, - 33C3A59A21D0EB7A00BE927F /* power_manager.cpp */, - ); - path = power_manager; - sourceTree = ""; - }; 34DDA17E1DBE5DF40088A609 /* Frameworks */ = { isa = PBXGroup; children = ( @@ -670,6 +665,17 @@ path = notifications; sourceTree = ""; }; + 3DEE1AD921EE03B400054A91 /* power_management */ = { + isa = PBXGroup; + children = ( + 3DEE1ADA21EE03B400054A91 /* power_management_schemas.hpp */, + 3DEE1ADB21EE03B400054A91 /* power_manager.hpp */, + 3DEE1ADC21EE03B400054A91 /* power_manager.cpp */, + 3DEE1ADD21EE03B400054A91 /* power_management_schemas.cpp */, + ); + path = power_management; + sourceTree = ""; + }; 674A29CA1B26FCC0001A525C /* map_tests */ = { isa = PBXGroup; children = ( @@ -778,6 +784,7 @@ 675345BD1A4054AD00A0A8C3 /* map */ = { isa = PBXGroup; children = ( + 3DEE1AD921EE03B400054A91 /* power_management */, 675345CB1A4054E800A0A8C3 /* address_finder.cpp */, 45201E921CE4AC90008A4842 /* api_mark_point.cpp */, 34921F611BFA0A6900737D6E /* api_mark_point.hpp */, @@ -846,7 +853,6 @@ 674A2A371B2715FB001A525C /* osm_opening_hours.hpp */, 34583BCD1C88556800F94664 /* place_page_info.cpp */, 34583BCE1C88556800F94664 /* place_page_info.hpp */, - 33C3A59821D0EB7A00BE927F /* power_manager */, 451E692821494C2700764A97 /* purchase.cpp */, 451E692721494C2600764A97 /* purchase.hpp */, F63421F61DF9BF9100A96868 /* reachable_by_taxi_checker.cpp */, @@ -964,7 +970,6 @@ 3DD1166721888AAC007A2ED4 /* notification_queue.hpp in Headers */, 3DA5723020C195ED007BDE27 /* viewport_search_callback.hpp in Headers */, F6FC3CB51FC323430001D929 /* discovery_client_params.hpp in Headers */, - 33C3A59B21D0EB7A00BE927F /* power_manager.hpp in Headers */, 0831F23C200E53600034C365 /* bookmarks_search_params.hpp in Headers */, 0C2B73DF1E92AB9900530BB8 /* local_ads_manager.hpp in Headers */, 675346631A4054E800A0A8C3 /* feature_vec_model.hpp in Headers */, @@ -973,6 +978,7 @@ 675346651A4054E800A0A8C3 /* framework.hpp in Headers */, BBA014B120754997007402E4 /* user_mark_id_storage.hpp in Headers */, 674A2A381B2715FB001A525C /* osm_opening_hours.hpp in Headers */, + 3DEE1ADF21EE03B400054A91 /* power_manager.hpp in Headers */, F6D2CE7F1EDEB7F500636DFD /* routing_manager.hpp in Headers */, 451E692921494C2700764A97 /* purchase.hpp in Headers */, 670E39411C46C5C700E9C0A6 /* gps_tracker.hpp in Headers */, @@ -981,6 +987,7 @@ BBD9E2C71EE9D01900DF189A /* routing_mark.hpp in Headers */, 3DF54F81219DD21000D12E37 /* utils.hpp in Headers */, 342D833B1D5233E8000D8AEA /* displacement_mode_manager.hpp in Headers */, + 3DEE1ADE21EE03B400054A91 /* power_management_schemas.hpp in Headers */, F6B283041C1B03320081957A /* gps_track_collection.hpp in Headers */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1156,7 +1163,7 @@ 674C38621BFF3095000D603B /* user_mark.cpp in Sources */, 3DA5723320C195ED007BDE27 /* viewport_search_callback.cpp in Sources */, 675346641A4054E800A0A8C3 /* framework.cpp in Sources */, - 33C3A59C21D0EB7A00BE927F /* power_manager.cpp in Sources */, + 3DEE1AE021EE03B400054A91 /* power_manager.cpp in Sources */, BB4E5F281FCC664A00A77250 /* transit_reader.cpp in Sources */, 454649F11F2728CE00EF4064 /* local_ads_mark.cpp in Sources */, F63421F81DF9BF9100A96868 /* reachable_by_taxi_checker.cpp in Sources */, @@ -1186,6 +1193,7 @@ 45580ABE1E2CBD5E00CD535D /* benchmark_tools.cpp in Sources */, 3DF54F80219DD21000D12E37 /* utils.cpp in Sources */, 3DA5723220C195ED007BDE27 /* everywhere_search_callback.cpp in Sources */, + 3DEE1AE121EE03B400054A91 /* power_management_schemas.cpp in Sources */, BBD9E2C61EE9D01900DF189A /* routing_mark.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0;