Merge "Don't include "error_code.h" in edify/expr.h."
am: d999ced1d1
Change-Id: I47512a7c6c02bcc5c6558f74963e83648e03f5d4
This commit is contained in:
+4
-5
@@ -31,6 +31,8 @@
|
|||||||
#include <android-base/stringprintf.h>
|
#include <android-base/stringprintf.h>
|
||||||
#include <android-base/strings.h>
|
#include <android-base/strings.h>
|
||||||
|
|
||||||
|
#include "error_code.h"
|
||||||
|
|
||||||
// Functions should:
|
// Functions should:
|
||||||
//
|
//
|
||||||
// - return a malloc()'d string
|
// - return a malloc()'d string
|
||||||
@@ -416,8 +418,5 @@ Value* ErrorAbort(State* state, CauseCode cause_code, const char* format, ...) {
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
State::State(const std::string& script, void* cookie) :
|
State::State(const std::string& script, void* cookie)
|
||||||
script(script),
|
: script(script), cookie(cookie), error_code(kNoError), cause_code(kNoCause) {}
|
||||||
cookie(cookie) {
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
+20
-18
@@ -23,32 +23,34 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "error_code.h"
|
// Forward declaration to avoid including "error_code.h".
|
||||||
|
enum ErrorCode : int;
|
||||||
|
enum CauseCode : int;
|
||||||
|
|
||||||
struct State {
|
struct State {
|
||||||
State(const std::string& script, void* cookie);
|
State(const std::string& script, void* cookie);
|
||||||
|
|
||||||
// The source of the original script.
|
// The source of the original script.
|
||||||
const std::string& script;
|
const std::string& script;
|
||||||
|
|
||||||
// Optional pointer to app-specific data; the core of edify never
|
// Optional pointer to app-specific data; the core of edify never
|
||||||
// uses this value.
|
// uses this value.
|
||||||
void* cookie;
|
void* cookie;
|
||||||
|
|
||||||
// The error message (if any) returned if the evaluation aborts.
|
// The error message (if any) returned if the evaluation aborts.
|
||||||
// Should be empty initially, will be either empty or a string that
|
// Should be empty initially, will be either empty or a string that
|
||||||
// Evaluate() returns.
|
// Evaluate() returns.
|
||||||
std::string errmsg;
|
std::string errmsg;
|
||||||
|
|
||||||
// error code indicates the type of failure (e.g. failure to update system image)
|
// error code indicates the type of failure (e.g. failure to update system image)
|
||||||
// during the OTA process.
|
// during the OTA process.
|
||||||
ErrorCode error_code = kNoError;
|
ErrorCode error_code;
|
||||||
|
|
||||||
// cause code provides more detailed reason of an OTA failure (e.g. fsync error)
|
// cause code provides more detailed reason of an OTA failure (e.g. fsync error)
|
||||||
// in addition to the error code.
|
// in addition to the error code.
|
||||||
CauseCode cause_code = kNoCause;
|
CauseCode cause_code;
|
||||||
|
|
||||||
bool is_retry = false;
|
bool is_retry = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ValueType {
|
enum ValueType {
|
||||||
|
|||||||
+3
-3
@@ -17,7 +17,7 @@
|
|||||||
#ifndef _ERROR_CODE_H_
|
#ifndef _ERROR_CODE_H_
|
||||||
#define _ERROR_CODE_H_
|
#define _ERROR_CODE_H_
|
||||||
|
|
||||||
enum ErrorCode {
|
enum ErrorCode : int {
|
||||||
kNoError = -1,
|
kNoError = -1,
|
||||||
kLowBattery = 20,
|
kLowBattery = 20,
|
||||||
kZipVerificationFailure,
|
kZipVerificationFailure,
|
||||||
@@ -30,7 +30,7 @@ enum ErrorCode {
|
|||||||
kUpdateBinaryCommandFailure,
|
kUpdateBinaryCommandFailure,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum CauseCode {
|
enum CauseCode : int {
|
||||||
kNoCause = -1,
|
kNoCause = -1,
|
||||||
kArgsParsingFailure = 100,
|
kArgsParsingFailure = 100,
|
||||||
kStashCreationFailure,
|
kStashCreationFailure,
|
||||||
@@ -51,7 +51,7 @@ enum CauseCode {
|
|||||||
kVendorFailure = 200
|
kVendorFailure = 200
|
||||||
};
|
};
|
||||||
|
|
||||||
enum UncryptErrorCode {
|
enum UncryptErrorCode : int {
|
||||||
kUncryptNoError = -1,
|
kUncryptNoError = -1,
|
||||||
kUncryptErrorPlaceholder = 50,
|
kUncryptErrorPlaceholder = 50,
|
||||||
kUncryptTimeoutError = 100,
|
kUncryptTimeoutError = 100,
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
#include <ziparchive/zip_archive.h>
|
#include <ziparchive/zip_archive.h>
|
||||||
|
|
||||||
#include "edify/expr.h"
|
#include "edify/expr.h"
|
||||||
|
#include "error_code.h"
|
||||||
#include "otafault/config.h"
|
#include "otafault/config.h"
|
||||||
#include "otautil/DirUtil.h"
|
#include "otautil/DirUtil.h"
|
||||||
#include "otautil/SysUtil.h"
|
#include "otautil/SysUtil.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user