blob: 7b3dca9656b1d043b02c4e414ba93c78861456c2 [file] [log] [blame]
Jay Srinivasan1c0fe792013-03-28 16:45:25 -07001// 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
8namespace 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.
12extern const char kPowerwashMarkerFile[];
13
Chris Sosabe45bef2013-04-09 18:25:12 -070014// Path to the marker file we use to indicate we've recorded a system reboot.
15extern const char kSystemRebootedMarkerFile[];
16
Jay Srinivasan1c0fe792013-03-28 16:45:25 -070017// The contents of the powerwash marker file.
18extern const char kPowerwashCommand[];
19
Chris Sosaaa18e162013-06-20 13:20:30 -070020// Directory for AU prefs that are preserved across powerwash.
21extern const char kPowerwashSafePrefsDir[];
22
23// The location where we store the AU preferences (state etc).
24extern const char kPrefsDirectory[];
25
Chris Sosabe45bef2013-04-09 18:25:12 -070026// Path to the stateful partition on the root filesystem.
27extern const char kStatefulPartition[];
28
Jay Srinivasand29695d2013-04-08 15:08:05 -070029// Constants related to preferences.
30extern const char kPrefsBackoffExpiryTime[];
31extern const char kPrefsCertificateReportToSendDownload[];
32extern const char kPrefsCertificateReportToSendUpdate[];
Jay Srinivasan19409b72013-04-12 19:23:36 -070033extern const char kPrefsCurrentBytesDownloaded[];
Jay Srinivasand29695d2013-04-08 15:08:05 -070034extern const char kPrefsCurrentResponseSignature[];
35extern const char kPrefsCurrentUrlFailureCount[];
36extern const char kPrefsCurrentUrlIndex[];
37extern const char kPrefsDeltaUpdateFailures[];
Alex Deymo820cc702013-06-28 15:43:46 -070038extern const char kPrefsFullPayloadAttemptNumber[];
Jay Srinivasand29695d2013-04-08 15:08:05 -070039extern const char kPrefsLastActivePingDay[];
40extern const char kPrefsLastRollCallPingDay[];
41extern const char kPrefsManifestMetadataSize[];
Chris Sosabe45bef2013-04-09 18:25:12 -070042extern const char kPrefsNumReboots[];
David Zeuthena573d6f2013-06-14 16:13:36 -070043extern const char kPrefsNumResponsesSeen[];
Jay Srinivasand29695d2013-04-08 15:08:05 -070044extern const char kPrefsPayloadAttemptNumber[];
45extern const char kPrefsPreviousVersion[];
46extern const char kPrefsResumedUpdateFailures[];
Chris Sosaaa18e162013-06-20 13:20:30 -070047extern const char kPrefsRollbackVersion[];
David Zeuthene4c58bf2013-06-18 17:26:50 -070048extern const char kPrefsSystemUpdatedMarker[];
Alex Deymo42432912013-07-12 20:21:15 -070049extern const char kPrefsTargetVersionAttempt[];
50extern const char kPrefsTargetVersionInstalledFrom[];
51extern const char kPrefsTargetVersionUniqueId[];
Jay Srinivasan19409b72013-04-12 19:23:36 -070052extern const char kPrefsTotalBytesDownloaded[];
Jay Srinivasand29695d2013-04-08 15:08:05 -070053extern const char kPrefsUpdateCheckCount[];
54extern const char kPrefsUpdateCheckResponseHash[];
David Zeuthencc6f9962013-04-18 11:57:24 -070055extern const char kPrefsUpdateDurationUptime[];
Jay Srinivasand29695d2013-04-08 15:08:05 -070056extern const char kPrefsUpdateFirstSeenAt[];
Alex Deymof4867c42013-06-28 14:41:39 -070057extern const char kPrefsUpdateOverCellularPermission[];
Jay Srinivasand29695d2013-04-08 15:08:05 -070058extern const char kPrefsUpdateServerCertificate[];
59extern const char kPrefsUpdateStateNextDataOffset[];
60extern const char kPrefsUpdateStateNextOperation[];
61extern const char kPrefsUpdateStateSHA256Context[];
62extern const char kPrefsUpdateStateSignatureBlob[];
63extern const char kPrefsUpdateStateSignedSHA256Context[];
David Zeuthen9a017f22013-04-11 16:10:26 -070064extern const char kPrefsUpdateTimestampStart[];
David Zeuthencc6f9962013-04-18 11:57:24 -070065extern const char kPrefsUrlSwitchCount[];
66extern const char kPrefsWallClockWaitPeriod[];
Jay Srinivasand29695d2013-04-08 15:08:05 -070067
Jay Srinivasan19409b72013-04-12 19:23:36 -070068// A download source is any combination of protocol and server (that's of
69// interest to us when looking at UMA metrics) using which we may download
70// the payload.
71typedef enum {
72 kDownloadSourceHttpsServer, // UMA Binary representation: 0001
73 kDownloadSourceHttpServer, // UMA Binary representation: 0010
74
75 // Note: Add new sources only above this line.
76 kNumDownloadSources
77} DownloadSource;
78
Alex Deymo1c656c42013-06-28 11:02:14 -070079// A payload can be a Full or Delta payload. In some cases, a Full payload is
80// used even when a Delta payload was available for the update, called here
81// ForcedFull. The PayloadType enum is only used to send UMA metrics about the
82// successfully applied payload.
83typedef enum {
84 kPayloadTypeFull,
85 kPayloadTypeDelta,
86 kPayloadTypeForcedFull,
87
88 // Note: Add new payload types only above this line.
89 kNumPayloadTypes
90} PayloadType;
91
Jay Srinivasan19409b72013-04-12 19:23:36 -070092// The default number of UMA buckets for metrics.
93const int kNumDefaultUmaBuckets = 50;
94
95// General constants
96const int kNumBytesInOneMiB = 1024 * 1024;
97
Jay Srinivasan1c0fe792013-03-28 16:45:25 -070098} // namespace chromeos_update_engine
99
100#endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_CONSTANTS_H