blob: ad9ec114584c08732e53c6103b6b033143c27aad [file] [log] [blame]
Tianjie Xu3bbb20f2018-02-27 15:56:11 -08001/*
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
Tao Bao641fa972018-04-25 18:59:40 -070017#include "otautil/paths.h"
Tianjie Xu3bbb20f2018-02-27 15:56:11 -080018
Tao Bao641fa972018-04-25 18:59:40 -070019constexpr const char kDefaultCacheLogDirectory[] = "/cache/recovery";
Tianjie Xu3bbb20f2018-02-27 15:56:11 -080020constexpr const char kDefaultCacheTempSource[] = "/cache/saved.file";
21constexpr const char kDefaultLastCommandFile[] = "/cache/recovery/last_command";
22constexpr const char kDefaultStashDirectoryBase[] = "/cache/recovery";
Tao Bao641fa972018-04-25 18:59:40 -070023constexpr const char kDefaultTemporaryInstallFile[] = "/tmp/last_install";
24constexpr const char kDefaultTemporaryLogFile[] = "/tmp/recovery.log";
Tianjie Xu3bbb20f2018-02-27 15:56:11 -080025
Tao Bao641fa972018-04-25 18:59:40 -070026Paths& Paths::Get() {
27 static Paths paths;
28 return paths;
Tianjie Xu3bbb20f2018-02-27 15:56:11 -080029}
30
Tao Bao641fa972018-04-25 18:59:40 -070031Paths::Paths()
32 : cache_log_directory_(kDefaultCacheLogDirectory),
33 cache_temp_source_(kDefaultCacheTempSource),
Tianjie Xub4e3a372018-03-08 12:34:19 -080034 last_command_file_(kDefaultLastCommandFile),
Tianjie Xud5fbcc12018-04-11 14:38:09 -070035 stash_directory_base_(kDefaultStashDirectoryBase),
Tao Bao641fa972018-04-25 18:59:40 -070036 temporary_install_file_(kDefaultTemporaryInstallFile),
37 temporary_log_file_(kDefaultTemporaryLogFile) {}