esed.rc: disable hardware version filtering in esed.
am: c13093ac92

Change-Id: If0a278451f8249e71358fb79c241bcc5c5ddf237
diff --git a/OWNERS b/OWNERS
new file mode 100644
index 0000000..9f8426a
--- /dev/null
+++ b/OWNERS
@@ -0,0 +1,2 @@
+ascull@google.com
+drewry@google.com
diff --git a/esed/Android.bp b/esed/Android.bp
index 997329f..f746f38 100644
--- a/esed/Android.bp
+++ b/esed/Android.bp
@@ -14,8 +14,6 @@
 // limitations under the License.
 //
 
-subdirs = ["tests"]
-
 cc_defaults {
     name: "esed_defaults",
     proprietary: true,
diff --git a/esed/tests/Android.bp b/esed/tests/Android.bp
deleted file mode 100644
index b5f504e..0000000
--- a/esed/tests/Android.bp
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// Copyright (C) 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-// TODO: move to a VTS test
-cc_test {
-    name: "esed_integration_tests",
-    proprietary: true,
-    srcs: [
-        "weaver_integration_tests.cpp",
-    ],
-    host_supported: false,
-    shared_libs: [
-        "android.hardware.weaver@1.0",
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-    ],
-}
diff --git a/esed/tests/oemlock_integration_tests.cpp b/esed/tests/oemlock_integration_tests.cpp
deleted file mode 100644
index 9f1b148..0000000
--- a/esed/tests/oemlock_integration_tests.cpp
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string>
-
-#include <android-base/logging.h>
-#include <android/hardware/oemlock/1.0/IOemLock.h>
-#include <hidl/Status.h>
-
-#include <gtest/gtest.h>
-
-using ::android::OK;
-using ::android::sp;
-using ::android::status_t;
-using ::android::hardware::oemlock::V1_0::IOemLock;
-using ::android::hardware::oemlock::V1_0::OemLockSecureStatus;
-using ::android::hardware::oemlock::V1_0::OemLockStatus;
-using ::android::hardware::hidl_string;
-using ::android::hardware::hidl_vec;
-using ::android::hardware::Return;
-using ::android::hardware::Void;
-
-using ::testing::Test;
-
-class OemLockClientTest : public virtual Test {
- public:
-  OemLockClientTest() {
-  }
-  virtual ~OemLockClientTest() { }
-  virtual void SetUp() {
-    service_ = IOemLock::getService();
-    ASSERT_NE(service_, nullptr);
-  }
-  virtual void TearDown() { }
-  sp<IOemLock> service_;
-};
-
-TEST_F(OemLockClientTest, GetName) {
-  std::string name;
-  OemLockStatus status;
-  auto get_name_cb = [&status, &name](OemLockStatus cb_status, hidl_string cb_name) {
-    status = cb_status;
-    name = cb_name.c_str();
-  };
-  Return<void> ret = service_->getName(get_name_cb);
-
-  EXPECT_TRUE(ret.isOk());
-  EXPECT_EQ(status, OemLockStatus::OK);
-  EXPECT_STREQ(name.c_str(), "01");
-};
-
-TEST_F(OemLockClientTest, AllowedByDeviceToggle) {
-  // Should always work as it is independent of carrier and boot lock states.
-  bool allowed = true;
-  OemLockStatus status;
-  auto get_allowed_cb = [&status, &allowed](OemLockStatus cb_status, bool cb_allowed) {
-    status = cb_status;
-    allowed = cb_allowed;
-  };
-
-  Return<OemLockStatus> set_ret = service_->setOemUnlockAllowedByDevice(allowed);
-  EXPECT_EQ(set_ret, OemLockStatus::OK);
-  Return<void> get_ret = service_->isOemUnlockAllowedByDevice(get_allowed_cb);
-  EXPECT_EQ(status, OemLockStatus::OK);
-  EXPECT_EQ(true, allowed);
-
-  allowed = false;
-  set_ret = service_->setOemUnlockAllowedByDevice(allowed);
-  EXPECT_EQ(set_ret, OemLockStatus::OK);
-  get_ret = service_->isOemUnlockAllowedByDevice(get_allowed_cb);
-  EXPECT_EQ(status, OemLockStatus::OK);
-  EXPECT_EQ(false, allowed);
-};
-
-TEST_F(OemLockClientTest, GetAllowedByCarrierIsFalse) {
-  bool allowed = true;
-  OemLockStatus status;
-  auto get_allowed_cb = [&status, &allowed](OemLockStatus cb_status, bool cb_allowed) {
-    status = cb_status;
-    allowed = cb_allowed;
-  };
-
-  Return<void> ret = service_->isOemUnlockAllowedByCarrier(get_allowed_cb);
-  EXPECT_EQ(status, OemLockStatus::OK);
-  EXPECT_EQ(false, allowed);
-};
diff --git a/esed/tests/weaver_integration_tests.cpp b/esed/tests/weaver_integration_tests.cpp
deleted file mode 100644
index 747955c..0000000
--- a/esed/tests/weaver_integration_tests.cpp
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string>
-
-#include <android-base/logging.h>
-#include <android/hardware/weaver/1.0/IWeaver.h>
-#include <hidl/Status.h>
-
-#include <gtest/gtest.h>
-
-using ::android::OK;
-using ::android::sp;
-using ::android::status_t;
-using ::android::hardware::weaver::V1_0::IWeaver;
-using ::android::hardware::weaver::V1_0::WeaverConfig;
-using ::android::hardware::weaver::V1_0::WeaverReadResponse;
-using ::android::hardware::weaver::V1_0::WeaverReadStatus;
-using ::android::hardware::weaver::V1_0::WeaverStatus;
-using ::android::hardware::hidl_string;
-using ::android::hardware::hidl_vec;
-using ::android::hardware::Return;
-using ::android::hardware::Void;
-
-using ::testing::Test;
-
-const std::vector<uint8_t> KEY{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
-const std::vector<uint8_t> WRONG_KEY{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
-const std::vector<uint8_t> VALUE{16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1};
-
-struct WeaverClientTest : public Test {
-  sp<IWeaver> service;
-
-  WeaverClientTest() = default;
-  virtual ~WeaverClientTest() = default;
-  void SetUp() override {
-    service = IWeaver::getService();
-    ASSERT_NE(service, nullptr);
-  }
-  void TearDown() override {}
-};
-
-TEST_F(WeaverClientTest, getConfig) {
-  bool cbkCalled = false;
-  WeaverStatus status;
-  WeaverConfig config;
-  auto ret = service->getConfig([&](WeaverStatus s, WeaverConfig c) {
-    cbkCalled = true;
-    status = s;
-    config = c;
-  });
-
-  EXPECT_TRUE(cbkCalled);
-  EXPECT_TRUE(ret.isOk());
-  EXPECT_EQ(status, WeaverStatus::OK);
-  const WeaverConfig expectedConfig{64, 16, 16};
-  EXPECT_EQ(config, expectedConfig);
-}
-
-TEST_F(WeaverClientTest, writeAndReadBack) {
-  const uint32_t slotId = 3;
-  auto ret = service->write(slotId, KEY, VALUE);
-  EXPECT_TRUE(ret.isOk());
-  EXPECT_EQ(ret, WeaverStatus::OK);
-
-  bool cbkCalled = false;
-  WeaverReadStatus status;
-  std::vector<uint8_t> readValue;
-  uint32_t timeout;
-  auto readRet = service->read(slotId, KEY, [&](WeaverReadStatus s, WeaverReadResponse r) {
-    cbkCalled = true;
-    status = s;
-    readValue = r.value;
-    timeout = r.timeout;
-  });
-  EXPECT_TRUE(cbkCalled);
-  EXPECT_TRUE(readRet.isOk());
-  EXPECT_EQ(status, WeaverReadStatus::OK);
-  EXPECT_EQ(readValue, VALUE);
-}
-
-TEST_F(WeaverClientTest, writeAndReadWithWrongKey) {
-  const uint32_t slotId = 3;
-  auto ret = service->write(slotId, KEY, VALUE);
-  EXPECT_TRUE(ret.isOk());
-  EXPECT_EQ(ret, WeaverStatus::OK);
-
-  bool cbkCalled = false;
-  WeaverReadStatus status;
-  std::vector<uint8_t> readValue;
-  uint32_t timeout;
-  auto readRet = service->read(slotId, WRONG_KEY, [&](WeaverReadStatus s, WeaverReadResponse r) {
-    cbkCalled = true;
-    status = s;
-    readValue = r.value;
-    timeout = r.timeout;
-  });
-  EXPECT_TRUE(cbkCalled);
-  EXPECT_TRUE(readRet.isOk());
-  EXPECT_EQ(status, WeaverReadStatus::INCORRECT_KEY);
-  EXPECT_EQ(timeout, uint32_t{0}); // first timeout is 0
-}
diff --git a/libese/Android.bp b/libese/Android.bp
index 8352170..f495f12 100644
--- a/libese/Android.bp
+++ b/libese/Android.bp
@@ -47,7 +47,10 @@
         "ese_sg.c",
     ],
 
+    export_include_dirs: ["include"],
+
     shared_libs: ["libese-sysdeps", "liblog"],
+    export_shared_lib_headers: ["liblog"],
 }
 
 subdirs = ["tests"]
diff --git a/third_party/NXPNFC_P61_JCOP_Kit/include/AlaLib.h b/third_party/NXPNFC_P61_JCOP_Kit/include/AlaLib.h
index fdb047a..47873b7 100644
--- a/third_party/NXPNFC_P61_JCOP_Kit/include/AlaLib.h
+++ b/third_party/NXPNFC_P61_JCOP_Kit/include/AlaLib.h
@@ -23,6 +23,8 @@
 #ifndef ALALIB_H_
 #define ALALIB_H_
 
+#include <stdio.h>
+
 #include "IChannel.h"
 
 /*******************************************************************************