Alex Deymo | aea4c1c | 2015-08-19 20:24:43 -0700 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2013 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 | // |
Jay Srinivasan | 1c0fe79 | 2013-03-28 16:45:25 -0700 | [diff] [blame] | 16 | |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 17 | #ifndef UPDATE_ENGINE_COMMON_CONSTANTS_H_ |
| 18 | #define UPDATE_ENGINE_COMMON_CONSTANTS_H_ |
Jay Srinivasan | 1c0fe79 | 2013-03-28 16:45:25 -0700 | [diff] [blame] | 19 | |
Kelvin Zhang | ec205cf | 2020-09-28 13:23:40 -0400 | [diff] [blame] | 20 | #include <cstdint> |
| 21 | |
Jay Srinivasan | 1c0fe79 | 2013-03-28 16:45:25 -0700 | [diff] [blame] | 22 | namespace chromeos_update_engine { |
| 23 | |
Jae Hoon Kim | 38de3b1 | 2020-04-29 19:41:23 -0700 | [diff] [blame] | 24 | // The root path of all exclusion prefs. |
| 25 | extern const char kExclusionPrefsSubDir[]; |
| 26 | |
Andrew | 065d78d | 2020-04-07 15:43:07 -0700 | [diff] [blame] | 27 | // The root path of all DLC metadata. |
| 28 | extern const char kDlcPrefsSubDir[]; |
Andrew | e045aef | 2020-01-08 16:29:22 -0800 | [diff] [blame] | 29 | |
Chris Sosa | aa18e16 | 2013-06-20 13:20:30 -0700 | [diff] [blame] | 30 | // Directory for AU prefs that are preserved across powerwash. |
Alex Deymo | dd132f3 | 2015-09-14 19:12:07 -0700 | [diff] [blame] | 31 | extern const char kPowerwashSafePrefsSubDirectory[]; |
Chris Sosa | aa18e16 | 2013-06-20 13:20:30 -0700 | [diff] [blame] | 32 | |
| 33 | // The location where we store the AU preferences (state etc). |
Alex Deymo | dd132f3 | 2015-09-14 19:12:07 -0700 | [diff] [blame] | 34 | extern const char kPrefsSubDirectory[]; |
Chris Sosa | aa18e16 | 2013-06-20 13:20:30 -0700 | [diff] [blame] | 35 | |
Alex Deymo | 390efed | 2016-02-18 11:00:40 -0800 | [diff] [blame] | 36 | // Path to the post install command, relative to the partition. |
| 37 | extern const char kPostinstallDefaultScript[]; |
| 38 | |
Chris Sosa | be45bef | 2013-04-09 18:25:12 -0700 | [diff] [blame] | 39 | // Path to the stateful partition on the root filesystem. |
| 40 | extern const char kStatefulPartition[]; |
| 41 | |
Jay Srinivasan | d29695d | 2013-04-08 15:08:05 -0700 | [diff] [blame] | 42 | // Constants related to preferences. |
David Zeuthen | 4e1d149 | 2014-04-25 13:12:27 -0700 | [diff] [blame] | 43 | extern const char kPrefsAttemptInProgress[]; |
Jay Srinivasan | d29695d | 2013-04-08 15:08:05 -0700 | [diff] [blame] | 44 | extern const char kPrefsBackoffExpiryTime[]; |
Alex Deymo | dd132f3 | 2015-09-14 19:12:07 -0700 | [diff] [blame] | 45 | extern const char kPrefsBootId[]; |
Jay Srinivasan | 19409b7 | 2013-04-12 19:23:36 -0700 | [diff] [blame] | 46 | extern const char kPrefsCurrentBytesDownloaded[]; |
Jay Srinivasan | d29695d | 2013-04-08 15:08:05 -0700 | [diff] [blame] | 47 | extern const char kPrefsCurrentResponseSignature[]; |
| 48 | extern const char kPrefsCurrentUrlFailureCount[]; |
| 49 | extern const char kPrefsCurrentUrlIndex[]; |
David Zeuthen | 985b112 | 2013-10-09 12:13:15 -0700 | [diff] [blame] | 50 | extern const char kPrefsDailyMetricsLastReportedAt[]; |
Jay Srinivasan | d29695d | 2013-04-08 15:08:05 -0700 | [diff] [blame] | 51 | extern const char kPrefsDeltaUpdateFailures[]; |
Tao Bao | 3406c77 | 2019-01-02 15:34:35 -0800 | [diff] [blame] | 52 | extern const char kPrefsDynamicPartitionMetadataUpdated[]; |
Alex Deymo | 820cc70 | 2013-06-28 15:43:46 -0700 | [diff] [blame] | 53 | extern const char kPrefsFullPayloadAttemptNumber[]; |
David Zeuthen | 639aa36 | 2014-02-03 16:23:44 -0800 | [diff] [blame] | 54 | extern const char kPrefsInstallDateDays[]; |
Jay Srinivasan | d29695d | 2013-04-08 15:08:05 -0700 | [diff] [blame] | 55 | extern const char kPrefsLastActivePingDay[]; |
| 56 | extern const char kPrefsLastRollCallPingDay[]; |
| 57 | extern const char kPrefsManifestMetadataSize[]; |
Alex Deymo | f25eb49 | 2016-02-26 00:20:08 -0800 | [diff] [blame] | 58 | extern const char kPrefsManifestSignatureSize[]; |
David Zeuthen | 33bae49 | 2014-02-25 16:16:18 -0800 | [diff] [blame] | 59 | extern const char kPrefsMetricsAttemptLastReportingTime[]; |
| 60 | extern const char kPrefsMetricsCheckLastReportingTime[]; |
Amin Hassani | ffb6d80 | 2018-03-30 11:43:57 -0700 | [diff] [blame] | 61 | extern const char kPrefsNoIgnoreBackoff[]; |
Chris Sosa | be45bef | 2013-04-09 18:25:12 -0700 | [diff] [blame] | 62 | extern const char kPrefsNumReboots[]; |
David Zeuthen | a573d6f | 2013-06-14 16:13:36 -0700 | [diff] [blame] | 63 | extern const char kPrefsNumResponsesSeen[]; |
Alex Deymo | 8e18f93 | 2015-03-27 16:16:59 -0700 | [diff] [blame] | 64 | extern const char kPrefsOmahaCohort[]; |
| 65 | extern const char kPrefsOmahaCohortHint[]; |
| 66 | extern const char kPrefsOmahaCohortName[]; |
Jae Hoon Kim | 051627a | 2019-09-03 12:56:32 -0700 | [diff] [blame] | 67 | extern const char kPrefsOmahaEolDate[]; |
David Zeuthen | 27a48bc | 2013-08-06 12:06:29 -0700 | [diff] [blame] | 68 | extern const char kPrefsP2PEnabled[]; |
David Zeuthen | 639aa36 | 2014-02-03 16:23:44 -0800 | [diff] [blame] | 69 | extern const char kPrefsP2PFirstAttemptTimestamp[]; |
| 70 | extern const char kPrefsP2PNumAttempts[]; |
Jay Srinivasan | d29695d | 2013-04-08 15:08:05 -0700 | [diff] [blame] | 71 | extern const char kPrefsPayloadAttemptNumber[]; |
Amin Hassani | 03277de | 2020-07-28 12:32:49 -0700 | [diff] [blame] | 72 | extern const char kPrefsTestUpdateCheckIntervalTimeout[]; |
Andrew | e045aef | 2020-01-08 16:29:22 -0800 | [diff] [blame] | 73 | extern const char kPrefsPingActive[]; |
| 74 | extern const char kPrefsPingLastActive[]; |
| 75 | extern const char kPrefsPingLastRollcall[]; |
Vyshu Khota | 4c5413d | 2020-11-04 16:17:25 -0800 | [diff] [blame] | 76 | extern const char kPrefsLastFp[]; |
Sen Jiang | 02c4942 | 2017-10-31 15:14:11 -0700 | [diff] [blame] | 77 | extern const char kPrefsPostInstallSucceeded[]; |
Jay Srinivasan | d29695d | 2013-04-08 15:08:05 -0700 | [diff] [blame] | 78 | extern const char kPrefsPreviousVersion[]; |
Kelvin Zhang | 8660347 | 2021-05-11 12:16:27 -0400 | [diff] [blame] | 79 | extern const char kPrefsPreviousSlot[]; |
Jay Srinivasan | d29695d | 2013-04-08 15:08:05 -0700 | [diff] [blame] | 80 | extern const char kPrefsResumedUpdateFailures[]; |
Marton Hunyady | e58bddb | 2018-04-10 20:27:26 +0200 | [diff] [blame] | 81 | extern const char kPrefsRollbackHappened[]; |
Chris Sosa | aa18e16 | 2013-06-20 13:20:30 -0700 | [diff] [blame] | 82 | extern const char kPrefsRollbackVersion[]; |
Alex Deymo | 8561665 | 2015-10-15 18:48:31 -0700 | [diff] [blame] | 83 | extern const char kPrefsChannelOnSlotPrefix[]; |
David Zeuthen | e4c58bf | 2013-06-18 17:26:50 -0700 | [diff] [blame] | 84 | extern const char kPrefsSystemUpdatedMarker[]; |
Alex Deymo | 4243291 | 2013-07-12 20:21:15 -0700 | [diff] [blame] | 85 | extern const char kPrefsTargetVersionAttempt[]; |
| 86 | extern const char kPrefsTargetVersionInstalledFrom[]; |
| 87 | extern const char kPrefsTargetVersionUniqueId[]; |
Jay Srinivasan | 19409b7 | 2013-04-12 19:23:36 -0700 | [diff] [blame] | 88 | extern const char kPrefsTotalBytesDownloaded[]; |
Jay Srinivasan | d29695d | 2013-04-08 15:08:05 -0700 | [diff] [blame] | 89 | extern const char kPrefsUpdateCheckCount[]; |
| 90 | extern const char kPrefsUpdateCheckResponseHash[]; |
Alex Deymo | 906191f | 2015-10-12 12:22:44 -0700 | [diff] [blame] | 91 | extern const char kPrefsUpdateCompletedBootTime[]; |
| 92 | extern const char kPrefsUpdateCompletedOnBootId[]; |
David Zeuthen | cc6f996 | 2013-04-18 11:57:24 -0700 | [diff] [blame] | 93 | extern const char kPrefsUpdateDurationUptime[]; |
Jay Srinivasan | d29695d | 2013-04-08 15:08:05 -0700 | [diff] [blame] | 94 | extern const char kPrefsUpdateFirstSeenAt[]; |
Alex Deymo | f4867c4 | 2013-06-28 14:41:39 -0700 | [diff] [blame] | 95 | extern const char kPrefsUpdateOverCellularPermission[]; |
Weidong Guo | 421ff33 | 2017-04-17 10:08:38 -0700 | [diff] [blame] | 96 | extern const char kPrefsUpdateOverCellularTargetVersion[]; |
| 97 | extern const char kPrefsUpdateOverCellularTargetSize[]; |
Jay Srinivasan | d29695d | 2013-04-08 15:08:05 -0700 | [diff] [blame] | 98 | extern const char kPrefsUpdateServerCertificate[]; |
David Zeuthen | 41996ad | 2013-09-24 15:43:24 -0700 | [diff] [blame] | 99 | extern const char kPrefsUpdateStateNextDataLength[]; |
David Zeuthen | 639aa36 | 2014-02-03 16:23:44 -0800 | [diff] [blame] | 100 | extern const char kPrefsUpdateStateNextDataOffset[]; |
Jay Srinivasan | d29695d | 2013-04-08 15:08:05 -0700 | [diff] [blame] | 101 | extern const char kPrefsUpdateStateNextOperation[]; |
Sen Jiang | 0affc2c | 2017-02-10 15:55:05 -0800 | [diff] [blame] | 102 | extern const char kPrefsUpdateStatePayloadIndex[]; |
Jay Srinivasan | d29695d | 2013-04-08 15:08:05 -0700 | [diff] [blame] | 103 | extern const char kPrefsUpdateStateSHA256Context[]; |
| 104 | extern const char kPrefsUpdateStateSignatureBlob[]; |
| 105 | extern const char kPrefsUpdateStateSignedSHA256Context[]; |
Tianjie Xu | 2a0ea63 | 2018-08-06 12:59:23 -0700 | [diff] [blame] | 106 | extern const char kPrefsUpdateBootTimestampStart[]; |
David Zeuthen | 9a017f2 | 2013-04-11 16:10:26 -0700 | [diff] [blame] | 107 | extern const char kPrefsUpdateTimestampStart[]; |
David Zeuthen | cc6f996 | 2013-04-18 11:57:24 -0700 | [diff] [blame] | 108 | extern const char kPrefsUrlSwitchCount[]; |
Sen Jiang | 3eeaf7d | 2018-10-11 13:55:32 -0700 | [diff] [blame] | 109 | extern const char kPrefsVerityWritten[]; |
Adolfo Victoria | d3a1e35 | 2018-07-16 11:40:47 -0700 | [diff] [blame] | 110 | extern const char kPrefsWallClockScatteringWaitPeriod[]; |
| 111 | extern const char kPrefsWallClockStagingWaitPeriod[]; |
Kelvin Zhang | cc011d3 | 2020-07-10 18:20:08 -0400 | [diff] [blame] | 112 | extern const char kPrefsManifestBytes[]; |
Jay Srinivasan | d29695d | 2013-04-08 15:08:05 -0700 | [diff] [blame] | 113 | |
Alex Deymo | 98e691c | 2016-02-04 21:05:45 -0800 | [diff] [blame] | 114 | // Keys used when storing and loading payload properties. |
| 115 | extern const char kPayloadPropertyFileSize[]; |
| 116 | extern const char kPayloadPropertyFileHash[]; |
| 117 | extern const char kPayloadPropertyMetadataSize[]; |
| 118 | extern const char kPayloadPropertyMetadataHash[]; |
Alex Deymo | fdd6dec | 2016-03-03 22:35:43 -0800 | [diff] [blame] | 119 | extern const char kPayloadPropertyAuthorization[]; |
| 120 | extern const char kPayloadPropertyUserAgent[]; |
Alex Deymo | fb905d9 | 2016-06-03 19:26:58 -0700 | [diff] [blame] | 121 | extern const char kPayloadPropertyPowerwash[]; |
Alex Deymo | 87792ea | 2016-07-25 15:40:36 -0700 | [diff] [blame] | 122 | extern const char kPayloadPropertyNetworkId[]; |
Sen Jiang | 02c4942 | 2017-10-31 15:14:11 -0700 | [diff] [blame] | 123 | extern const char kPayloadPropertySwitchSlotOnReboot[]; |
| 124 | extern const char kPayloadPropertyRunPostInstall[]; |
Alex Deymo | 98e691c | 2016-02-04 21:05:45 -0800 | [diff] [blame] | 125 | |
Amin Hassani | 7fca286 | 2019-03-28 16:09:22 -0700 | [diff] [blame] | 126 | extern const char kOmahaUpdaterVersion[]; |
| 127 | |
Jae Hoon Kim | 0ae8fe1 | 2019-06-26 14:32:50 -0700 | [diff] [blame] | 128 | // X-Goog-Update headers. |
| 129 | extern const char kXGoogleUpdateInteractivity[]; |
| 130 | extern const char kXGoogleUpdateAppId[]; |
| 131 | extern const char kXGoogleUpdateUpdater[]; |
| 132 | extern const char kXGoogleUpdateSessionId[]; |
| 133 | |
Jay Srinivasan | 19409b7 | 2013-04-12 19:23:36 -0700 | [diff] [blame] | 134 | // A download source is any combination of protocol and server (that's of |
| 135 | // interest to us when looking at UMA metrics) using which we may download |
| 136 | // the payload. |
| 137 | typedef enum { |
Alex Vakulenko | d2779df | 2014-06-16 13:19:00 -0700 | [diff] [blame] | 138 | kDownloadSourceHttpsServer, // UMA Binary representation: 0001 |
| 139 | kDownloadSourceHttpServer, // UMA Binary representation: 0010 |
| 140 | kDownloadSourceHttpPeer, // UMA Binary representation: 0100 |
Jay Srinivasan | 19409b7 | 2013-04-12 19:23:36 -0700 | [diff] [blame] | 141 | |
| 142 | // Note: Add new sources only above this line. |
| 143 | kNumDownloadSources |
| 144 | } DownloadSource; |
| 145 | |
Alex Deymo | 1c656c4 | 2013-06-28 11:02:14 -0700 | [diff] [blame] | 146 | // A payload can be a Full or Delta payload. In some cases, a Full payload is |
| 147 | // used even when a Delta payload was available for the update, called here |
| 148 | // ForcedFull. The PayloadType enum is only used to send UMA metrics about the |
| 149 | // successfully applied payload. |
| 150 | typedef enum { |
| 151 | kPayloadTypeFull, |
| 152 | kPayloadTypeDelta, |
| 153 | kPayloadTypeForcedFull, |
| 154 | |
| 155 | // Note: Add new payload types only above this line. |
| 156 | kNumPayloadTypes |
| 157 | } PayloadType; |
| 158 | |
David Zeuthen | 8f191b2 | 2013-08-06 12:27:50 -0700 | [diff] [blame] | 159 | // Maximum number of times we'll allow using p2p for the same update payload. |
Kelvin Zhang | ec205cf | 2020-09-28 13:23:40 -0400 | [diff] [blame] | 160 | constexpr int kMaxP2PAttempts = 10; |
David Zeuthen | dcba809 | 2013-08-06 12:16:35 -0700 | [diff] [blame] | 161 | |
David Zeuthen | 8f191b2 | 2013-08-06 12:27:50 -0700 | [diff] [blame] | 162 | // Maximum wallclock time we allow attempting to update using p2p for |
David Zeuthen | 472b205 | 2014-02-25 16:27:04 -0800 | [diff] [blame] | 163 | // the same update payload - five days. |
Kelvin Zhang | ec205cf | 2020-09-28 13:23:40 -0400 | [diff] [blame] | 164 | constexpr int kMaxP2PAttemptTimeSeconds = 5 * 24 * 60 * 60; |
David Zeuthen | 8f191b2 | 2013-08-06 12:27:50 -0700 | [diff] [blame] | 165 | |
| 166 | // The maximum amount of time to spend waiting for p2p-client(1) to |
| 167 | // return while waiting in line to use the LAN - six hours. |
Kelvin Zhang | ec205cf | 2020-09-28 13:23:40 -0400 | [diff] [blame] | 168 | constexpr int kMaxP2PNetworkWaitTimeSeconds = 6 * 60 * 60; |
David Zeuthen | dcba809 | 2013-08-06 12:16:35 -0700 | [diff] [blame] | 169 | |
David Zeuthen | 526cb58 | 2013-08-06 12:26:18 -0700 | [diff] [blame] | 170 | // The maximum number of payload files to keep in /var/cache/p2p. |
Kelvin Zhang | ec205cf | 2020-09-28 13:23:40 -0400 | [diff] [blame] | 171 | constexpr int kMaxP2PFilesToKeep = 3; |
David Zeuthen | 526cb58 | 2013-08-06 12:26:18 -0700 | [diff] [blame] | 172 | |
David Zeuthen | 41f2cf5 | 2014-11-05 12:29:45 -0500 | [diff] [blame] | 173 | // The maximum number of days to keep a p2p file; |
Kelvin Zhang | ec205cf | 2020-09-28 13:23:40 -0400 | [diff] [blame] | 174 | constexpr int kMaxP2PFileAgeDays = 5; |
David Zeuthen | 41f2cf5 | 2014-11-05 12:29:45 -0500 | [diff] [blame] | 175 | |
Jay Srinivasan | 19409b7 | 2013-04-12 19:23:36 -0700 | [diff] [blame] | 176 | // The default number of UMA buckets for metrics. |
Kelvin Zhang | ec205cf | 2020-09-28 13:23:40 -0400 | [diff] [blame] | 177 | constexpr int kNumDefaultUmaBuckets = 50; |
Jay Srinivasan | 19409b7 | 2013-04-12 19:23:36 -0700 | [diff] [blame] | 178 | |
Kelvin Zhang | ec205cf | 2020-09-28 13:23:40 -0400 | [diff] [blame] | 179 | // General constexprants |
| 180 | constexpr int kNumBytesInOneMiB = 1024 * 1024; |
Jay Srinivasan | 19409b7 | 2013-04-12 19:23:36 -0700 | [diff] [blame] | 181 | |
David Zeuthen | 34135a9 | 2013-08-06 11:16:16 -0700 | [diff] [blame] | 182 | // Number of redirects allowed when downloading. |
Kelvin Zhang | ec205cf | 2020-09-28 13:23:40 -0400 | [diff] [blame] | 183 | constexpr int kDownloadMaxRedirects = 10; |
David Zeuthen | 34135a9 | 2013-08-06 11:16:16 -0700 | [diff] [blame] | 184 | |
David Zeuthen | a641be5 | 2013-09-12 10:59:57 -0700 | [diff] [blame] | 185 | // The minimum average speed that downloads must sustain... |
David Zeuthen | 34135a9 | 2013-08-06 11:16:16 -0700 | [diff] [blame] | 186 | // |
| 187 | // This is set low because some devices may have very poor |
Alex Vakulenko | 072359c | 2014-07-18 11:41:07 -0700 | [diff] [blame] | 188 | // connectivity and we want to make as much forward progress as |
David Zeuthen | a641be5 | 2013-09-12 10:59:57 -0700 | [diff] [blame] | 189 | // possible. For p2p this is high (25 kB/second) since we can assume |
David Zeuthen | 34135a9 | 2013-08-06 11:16:16 -0700 | [diff] [blame] | 190 | // high bandwidth (same LAN) and we want to fail fast. |
Kelvin Zhang | ec205cf | 2020-09-28 13:23:40 -0400 | [diff] [blame] | 191 | constexpr int kDownloadLowSpeedLimitBps = 1; |
| 192 | constexpr int kDownloadP2PLowSpeedLimitBps = 25 * 1000; |
David Zeuthen | 34135a9 | 2013-08-06 11:16:16 -0700 | [diff] [blame] | 193 | |
| 194 | // ... measured over this period. |
| 195 | // |
| 196 | // For non-official builds (e.g. typically built on a developer's |
| 197 | // workstation and served via devserver) bump this since it takes time |
Aaron Wood | 2229059 | 2018-03-09 09:19:15 -0800 | [diff] [blame] | 198 | // for the workstation to generate the payload. For normal operation |
| 199 | // and p2p, make this relatively low since we want to fail fast in |
| 200 | // those cases. |
Kelvin Zhang | ec205cf | 2020-09-28 13:23:40 -0400 | [diff] [blame] | 201 | constexpr int kDownloadLowSpeedTimeSeconds = 30; |
| 202 | constexpr int kDownloadDevModeLowSpeedTimeSeconds = 180; |
| 203 | constexpr int kDownloadP2PLowSpeedTimeSeconds = 60; |
David Zeuthen | 34135a9 | 2013-08-06 11:16:16 -0700 | [diff] [blame] | 204 | |
| 205 | // The maximum amount of HTTP server reconnect attempts. |
| 206 | // |
| 207 | // This is set high in order to maximize the attempt's chance of |
| 208 | // succeeding. When using p2p, this is low in order to fail fast. |
Kelvin Zhang | ec205cf | 2020-09-28 13:23:40 -0400 | [diff] [blame] | 209 | constexpr int kDownloadMaxRetryCount = 20; |
| 210 | constexpr int kDownloadMaxRetryCountOobeNotComplete = 3; |
| 211 | constexpr int kDownloadMaxRetryCountInteractive = 3; |
| 212 | constexpr int kDownloadP2PMaxRetryCount = 5; |
David Zeuthen | 34135a9 | 2013-08-06 11:16:16 -0700 | [diff] [blame] | 213 | |
| 214 | // The connect timeout, in seconds. |
| 215 | // |
| 216 | // This is set high because some devices may have very poor |
| 217 | // connectivity and we may be using HTTPS which involves complicated |
| 218 | // multi-roundtrip setup. For p2p, this is set low because we can |
| 219 | // the server is on the same LAN and we want to fail fast. |
Kelvin Zhang | ec205cf | 2020-09-28 13:23:40 -0400 | [diff] [blame] | 220 | constexpr int kDownloadConnectTimeoutSeconds = 30; |
| 221 | constexpr int kDownloadP2PConnectTimeoutSeconds = 5; |
David Zeuthen | 34135a9 | 2013-08-06 11:16:16 -0700 | [diff] [blame] | 222 | |
xunchang | cda3c03 | 2019-03-26 15:41:14 -0700 | [diff] [blame] | 223 | // Size in bytes of SHA256 hash. |
Kelvin Zhang | ec205cf | 2020-09-28 13:23:40 -0400 | [diff] [blame] | 224 | constexpr int kSHA256Size = 32; |
| 225 | |
| 226 | // A hardcoded label to mark end of all InstallOps |
| 227 | // This number must be greater than number of install ops. |
| 228 | // Number of install ops is bounded by number of blocks on any partition. |
| 229 | // Currently, the block size is 4096. Using |kEndOfInstallLabel| of 2^48 will |
| 230 | // allow partitions with 2^48 * 4096 = 2^60 bytes. That's 1024PB? Partitions on |
| 231 | // android aren't getting that big any time soon. |
| 232 | constexpr uint64_t kEndOfInstallLabel = (1ULL << 48); |
xunchang | cda3c03 | 2019-03-26 15:41:14 -0700 | [diff] [blame] | 233 | |
Jay Srinivasan | 1c0fe79 | 2013-03-28 16:45:25 -0700 | [diff] [blame] | 234 | } // namespace chromeos_update_engine |
| 235 | |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 236 | #endif // UPDATE_ENGINE_COMMON_CONSTANTS_H_ |