Tianjie Xu | 1625583 | 2016-04-30 11:49:59 -0700 | [diff] [blame] | 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 { |
Tao Bao | 2274e57 | 2016-11-14 21:29:52 -0800 | [diff] [blame] | 21 | kNoError = -1, |
| 22 | kLowBattery = 20, |
| 23 | kZipVerificationFailure, |
| 24 | kZipOpenFailure, |
Tao Bao | 1d86605 | 2017-04-10 16:55:57 -0700 | [diff] [blame] | 25 | kBootreasonInBlacklist, |
| 26 | kPackageCompatibilityFailure, |
Tianjie Xu | e0c8879 | 2017-05-02 16:07:18 -0700 | [diff] [blame] | 27 | kScriptExecutionFailure, |
Tianjie Xu | 1625583 | 2016-04-30 11:49:59 -0700 | [diff] [blame] | 28 | }; |
| 29 | |
| 30 | enum CauseCode { |
Tao Bao | 2274e57 | 2016-11-14 21:29:52 -0800 | [diff] [blame] | 31 | kNoCause = -1, |
| 32 | kArgsParsingFailure = 100, |
| 33 | kStashCreationFailure, |
| 34 | kFileOpenFailure, |
| 35 | kLseekFailure, |
| 36 | kFreadFailure, |
| 37 | kFwriteFailure, |
| 38 | kFsyncFailure, |
| 39 | kLibfecFailure, |
| 40 | kFileGetPropFailure, |
| 41 | kFileRenameFailure, |
| 42 | kSymlinkFailure, |
| 43 | kSetMetadataFailure, |
| 44 | kTune2FsFailure, |
| 45 | kRebootFailure, |
| 46 | kPackageExtractFileFailure, |
Tianjie Xu | 6957555 | 2017-05-16 15:51:46 -0700 | [diff] [blame] | 47 | kPatchApplicationFailure, |
Tao Bao | 2274e57 | 2016-11-14 21:29:52 -0800 | [diff] [blame] | 48 | kVendorFailure = 200 |
Tianjie Xu | 1625583 | 2016-04-30 11:49:59 -0700 | [diff] [blame] | 49 | }; |
| 50 | |
Tianjie Xu | da44cf1 | 2016-09-24 15:31:34 -0700 | [diff] [blame] | 51 | enum UncryptErrorCode { |
Tao Bao | 2274e57 | 2016-11-14 21:29:52 -0800 | [diff] [blame] | 52 | kUncryptNoError = -1, |
| 53 | kUncryptErrorPlaceholder = 50, |
| 54 | kUncryptTimeoutError = 100, |
| 55 | kUncryptFileRemoveError, |
| 56 | kUncryptFileOpenError, |
| 57 | kUncryptSocketOpenError, |
| 58 | kUncryptSocketWriteError, |
| 59 | kUncryptSocketListenError, |
| 60 | kUncryptSocketAcceptError, |
| 61 | kUncryptFstabReadError, |
| 62 | kUncryptFileStatError, |
| 63 | kUncryptBlockOpenError, |
| 64 | kUncryptIoctlError, |
| 65 | kUncryptReadError, |
| 66 | kUncryptWriteError, |
| 67 | kUncryptFileSyncError, |
| 68 | kUncryptFileCloseError, |
| 69 | kUncryptFileRenameError, |
| 70 | kUncryptPackageMissingError, |
Tianjie Xu | da44cf1 | 2016-09-24 15:31:34 -0700 | [diff] [blame] | 71 | }; |
| 72 | |
Tao Bao | 2274e57 | 2016-11-14 21:29:52 -0800 | [diff] [blame] | 73 | #endif // _ERROR_CODE_H_ |