summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-team Robot2018-04-17 02:27:46 -0500
committerandroid-build-team Robot2018-04-17 02:27:46 -0500
commit4d211294eb22edb379cdeec676410bbdaa95fb8c (patch)
treeb55d7257074667b5f8fe5e3c1e9c17b9f7cb4abe
parent1eaa23b778c02cf2b686112b583c3a30b0f6df07 (diff)
parent9893552f4395296e509ce0d006b32593cb748d69 (diff)
downloadplatform-system-libvintf-4d211294eb22edb379cdeec676410bbdaa95fb8c.tar.gz
platform-system-libvintf-4d211294eb22edb379cdeec676410bbdaa95fb8c.tar.xz
platform-system-libvintf-4d211294eb22edb379cdeec676410bbdaa95fb8c.zip
Snap for 4725392 from 9893552f4395296e509ce0d006b32593cb748d69 to pi-release
Change-Id: Ie24367dd486a70e7d38312b114b9bd8d5dfd03b4
-rw-r--r--RuntimeInfo.cpp7
-rw-r--r--test/LibVintfTest.cpp4
2 files changed, 6 insertions, 5 deletions
diff --git a/RuntimeInfo.cpp b/RuntimeInfo.cpp
index b343138..63a8c18 100644
--- a/RuntimeInfo.cpp
+++ b/RuntimeInfo.cpp
@@ -110,10 +110,11 @@ bool RuntimeInfo::checkCompatibility(const CompatibilityMatrix& mat, std::string
110 } 110 }
111 return false; 111 return false;
112 } 112 }
113 if (kernelSepolicyVersion() != mat.framework.mSepolicy.kernelSepolicyVersion()) { 113 if (kernelSepolicyVersion() < mat.framework.mSepolicy.kernelSepolicyVersion()) {
114 if (error != nullptr) { 114 if (error != nullptr) {
115 *error = "kernelSepolicyVersion = " + to_string(kernelSepolicyVersion()) 115 *error =
116 + " but required " + to_string(mat.framework.mSepolicy.kernelSepolicyVersion()); 116 "kernelSepolicyVersion = " + to_string(kernelSepolicyVersion()) +
117 " but required >= " + to_string(mat.framework.mSepolicy.kernelSepolicyVersion());
117 } 118 }
118 return false; 119 return false;
119 } 120 }
diff --git a/test/LibVintfTest.cpp b/test/LibVintfTest.cpp
index 4c7aa23..5fbd1b7 100644
--- a/test/LibVintfTest.cpp
+++ b/test/LibVintfTest.cpp
@@ -827,11 +827,11 @@ TEST_F(LibVintfTest, RuntimeInfo) {
827 MatrixKernel kernel(KernelVersion{3, 18, 22}, KernelConfigs(configs)); 827 MatrixKernel kernel(KernelVersion{3, 18, 22}, KernelConfigs(configs));
828 CompatibilityMatrix cm = testMatrix(std::move(kernel)); 828 CompatibilityMatrix cm = testMatrix(std::move(kernel));
829 set(cm, Sepolicy{22, {{25, 0}}}); 829 set(cm, Sepolicy{22, {{25, 0}}});
830 EXPECT_FALSE(ki.checkCompatibility(cm, &error)) 830 EXPECT_TRUE(ki.checkCompatibility(cm, &error)) << error;
831 << "kernel-sepolicy-version shouldn't match";
832 set(cm, Sepolicy{40, {{25, 0}}}); 831 set(cm, Sepolicy{40, {{25, 0}}});
833 EXPECT_FALSE(ki.checkCompatibility(cm, &error)) 832 EXPECT_FALSE(ki.checkCompatibility(cm, &error))
834 << "kernel-sepolicy-version shouldn't match"; 833 << "kernel-sepolicy-version shouldn't match";
834 EXPECT_IN("kernelSepolicyVersion = 30 but required >= 40", error);
835 } 835 }
836 836
837 { 837 {