Update the payload public key location in Android.

In Android builds, the payload public key is installed in a different
location.

Bug: 23937688
Test: emerge-link update_engine; `mm`

Change-Id: Ic3a661e041a5709c116b6acd0d082a37b8bfe5df
diff --git a/delta_performer.cc b/delta_performer.cc
index 0482a8f..194f934 100644
--- a/delta_performer.cc
+++ b/delta_performer.cc
@@ -60,8 +60,6 @@
 const uint64_t DeltaPerformer::kSupportedMajorPayloadVersion = 1;
 const uint64_t DeltaPerformer::kSupportedMinorPayloadVersion = 2;
 
-const char DeltaPerformer::kUpdatePayloadPublicKeyPath[] =
-    "/usr/share/update_engine/update-payload-key.pub.pem";
 const unsigned DeltaPerformer::kProgressLogMaxChunks = 10;
 const unsigned DeltaPerformer::kProgressLogTimeoutSeconds = 30;
 const unsigned DeltaPerformer::kProgressDownloadWeight = 50;
diff --git a/delta_performer.h b/delta_performer.h
index d088796..087c2ad 100644
--- a/delta_performer.h
+++ b/delta_performer.h
@@ -31,6 +31,7 @@
 #include "update_engine/file_writer.h"
 #include "update_engine/install_plan.h"
 #include "update_engine/omaha_hash_calculator.h"
+#include "update_engine/platform_constants.h"
 #include "update_engine/system_state.h"
 #include "update_engine/update_metadata.pb.h"
 
@@ -53,7 +54,6 @@
   static const uint64_t kDeltaManifestSizeSize;
   static const uint64_t kSupportedMajorPayloadVersion;
   static const uint64_t kSupportedMinorPayloadVersion;
-  static const char kUpdatePayloadPublicKeyPath[];
 
   // Defines the granularity of progress logging in terms of how many "completed
   // chunks" we want to report at the most.
@@ -85,7 +85,7 @@
         buffer_offset_(0),
         last_updated_buffer_offset_(kuint64max),
         block_size_(0),
-        public_key_path_(kUpdatePayloadPublicKeyPath),
+        public_key_path_(constants::kUpdatePayloadPublicKeyPath),
         total_bytes_received_(0),
         num_rootfs_operations_(0),
         num_total_operations_(0),
diff --git a/omaha_response_handler_action.cc b/omaha_response_handler_action.cc
index dba3d74..1153628 100644
--- a/omaha_response_handler_action.cc
+++ b/omaha_response_handler_action.cc
@@ -40,16 +40,13 @@
 
 OmahaResponseHandlerAction::OmahaResponseHandlerAction(
     SystemState* system_state)
-    : system_state_(system_state),
-      got_no_update_response_(false),
-      key_path_(DeltaPerformer::kUpdatePayloadPublicKeyPath),
-      deadline_file_(kDeadlineFile) {}
+    : OmahaResponseHandlerAction(system_state, kDeadlineFile) {}
 
 OmahaResponseHandlerAction::OmahaResponseHandlerAction(
     SystemState* system_state, const string& deadline_file)
     : system_state_(system_state),
       got_no_update_response_(false),
-      key_path_(DeltaPerformer::kUpdatePayloadPublicKeyPath),
+      key_path_(constants::kUpdatePayloadPublicKeyPath),
       deadline_file_(deadline_file) {}
 
 void OmahaResponseHandlerAction::PerformAction() {
diff --git a/platform_constants.h b/platform_constants.h
index 9f8778e..0c832c9 100644
--- a/platform_constants.h
+++ b/platform_constants.h
@@ -33,6 +33,11 @@
 // The name of the platform as sent to Omaha.
 extern const char kOmahaPlatformName[];
 
+// Path to the location of the public half of the payload key. The payload key
+// is used to sign the contents of the payload binary file: the manifest and the
+// whole payload.
+extern const char kUpdatePayloadPublicKeyPath[];
+
 }  // namespace constants
 }  // namespace chromeos_update_engine
 
diff --git a/platform_constants_android.cc b/platform_constants_android.cc
index 55ec974..be0329b 100644
--- a/platform_constants_android.cc
+++ b/platform_constants_android.cc
@@ -25,6 +25,8 @@
     "https://clients2.google.com/service/update2/brillo";
 const char kOmahaUpdaterID[] = "Brillo";
 const char kOmahaPlatformName[] = "Brillo";
+const char kUpdatePayloadPublicKeyPath[] =
+    "/etc/update_engine/update-payload-key.pub.pem";
 
 }  // namespace constants
 }  // namespace chromeos_update_engine
diff --git a/platform_constants_chromeos.cc b/platform_constants_chromeos.cc
index 62c1720..2a6ce12 100644
--- a/platform_constants_chromeos.cc
+++ b/platform_constants_chromeos.cc
@@ -25,6 +25,8 @@
     "https://omaha.sandbox.google.com/service/update2";
 const char kOmahaUpdaterID[] = "ChromeOSUpdateEngine";
 const char kOmahaPlatformName[] = "Chrome OS";
+const char kUpdatePayloadPublicKeyPath[] =
+    "/usr/share/update_engine/update-payload-key.pub.pem";
 
 }  // namespace constants
 }  // namespace chromeos_update_engine