Jay Srinivasan | 1c0fe79 | 2013-03-28 16:45:25 -0700 | [diff] [blame] | 1 | // Copyright (c) 2013 The Chromium OS Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_CONSTANTS_H |
| 6 | #define CHROMEOS_PLATFORM_UPDATE_ENGINE_CONSTANTS_H |
| 7 | |
| 8 | namespace chromeos_update_engine { |
| 9 | |
| 10 | // The name of the marker file used to trigger powerwash when post-install |
| 11 | // completes successfully so that the device is powerwashed on next reboot. |
| 12 | extern const char kPowerwashMarkerFile[]; |
| 13 | |
Chris Sosa | be45bef | 2013-04-09 18:25:12 -0700 | [diff] [blame] | 14 | // Path to the marker file we use to indicate we've recorded a system reboot. |
| 15 | extern const char kSystemRebootedMarkerFile[]; |
| 16 | |
Jay Srinivasan | 1c0fe79 | 2013-03-28 16:45:25 -0700 | [diff] [blame] | 17 | // The contents of the powerwash marker file. |
| 18 | extern const char kPowerwashCommand[]; |
| 19 | |
Chris Sosa | aa18e16 | 2013-06-20 13:20:30 -0700 | [diff] [blame] | 20 | // Directory for AU prefs that are preserved across powerwash. |
| 21 | extern const char kPowerwashSafePrefsDir[]; |
| 22 | |
| 23 | // The location where we store the AU preferences (state etc). |
| 24 | extern const char kPrefsDirectory[]; |
| 25 | |
Chris Sosa | be45bef | 2013-04-09 18:25:12 -0700 | [diff] [blame] | 26 | // Path to the stateful partition on the root filesystem. |
| 27 | extern const char kStatefulPartition[]; |
| 28 | |
Jay Srinivasan | d29695d | 2013-04-08 15:08:05 -0700 | [diff] [blame] | 29 | // Constants related to preferences. |
| 30 | extern const char kPrefsBackoffExpiryTime[]; |
| 31 | extern const char kPrefsCertificateReportToSendDownload[]; |
| 32 | extern const char kPrefsCertificateReportToSendUpdate[]; |
Jay Srinivasan | 19409b7 | 2013-04-12 19:23:36 -0700 | [diff] [blame] | 33 | extern const char kPrefsCurrentBytesDownloaded[]; |
Jay Srinivasan | d29695d | 2013-04-08 15:08:05 -0700 | [diff] [blame] | 34 | extern const char kPrefsCurrentResponseSignature[]; |
| 35 | extern const char kPrefsCurrentUrlFailureCount[]; |
| 36 | extern const char kPrefsCurrentUrlIndex[]; |
| 37 | extern const char kPrefsDeltaUpdateFailures[]; |
Alex Deymo | 820cc70 | 2013-06-28 15:43:46 -0700 | [diff] [blame] | 38 | extern const char kPrefsFullPayloadAttemptNumber[]; |
Jay Srinivasan | d29695d | 2013-04-08 15:08:05 -0700 | [diff] [blame] | 39 | extern const char kPrefsLastActivePingDay[]; |
| 40 | extern const char kPrefsLastRollCallPingDay[]; |
| 41 | extern const char kPrefsManifestMetadataSize[]; |
Chris Sosa | be45bef | 2013-04-09 18:25:12 -0700 | [diff] [blame] | 42 | extern const char kPrefsNumReboots[]; |
David Zeuthen | a573d6f | 2013-06-14 16:13:36 -0700 | [diff] [blame] | 43 | extern const char kPrefsNumResponsesSeen[]; |
Jay Srinivasan | d29695d | 2013-04-08 15:08:05 -0700 | [diff] [blame] | 44 | extern const char kPrefsPayloadAttemptNumber[]; |
| 45 | extern const char kPrefsPreviousVersion[]; |
| 46 | extern const char kPrefsResumedUpdateFailures[]; |
Chris Sosa | aa18e16 | 2013-06-20 13:20:30 -0700 | [diff] [blame] | 47 | extern const char kPrefsRollbackVersion[]; |
David Zeuthen | e4c58bf | 2013-06-18 17:26:50 -0700 | [diff] [blame] | 48 | extern const char kPrefsSystemUpdatedMarker[]; |
Jay Srinivasan | 19409b7 | 2013-04-12 19:23:36 -0700 | [diff] [blame] | 49 | extern const char kPrefsTotalBytesDownloaded[]; |
Jay Srinivasan | d29695d | 2013-04-08 15:08:05 -0700 | [diff] [blame] | 50 | extern const char kPrefsUpdateCheckCount[]; |
| 51 | extern const char kPrefsUpdateCheckResponseHash[]; |
David Zeuthen | cc6f996 | 2013-04-18 11:57:24 -0700 | [diff] [blame] | 52 | extern const char kPrefsUpdateDurationUptime[]; |
Jay Srinivasan | d29695d | 2013-04-08 15:08:05 -0700 | [diff] [blame] | 53 | extern const char kPrefsUpdateFirstSeenAt[]; |
Alex Deymo | f4867c4 | 2013-06-28 14:41:39 -0700 | [diff] [blame^] | 54 | extern const char kPrefsUpdateOverCellularPermission[]; |
Jay Srinivasan | d29695d | 2013-04-08 15:08:05 -0700 | [diff] [blame] | 55 | extern const char kPrefsUpdateServerCertificate[]; |
| 56 | extern const char kPrefsUpdateStateNextDataOffset[]; |
| 57 | extern const char kPrefsUpdateStateNextOperation[]; |
| 58 | extern const char kPrefsUpdateStateSHA256Context[]; |
| 59 | extern const char kPrefsUpdateStateSignatureBlob[]; |
| 60 | extern const char kPrefsUpdateStateSignedSHA256Context[]; |
David Zeuthen | 9a017f2 | 2013-04-11 16:10:26 -0700 | [diff] [blame] | 61 | extern const char kPrefsUpdateTimestampStart[]; |
David Zeuthen | cc6f996 | 2013-04-18 11:57:24 -0700 | [diff] [blame] | 62 | extern const char kPrefsUrlSwitchCount[]; |
| 63 | extern const char kPrefsWallClockWaitPeriod[]; |
Jay Srinivasan | d29695d | 2013-04-08 15:08:05 -0700 | [diff] [blame] | 64 | |
Jay Srinivasan | 19409b7 | 2013-04-12 19:23:36 -0700 | [diff] [blame] | 65 | // A download source is any combination of protocol and server (that's of |
| 66 | // interest to us when looking at UMA metrics) using which we may download |
| 67 | // the payload. |
| 68 | typedef enum { |
| 69 | kDownloadSourceHttpsServer, // UMA Binary representation: 0001 |
| 70 | kDownloadSourceHttpServer, // UMA Binary representation: 0010 |
| 71 | |
| 72 | // Note: Add new sources only above this line. |
| 73 | kNumDownloadSources |
| 74 | } DownloadSource; |
| 75 | |
Alex Deymo | 1c656c4 | 2013-06-28 11:02:14 -0700 | [diff] [blame] | 76 | // A payload can be a Full or Delta payload. In some cases, a Full payload is |
| 77 | // used even when a Delta payload was available for the update, called here |
| 78 | // ForcedFull. The PayloadType enum is only used to send UMA metrics about the |
| 79 | // successfully applied payload. |
| 80 | typedef enum { |
| 81 | kPayloadTypeFull, |
| 82 | kPayloadTypeDelta, |
| 83 | kPayloadTypeForcedFull, |
| 84 | |
| 85 | // Note: Add new payload types only above this line. |
| 86 | kNumPayloadTypes |
| 87 | } PayloadType; |
| 88 | |
Jay Srinivasan | 19409b7 | 2013-04-12 19:23:36 -0700 | [diff] [blame] | 89 | // The default number of UMA buckets for metrics. |
| 90 | const int kNumDefaultUmaBuckets = 50; |
| 91 | |
| 92 | // General constants |
| 93 | const int kNumBytesInOneMiB = 1024 * 1024; |
| 94 | |
Jay Srinivasan | 1c0fe79 | 2013-03-28 16:45:25 -0700 | [diff] [blame] | 95 | } // namespace chromeos_update_engine |
| 96 | |
| 97 | #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_CONSTANTS_H |