Skip to content

Commit 96bcb45

Browse files
committed
Remove unused prompt attribute
The prompt attribute is like MoreInfo Mac-specific and not used by Flatcar (see https://github.com/google/omaha/blob/main/doc/ServerProtocolV2.md). Remove the unused prompt attribute (on Mac it was there to display a prompt UI before installing an update).
1 parent cf4f678 commit 96bcb45

File tree

4 files changed

+1
-18
lines changed

4 files changed

+1
-18
lines changed

src/update_engine/omaha_request_action.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ static const char* kTagMaxFailureCountPerUrl = "MaxFailureCountPerUrl";
4141
// Deprecated: "MetadataSize"
4242
// Deprecated: "MoreInfo"; See https://github.com/google/omaha/blob/main/doc/ServerProtocolV2.md
4343
// "And on the Mac, the Google Software Update Agent supports the following optional attributes": Prompt, MoreInfo
44+
// Deprecated: "Prompt"
4445
static const char* kTagNeedsAdmin = "needsadmin";
45-
static const char* kTagPrompt = "Prompt";
4646
static const char* kTagSha256 = "sha256";
4747

4848
namespace {
@@ -593,7 +593,6 @@ bool OmahaRequestAction::ParseParams(xmlDoc* doc,
593593
// Get the optional properties one by one.
594594
output_object->needs_admin =
595595
XmlGetProperty(pie_action_node, kTagNeedsAdmin) == "true";
596-
output_object->prompt = XmlGetProperty(pie_action_node, kTagPrompt) == "true";
597596

598597
string max = XmlGetProperty(pie_action_node, kTagMaxFailureCountPerUrl);
599598
if (!strings::StringToUint(max, &output_object->max_failure_count_per_url))

src/update_engine/omaha_request_action_unittest.cc

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ string GetNoUpdateResponse(const string& app_id) {
6969

7070
string GetUpdateResponse2(const string& app_id,
7171
const string& display_version,
72-
const string& prompt,
7372
const string& codebase,
7473
const string& filename,
7574
const string& hash,
@@ -86,7 +85,6 @@ string GetUpdateResponse2(const string& app_id,
8685
"<packages><package hash=\"not-used\" name=\"" + filename + "\" "
8786
"size=\"" + size + "\"/></packages>"
8887
"<actions><action event=\"postinstall\" "
89-
"Prompt=\"" + prompt + "\" "
9088
"IsDelta=\"true\" "
9189
"IsDeltaPayload=\"true\" "
9290
"sha256=\"" + hash + "\" "
@@ -98,15 +96,13 @@ string GetUpdateResponse2(const string& app_id,
9896

9997
string GetUpdateResponse(const string& app_id,
10098
const string& display_version,
101-
const string& prompt,
10299
const string& codebase,
103100
const string& filename,
104101
const string& hash,
105102
const string& needsadmin,
106103
const string& size) {
107104
return GetUpdateResponse2(app_id,
108105
display_version,
109-
prompt,
110106
codebase,
111107
filename,
112108
hash,
@@ -208,7 +204,6 @@ TEST(OmahaRequestActionTest, ValidUpdateTest) {
208204
GetDefaultTestParams(),
209205
GetUpdateResponse(OmahaRequestParams::kAppId,
210206
"1.2.3.4", // version
211-
"true", // prompt
212207
"http://code/base/", // dl url
213208
"file.signed", // file name
214209
"HASH1234=", // checksum
@@ -226,7 +221,6 @@ TEST(OmahaRequestActionTest, ValidUpdateTest) {
226221
EXPECT_EQ("HASH1234=", response.hash);
227222
EXPECT_EQ(123, response.size);
228223
EXPECT_FALSE(response.needs_admin);
229-
EXPECT_TRUE(response.prompt);
230224
}
231225

232226
TEST(OmahaRequestActionTest, NoOutputPipeTest) {
@@ -343,7 +337,6 @@ TEST(OmahaRequestActionTest, MissingFieldTest) {
343337
"<packages><package hash=\"not-used\" name=\"f\" "
344338
"size=\"587\"/></packages>"
345339
"<actions><action event=\"postinstall\" "
346-
"Prompt=\"false\" "
347340
"IsDelta=\"true\" "
348341
"IsDeltaPayload=\"false\" "
349342
"sha256=\"lkq34j5345\" "
@@ -366,7 +359,6 @@ TEST(OmahaRequestActionTest, MissingFieldTest) {
366359
EXPECT_EQ("lkq34j5345", response.hash);
367360
EXPECT_EQ(587, response.size);
368361
EXPECT_TRUE(response.needs_admin);
369-
EXPECT_FALSE(response.prompt);
370362
}
371363

372364
TEST(OmahaRequestActionTest, ConcatUrlSlashTest) {
@@ -381,7 +373,6 @@ TEST(OmahaRequestActionTest, ConcatUrlSlashTest) {
381373
"<packages><package hash=\"not-used\" name=\"f\" "
382374
"size=\"587\"/></packages>"
383375
"<actions><action event=\"postinstall\" "
384-
"Prompt=\"false\" "
385376
"IsDelta=\"true\" "
386377
"IsDeltaPayload=\"false\" "
387378
"sha256=\"lkq34j5345\" "
@@ -496,7 +487,6 @@ TEST(OmahaRequestActionTest, XmlDecodeTest) {
496487
GetDefaultTestParams(),
497488
GetUpdateResponse(OmahaRequestParams::kAppId,
498489
"1.2.3.4", // version
499-
"true", // prompt
500490
"testthe&amp;codebase/", // dl url
501491
"file.signed", // file name
502492
"HASH1234=", // checksum
@@ -518,7 +508,6 @@ TEST(OmahaRequestActionTest, ParseIntTest) {
518508
GetDefaultTestParams(),
519509
GetUpdateResponse(OmahaRequestParams::kAppId,
520510
"1.2.3.4", // version
521-
"true", // prompt
522511
"thecodebase/", // dl url
523512
"file.signed", // file name
524513
"HASH1234=", // checksum

src/update_engine/omaha_response.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ struct OmahaResponse {
2323
size(0),
2424
max_failure_count_per_url(0),
2525
needs_admin(false),
26-
prompt(false),
2726
is_delta_payload(false),
2827
disable_payload_backoff(false) {}
2928

@@ -47,7 +46,6 @@ struct OmahaResponse {
4746
// Omaha Response attribute, if ever we need to fine tune the behavior.
4847
uint32_t max_failure_count_per_url;
4948
bool needs_admin;
50-
bool prompt;
5149

5250
// True if the payload described in this response is a delta payload.
5351
// False if it's a full payload.

src/update_engine/omaha_response_handler_action_unittest.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ TEST_F(OmahaResponseHandlerActionTest, SimpleTest) {
8888
in.hash = "HASH+";
8989
in.size = 12;
9090
in.needs_admin = true;
91-
in.prompt = false;
9291
InstallPlan install_plan;
9392
EXPECT_TRUE(DoTest(in, "/dev/sda3", &install_plan));
9493
EXPECT_EQ(in.payload_urls[0], install_plan.download_url);
@@ -104,7 +103,6 @@ TEST_F(OmahaResponseHandlerActionTest, SimpleTest) {
104103
in.hash = "HASHj+";
105104
in.size = 12;
106105
in.needs_admin = true;
107-
in.prompt = true;
108106
InstallPlan install_plan;
109107
EXPECT_TRUE(DoTest(in, "/dev/sda4", &install_plan));
110108
EXPECT_EQ(in.payload_urls[0], install_plan.download_url);
@@ -120,7 +118,6 @@ TEST_F(OmahaResponseHandlerActionTest, SimpleTest) {
120118
in.hash = "HASHj+";
121119
in.size = 12;
122120
in.needs_admin = true;
123-
in.prompt = true;
124121
InstallPlan install_plan;
125122
EXPECT_TRUE(DoTest(in, "/dev/sda3", &install_plan));
126123
EXPECT_EQ(in.payload_urls[0], install_plan.download_url);

0 commit comments

Comments
 (0)