updater: Fix the wrong return value for package_extract_file().
'bool success = ExtractEntryToFile()' gives opposite result. Fix the
issue and add testcases.
Change the one-argument version of package_extract_file() to explicitly
abort for non-existent zip entry. Note that this is NOT changing the
behavior. Prior to this CL, it aborts from Evaluate() function, by
giving a general cause code. Now it returns kPackageExtractFileFailure.
BUg: 32903624
Test: recovery_component_test works.
Change-Id: I7a273e9c0d9aaaf8c472b2c778f7b8d90362c24f
(cherry picked from commit ef0eb3b01b)
This commit is contained in:
+42
-41
@@ -18,52 +18,53 @@
|
||||
#define _ERROR_CODE_H_
|
||||
|
||||
enum ErrorCode {
|
||||
kNoError = -1,
|
||||
kLowBattery = 20,
|
||||
kZipVerificationFailure,
|
||||
kZipOpenFailure,
|
||||
kBootreasonInBlacklist
|
||||
kNoError = -1,
|
||||
kLowBattery = 20,
|
||||
kZipVerificationFailure,
|
||||
kZipOpenFailure,
|
||||
kBootreasonInBlacklist
|
||||
};
|
||||
|
||||
enum CauseCode {
|
||||
kNoCause = -1,
|
||||
kArgsParsingFailure = 100,
|
||||
kStashCreationFailure,
|
||||
kFileOpenFailure,
|
||||
kLseekFailure,
|
||||
kFreadFailure,
|
||||
kFwriteFailure,
|
||||
kFsyncFailure,
|
||||
kLibfecFailure,
|
||||
kFileGetPropFailure,
|
||||
kFileRenameFailure,
|
||||
kSymlinkFailure,
|
||||
kSetMetadataFailure,
|
||||
kTune2FsFailure,
|
||||
kRebootFailure,
|
||||
kVendorFailure = 200
|
||||
kNoCause = -1,
|
||||
kArgsParsingFailure = 100,
|
||||
kStashCreationFailure,
|
||||
kFileOpenFailure,
|
||||
kLseekFailure,
|
||||
kFreadFailure,
|
||||
kFwriteFailure,
|
||||
kFsyncFailure,
|
||||
kLibfecFailure,
|
||||
kFileGetPropFailure,
|
||||
kFileRenameFailure,
|
||||
kSymlinkFailure,
|
||||
kSetMetadataFailure,
|
||||
kTune2FsFailure,
|
||||
kRebootFailure,
|
||||
kPackageExtractFileFailure,
|
||||
kVendorFailure = 200
|
||||
};
|
||||
|
||||
enum UncryptErrorCode {
|
||||
kUncryptNoError = -1,
|
||||
kUncryptErrorPlaceholder = 50,
|
||||
kUncryptTimeoutError = 100,
|
||||
kUncryptFileRemoveError,
|
||||
kUncryptFileOpenError,
|
||||
kUncryptSocketOpenError,
|
||||
kUncryptSocketWriteError,
|
||||
kUncryptSocketListenError,
|
||||
kUncryptSocketAcceptError,
|
||||
kUncryptFstabReadError,
|
||||
kUncryptFileStatError,
|
||||
kUncryptBlockOpenError,
|
||||
kUncryptIoctlError,
|
||||
kUncryptReadError,
|
||||
kUncryptWriteError,
|
||||
kUncryptFileSyncError,
|
||||
kUncryptFileCloseError,
|
||||
kUncryptFileRenameError,
|
||||
kUncryptPackageMissingError,
|
||||
kUncryptNoError = -1,
|
||||
kUncryptErrorPlaceholder = 50,
|
||||
kUncryptTimeoutError = 100,
|
||||
kUncryptFileRemoveError,
|
||||
kUncryptFileOpenError,
|
||||
kUncryptSocketOpenError,
|
||||
kUncryptSocketWriteError,
|
||||
kUncryptSocketListenError,
|
||||
kUncryptSocketAcceptError,
|
||||
kUncryptFstabReadError,
|
||||
kUncryptFileStatError,
|
||||
kUncryptBlockOpenError,
|
||||
kUncryptIoctlError,
|
||||
kUncryptReadError,
|
||||
kUncryptWriteError,
|
||||
kUncryptFileSyncError,
|
||||
kUncryptFileCloseError,
|
||||
kUncryptFileRenameError,
|
||||
kUncryptPackageMissingError,
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif // _ERROR_CODE_H_
|
||||
|
||||
Reference in New Issue
Block a user