2018-02-28 00:56:11 +01:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2018 The Android Open Source Project
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2018-04-26 03:59:40 +02:00
|
|
|
#include "otautil/paths.h"
|
2018-02-28 00:56:11 +01:00
|
|
|
|
2018-04-26 03:59:40 +02:00
|
|
|
constexpr const char kDefaultCacheLogDirectory[] = "/cache/recovery";
|
2018-02-28 00:56:11 +01:00
|
|
|
constexpr const char kDefaultCacheTempSource[] = "/cache/saved.file";
|
|
|
|
constexpr const char kDefaultLastCommandFile[] = "/cache/recovery/last_command";
|
2018-05-04 06:53:11 +02:00
|
|
|
constexpr const char kDefaultResourceDirectory[] = "/res/images";
|
2018-02-28 00:56:11 +01:00
|
|
|
constexpr const char kDefaultStashDirectoryBase[] = "/cache/recovery";
|
2018-04-26 03:59:40 +02:00
|
|
|
constexpr const char kDefaultTemporaryInstallFile[] = "/tmp/last_install";
|
|
|
|
constexpr const char kDefaultTemporaryLogFile[] = "/tmp/recovery.log";
|
2018-06-18 23:56:20 +02:00
|
|
|
constexpr const char kDefaultTemporaryUpdateBinary[] = "/tmp/update-binary";
|
2018-02-28 00:56:11 +01:00
|
|
|
|
2018-04-26 03:59:40 +02:00
|
|
|
Paths& Paths::Get() {
|
|
|
|
static Paths paths;
|
|
|
|
return paths;
|
2018-02-28 00:56:11 +01:00
|
|
|
}
|
|
|
|
|
2018-04-26 03:59:40 +02:00
|
|
|
Paths::Paths()
|
|
|
|
: cache_log_directory_(kDefaultCacheLogDirectory),
|
|
|
|
cache_temp_source_(kDefaultCacheTempSource),
|
2018-03-08 21:34:19 +01:00
|
|
|
last_command_file_(kDefaultLastCommandFile),
|
2018-05-04 06:53:11 +02:00
|
|
|
resource_dir_(kDefaultResourceDirectory),
|
2018-04-11 23:38:09 +02:00
|
|
|
stash_directory_base_(kDefaultStashDirectoryBase),
|
2018-04-26 03:59:40 +02:00
|
|
|
temporary_install_file_(kDefaultTemporaryInstallFile),
|
2018-06-18 23:56:20 +02:00
|
|
|
temporary_log_file_(kDefaultTemporaryLogFile),
|
|
|
|
temporary_update_binary_(kDefaultTemporaryUpdateBinary) {}
|