blob: 6215b1d9b3d8ab49b4490accb137820208d7b8af [file] [log] [blame]
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -08001/*
2 * Copyright (C) 2007 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
bigbiff26d5d5f2020-03-23 09:56:16 -040017<<<<<<< HEAD
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080018#ifndef RECOVERY_COMMON_H
19#define RECOVERY_COMMON_H
20
21#include <stdio.h>
Doug Zongker7c3ae452013-05-14 11:03:02 -070022#include <stdarg.h>
bigbiff26d5d5f2020-03-23 09:56:16 -040023=======
Tao Baobc982a42019-03-29 15:43:09 -070024#pragma once
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080025
bigbiff26d5d5f2020-03-23 09:56:16 -040026>>>>>>> android-10.0.0_r25
Tao Baoed4a5372017-03-07 13:32:30 -080027#include <string>
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080028
Doug Zongker28ce47c2011-10-28 10:33:05 -070029#ifdef __cplusplus
30extern "C" {
31#endif
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080032
Ethan Yonkerc798c9c2015-10-09 11:15:26 -050033#define LOGE(...) fprintf(stdout, "E:" __VA_ARGS__)
Doug Zongker3d177d02010-07-01 09:18:44 -070034#define LOGW(...) fprintf(stdout, "W:" __VA_ARGS__)
35#define LOGI(...) fprintf(stdout, "I:" __VA_ARGS__)
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080036
37#if 0
Doug Zongker3d177d02010-07-01 09:18:44 -070038#define LOGV(...) fprintf(stdout, "V:" __VA_ARGS__)
39#define LOGD(...) fprintf(stdout, "D:" __VA_ARGS__)
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080040#else
41#define LOGV(...) do {} while (0)
42#define LOGD(...) do {} while (0)
43#endif
44
Doug Zongkerfb2e3af2009-06-17 17:29:40 -070045#define STRINGIFY(x) #x
46#define EXPAND(x) STRINGIFY(x)
47
Tao Baobd0ddcd2017-05-04 13:03:18 -070048// Not using the command-line defined macro here because this header could be included by
49// device-specific recovery libraries. We static assert the value consistency in recovery.cpp.
Ethan Yonker58f21322018-08-24 11:17:36 -050050//static constexpr int kRecoveryApiVersion = 3;
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080051
Tao Baoac9d94d2016-11-03 11:37:15 -070052class RecoveryUI;
Jerry Zhang152933a2018-05-02 16:56:00 -070053struct selabel_handle;
Tao Baoac9d94d2016-11-03 11:37:15 -070054
Jerry Zhang152933a2018-05-02 16:56:00 -070055extern struct selabel_handle* sehandle;
Tao Baoac9d94d2016-11-03 11:37:15 -070056extern RecoveryUI* ui;
bigbiff26d5d5f2020-03-23 09:56:16 -040057<<<<<<< HEAD
Tao Bao682c34b2015-04-07 17:16:35 -070058extern bool modified_flash;
that4e0e3fc2015-04-13 19:52:49 +020059//typedef struct fstab_rec Volume;
bigbiff26d5d5f2020-03-23 09:56:16 -040060=======
Jerry Zhangf5e319a2018-05-04 11:24:10 -070061extern bool has_cache;
bigbiff26d5d5f2020-03-23 09:56:16 -040062>>>>>>> android-10.0.0_r25
Doug Zongkercc8cd3f2010-09-20 12:16:13 -070063
Tao Baoac9d94d2016-11-03 11:37:15 -070064// The current stage, e.g. "1/2".
Tao Baoa8d72bc2016-12-25 18:46:50 -080065extern std::string stage;
Tao Baoac9d94d2016-11-03 11:37:15 -070066
67// The reason argument provided in "--reason=".
68extern const char* reason;
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080069
bigbiff26d5d5f2020-03-23 09:56:16 -040070<<<<<<< HEAD
Doug Zongker469243e2011-04-12 09:28:10 -070071// fopen a file, mounting volumes and making parent dirs as necessary.
72FILE* fopen_path(const char *path, const char *mode);
73
Doug Zongker596b3422013-05-14 11:03:02 -070074void ui_print(const char* format, ...);
75
Ethan Yonker58f21322018-08-24 11:17:36 -050076//static bool is_ro_debuggable();
Doug Zongker7c3ae452013-05-14 11:03:02 -070077
Doug Zongker28ce47c2011-10-28 10:33:05 -070078#ifdef __cplusplus
79}
80#endif
81
Dmitri Plotnikoved9db0f2017-04-18 08:28:26 -070082bool reboot(const std::string& command);
83
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080084#endif // RECOVERY_COMMON_H
bigbiff26d5d5f2020-03-23 09:56:16 -040085=======
Elliott Hughesf14af802015-02-10 14:46:14 -080086bool is_ro_debuggable();
bigbiff26d5d5f2020-03-23 09:56:16 -040087>>>>>>> android-10.0.0_r25