diff options
author | Arsentiy Milchakov <milcars@mapswithme.com> | 2019-02-08 11:35:26 +0300 |
---|---|---|
committer | Aleksey Belousov <beloal@users.noreply.github.com> | 2019-02-11 12:15:05 +0300 |
commit | ee334623870068abfb0a83ca8d4dd3e7b7efd691 (patch) | |
tree | 642aacc24eefe8de7ad9ea5f8998f1721c8e8268 /iphone | |
parent | 175502d775c71f45af11d2dfe78076615638a12f (diff) |
[android][ios][power managment] statistics
Diffstat (limited to 'iphone')
-rw-r--r-- | iphone/Maps/Common/Statistics/StatisticsStrings.h | 1 | ||||
-rw-r--r-- | iphone/Maps/UI/Settings/MWMPowerManagmentViewController.mm | 23 |
2 files changed, 21 insertions, 3 deletions
diff --git a/iphone/Maps/Common/Statistics/StatisticsStrings.h b/iphone/Maps/Common/Statistics/StatisticsStrings.h index da698f75cc..a49d0731f2 100644 --- a/iphone/Maps/Common/Statistics/StatisticsStrings.h +++ b/iphone/Maps/Common/Statistics/StatisticsStrings.h @@ -147,6 +147,7 @@ static NSString * const kStatEditorProblemReport = @"Editor_Problem_report"; static NSString * const kStatEditorRegRequest = @"Editor_Reg_request"; static NSString * const kStatEditorSecondTimeShareClick = @"Editor_SecondTimeShare_click"; static NSString * const kStatEditorSecondTimeShareShow = @"Editor_SecondTimeShare_show"; +static NSString * const kStatEnergySavingChange = @"Settings_EnergySaving_change"; static NSString * const kStatError = @"error"; static NSString * const kStatErrorCode = @"error_code"; static NSString * const kStatErrorData = @"err_data"; diff --git a/iphone/Maps/UI/Settings/MWMPowerManagmentViewController.mm b/iphone/Maps/UI/Settings/MWMPowerManagmentViewController.mm index 6add3e22d3..8cf162abb7 100644 --- a/iphone/Maps/UI/Settings/MWMPowerManagmentViewController.mm +++ b/iphone/Maps/UI/Settings/MWMPowerManagmentViewController.mm @@ -1,5 +1,6 @@ #import "MWMPowerManagmentViewController.h" +#import "Statistics.h" #import "SwiftBridge.h" #include "Framework.h" @@ -43,12 +44,28 @@ using namespace power_management; selectedCell.accessoryType = UITableViewCellAccessoryCheckmark; _selectedCell = selectedCell; + NSString * statisticValue = @""; + Scheme scheme = Scheme::None; if ([selectedCell isEqual:self.never]) - GetFramework().GetPowerManager().SetScheme(Scheme::Normal); + { + statisticValue = @"never"; + scheme = Scheme::Normal; + } else if ([selectedCell isEqual:self.manualMax]) - GetFramework().GetPowerManager().SetScheme(Scheme::EconomyMaximum); + { + statisticValue = @"max"; + scheme = Scheme::EconomyMaximum; + } else if ([selectedCell isEqual:self.automatic]) - GetFramework().GetPowerManager().SetScheme(Scheme::Auto); + { + statisticValue = @"auto"; + scheme = Scheme::Auto; + } + + CHECK_NOT_EQUAL(scheme, Scheme::None, ()); + + GetFramework().GetPowerManager().SetScheme(scheme); + [Statistics logEvent:kStatEnergySavingChange withParameters:@{kStatValue: statisticValue}]; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath |