blob: 33ab4a5d4701c4db83b974a7a368234882af9cde [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";
Tao Baocf60a442018-06-18 14:56:20 -070026constexpr const char kDefaultTemporaryUpdateBinary[] = "/tmp/update-binary";
Tianjie Xu3bbb20f2018-02-27 15:56:11 -080027
Tao Bao641fa972018-04-25 18:59:40 -070028Paths& Paths::Get() {
29 static Paths paths;
30 return paths;
Tianjie Xu3bbb20f2018-02-27 15:56:11 -080031}
32
Tao Bao641fa972018-04-25 18:59:40 -070033Paths::Paths()
34 : cache_log_directory_(kDefaultCacheLogDirectory),
35 cache_temp_source_(kDefaultCacheTempSource),
Tianjie Xub4e3a372018-03-08 12:34:19 -080036 last_command_file_(kDefaultLastCommandFile),
Tao Bao6cd81682018-05-03 21:53:11 -070037 resource_dir_(kDefaultResourceDirectory),
Tianjie Xud5fbcc12018-04-11 14:38:09 -070038 stash_directory_base_(kDefaultStashDirectoryBase),
Tao Bao641fa972018-04-25 18:59:40 -070039 temporary_install_file_(kDefaultTemporaryInstallFile),
Tao Baocf60a442018-06-18 14:56:20 -070040 temporary_log_file_(kDefaultTemporaryLogFile),
41 temporary_update_binary_(kDefaultTemporaryUpdateBinary) {}