1 /* 2 * Copyright (C) 2018 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef DEVICE_GOOGLE_WAHOO_HEALTH_LEARNEDCAPACITYBACKUPRESTORE_H 18 #define DEVICE_GOOGLE_WAHOO_HEALTH_LEARNEDCAPACITYBACKUPRESTORE_H 19 20 #include <android-base/file.h> 21 #include <android-base/logging.h> 22 #include <android-base/strings.h> 23 #include <string> 24 25 namespace device { 26 namespace google { 27 namespace wahoo { 28 namespace health { 29 30 class LearnedCapacityBackupRestore { 31 public: 32 LearnedCapacityBackupRestore(); 33 void Restore(); 34 void Backup(); 35 36 private: 37 int sw_cap_; 38 int hw_cap_; 39 40 void ReadFromStorage(); 41 void SaveToStorage(); 42 void ReadFromSRAM(); 43 void SaveToSRAM(); 44 }; 45 46 } // namespace health 47 } // namespace wahoo 48 } // namespace google 49 } // namespace device 50 51 #endif // #ifndef DEVICE_GOOGLE_WAHOO_HEALTH_LEARNEDCAPACITYBACKUPRESTORE_H 52