Check boot image version before update.

Rely on libkver to report boot image version and check
updateability correctly before the update.

Test: apply GKI update
Bug: 162554855
Bug: 162623577
Change-Id: If7668346db5dcb03a1fdd31a738dd5952e30ca1a
diff --git a/hardware_android.h b/hardware_android.h
index d8fbbbe..b670447 100644
--- a/hardware_android.h
+++ b/hardware_android.h
@@ -22,6 +22,7 @@
 
 #include <base/macros.h>
 #include <base/time/time.h>
+#include <gtest/gtest_prod.h>
 
 #include "update_engine/common/error_code.h"
 #include "update_engine/common/hardware.h"
@@ -67,6 +68,12 @@
       const std::string& new_version) const override;
 
  private:
+  FRIEND_TEST(HardwareAndroidTest, IsKernelUpdateValid);
+
+  // Helper for IsPartitionUpdateValid.
+  static ErrorCode IsKernelUpdateValid(const std::string& old_release,
+                                       const std::string& new_release);
+
   DISALLOW_COPY_AND_ASSIGN(HardwareAndroid);
 };