1 /* 2 * Copyright (C) 2016 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 17 #ifndef _ERROR_CODE_H_ 18 #define _ERROR_CODE_H_ 19 20 enum ErrorCode : int { 21 kNoError = -1, 22 kLowBattery = 20, 23 kZipVerificationFailure, 24 kZipOpenFailure, 25 kBootreasonInBlacklist, 26 kPackageCompatibilityFailure, 27 kScriptExecutionFailure, 28 kMapFileFailure, 29 kForkUpdateBinaryFailure, 30 kUpdateBinaryCommandFailure, 31 }; 32 33 enum CauseCode : int { 34 kNoCause = -1, 35 kArgsParsingFailure = 100, 36 kStashCreationFailure, 37 kFileOpenFailure, 38 kLseekFailure, 39 kFreadFailure, 40 kFwriteFailure, 41 kFsyncFailure, 42 kLibfecFailure, 43 kFileGetPropFailure, 44 kFileRenameFailure, 45 kSymlinkFailure, 46 kSetMetadataFailure, 47 kTune2FsFailure, 48 kRebootFailure, 49 kPackageExtractFileFailure, 50 kPatchApplicationFailure, 51 kHashTreeComputationFailure, 52 kEioFailure, 53 kVendorFailure = 200 54 }; 55 56 enum UncryptErrorCode : int { 57 kUncryptNoError = -1, 58 kUncryptErrorPlaceholder = 50, 59 kUncryptTimeoutError = 100, 60 kUncryptFileRemoveError, 61 kUncryptFileOpenError, 62 kUncryptSocketOpenError, 63 kUncryptSocketWriteError, 64 kUncryptSocketListenError, 65 kUncryptSocketAcceptError, 66 kUncryptFstabReadError, 67 kUncryptFileStatError, 68 kUncryptBlockOpenError, 69 kUncryptIoctlError, 70 kUncryptReadError, 71 kUncryptWriteError, 72 kUncryptFileSyncError, 73 kUncryptFileCloseError, 74 kUncryptFileRenameError, 75 kUncryptPackageMissingError, 76 kUncryptRealpathFindError, 77 kUncryptBlockDeviceFindError, 78 }; 79 80 #endif // _ERROR_CODE_H_ 81