Tom Cherry | 16fad42 | 2017-08-04 15:59:03 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 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 _INIT_PERSISTENT_PROPERTIES_H |
| 18 | #define _INIT_PERSISTENT_PROPERTIES_H |
| 19 | |
| 20 | #include <string> |
Tom Cherry | 16fad42 | 2017-08-04 15:59:03 -0700 | [diff] [blame] | 21 | |
| 22 | #include "result.h" |
Tom Cherry | a97faba | 2017-09-15 15:44:04 -0700 | [diff] [blame] | 23 | #include "system/core/init/persistent_properties.pb.h" |
Tom Cherry | 16fad42 | 2017-08-04 15:59:03 -0700 | [diff] [blame] | 24 | |
| 25 | namespace android { |
| 26 | namespace init { |
| 27 | |
Tom Cherry | a97faba | 2017-09-15 15:44:04 -0700 | [diff] [blame] | 28 | PersistentProperties LoadPersistentProperties(); |
Tom Cherry | 16fad42 | 2017-08-04 15:59:03 -0700 | [diff] [blame] | 29 | void WritePersistentProperty(const std::string& name, const std::string& value); |
Jiyong Park | c7230a1 | 2023-10-20 20:42:56 +0900 | [diff] [blame] | 30 | PersistentProperties LoadPersistentPropertiesFromMemory(); |
Tom Cherry | 16fad42 | 2017-08-04 15:59:03 -0700 | [diff] [blame] | 31 | |
| 32 | // Exposed only for testing |
Tom Cherry | a97faba | 2017-09-15 15:44:04 -0700 | [diff] [blame] | 33 | Result<PersistentProperties> LoadPersistentPropertyFile(); |
Tom Cherry | bbcbc2f | 2019-06-10 11:08:01 -0700 | [diff] [blame] | 34 | Result<void> WritePersistentPropertyFile(const PersistentProperties& persistent_properties); |
Tom Cherry | 16fad42 | 2017-08-04 15:59:03 -0700 | [diff] [blame] | 35 | extern std::string persistent_property_filename; |
| 36 | |
| 37 | } // namespace init |
| 38 | } // namespace android |
| 39 | |
| 40 | #endif |