blob: f08e51c7a198fc12b151f02b2617b8d3a5aae2cb [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";
Tao Bao6cd81682018-05-03 21:53:11 -070022constexpr const char kDefaultResourceDirectory[] = "/res/images";
Tianjie Xu3bbb20f2018-02-27 15:56:11 -080023constexpr const char kDefaultStashDirectoryBase[] = "/cache/recovery";
Tao Bao641fa972018-04-25 18:59:40 -070024constexpr const char kDefaultTemporaryInstallFile[] = "/tmp/last_install";
25constexpr const char kDefaultTemporaryLogFile[] = "/tmp/recovery.log";
Tianjie Xu3bbb20f2018-02-27 15:56:11 -080026
Tao Bao641fa972018-04-25 18:59:40 -070027Paths& Paths::Get() {
28 static Paths paths;
29 return paths;
Tianjie Xu3bbb20f2018-02-27 15:56:11 -080030}
31
Tao Bao641fa972018-04-25 18:59:40 -070032Paths::Paths()
33 : cache_log_directory_(kDefaultCacheLogDirectory),
34 cache_temp_source_(kDefaultCacheTempSource),
Tianjie Xub4e3a372018-03-08 12:34:19 -080035 last_command_file_(kDefaultLastCommandFile),
Tao Bao6cd81682018-05-03 21:53:11 -070036 resource_dir_(kDefaultResourceDirectory),
Tianjie Xud5fbcc12018-04-11 14:38:09 -070037 stash_directory_base_(kDefaultStashDirectoryBase),
Tao Bao641fa972018-04-25 18:59:40 -070038 temporary_install_file_(kDefaultTemporaryInstallFile),
39 temporary_log_file_(kDefaultTemporaryLogFile) {}