Merge "hwcomposer HAL uses "default" service name"
diff --git a/audio/2.0/default/service.cpp b/audio/2.0/default/service.cpp
index 5782c6e..935d556 100644
--- a/audio/2.0/default/service.cpp
+++ b/audio/2.0/default/service.cpp
@@ -45,7 +45,7 @@
     // Soundtrigger and FM radio might be not present.
     status = registerPassthroughServiceImplementation<ISoundTriggerHw>("sound_trigger.primary");
     ALOGE_IF(status != OK, "Error while registering soundtrigger service: %d", status);
-    status = registerPassthroughServiceImplementation<IBroadcastRadioFactory>("broadcastradio");
+    status = registerPassthroughServiceImplementation<IBroadcastRadioFactory>();
     ALOGE_IF(status != OK, "Error while registering fm radio service: %d", status);
     joinRpcThreadpool();
     return status;
diff --git a/broadcastradio/1.0/vts/functional/VtsHalBroadcastradioV1_0TargetTest.cpp b/broadcastradio/1.0/vts/functional/VtsHalBroadcastradioV1_0TargetTest.cpp
index bcbfbb7..da17514 100644
--- a/broadcastradio/1.0/vts/functional/VtsHalBroadcastradioV1_0TargetTest.cpp
+++ b/broadcastradio/1.0/vts/functional/VtsHalBroadcastradioV1_0TargetTest.cpp
@@ -63,7 +63,7 @@
             }
         }
         sp<IBroadcastRadioFactory> factory =
-              IBroadcastRadioFactory::getService("broadcastradio", getStub);
+              IBroadcastRadioFactory::getService(getStub);
         if (factory != 0) {
             factory->connectModule(Class::AM_FM,
                              [&](Result retval, const ::android::sp<IBroadcastRadio>& result) {
diff --git a/contexthub/1.0/default/service.cpp b/contexthub/1.0/default/service.cpp
index db9a4e7..8c676b4 100644
--- a/contexthub/1.0/default/service.cpp
+++ b/contexthub/1.0/default/service.cpp
@@ -23,5 +23,5 @@
 using android::hardware::defaultPassthroughServiceImplementation;
 
 int main() {
-    return defaultPassthroughServiceImplementation<IContexthub>("context_hub");
+    return defaultPassthroughServiceImplementation<IContexthub>();
 }
diff --git a/gatekeeper/1.0/vts/functional/VtsHalGatekeeperV1_0TargetTest.cpp b/gatekeeper/1.0/vts/functional/VtsHalGatekeeperV1_0TargetTest.cpp
index 67b4482..7da2293 100644
--- a/gatekeeper/1.0/vts/functional/VtsHalGatekeeperV1_0TargetTest.cpp
+++ b/gatekeeper/1.0/vts/functional/VtsHalGatekeeperV1_0TargetTest.cpp
@@ -281,7 +281,6 @@
  */
 TEST_F(GatekeeperHidlTest, UntrustedReenroll) {
   GatekeeperResponse enrollRsp;
-  GatekeeperRequest reenrollReq;
   GatekeeperResponse reenrollRsp;
   GatekeeperResponse verifyRsp;
   GatekeeperResponse reenrollVerifyRsp;
@@ -349,6 +348,37 @@
 }
 
 /**
+ * Ensure we can not delete a user that does not exist
+ */
+TEST_F(GatekeeperHidlTest, DeleteInvalidUserTest) {
+  hidl_vec<uint8_t> password;
+  GatekeeperResponse enrollRsp;
+  GatekeeperResponse verifyRsp;
+  GatekeeperResponse delRsp1;
+  GatekeeperResponse delRsp2;
+  ALOGI("Testing deleteUser (expected failure)");
+  setUid(10002);
+  generatePassword(password, 0);
+  enrollNewPassword(password, enrollRsp, true);
+  verifyPassword(password, enrollRsp.data, 0, verifyRsp, true);
+  ALOGI("Enroll+Verify done");
+
+  // Delete the user
+  doDeleteUser(delRsp1);
+  EXPECT_EQ(UINT32_C(0), delRsp1.data.size());
+  EXPECT_TRUE(delRsp1.code == GatekeeperStatusCode::ERROR_NOT_IMPLEMENTED ||
+              delRsp1.code == GatekeeperStatusCode::STATUS_OK);
+
+  // Delete the user again
+  doDeleteUser(delRsp2);
+  EXPECT_EQ(UINT32_C(0), delRsp2.data.size());
+  EXPECT_TRUE(delRsp2.code == GatekeeperStatusCode::ERROR_NOT_IMPLEMENTED ||
+              delRsp2.code == GatekeeperStatusCode::ERROR_GENERAL_FAILURE);
+  ALOGI("DeleteUser done");
+  ALOGI("Testing deleteUser done: rsp=%" PRIi32, delRsp2.code);
+}
+
+/**
  * Ensure we can not verify passwords after we enrolled them and then deleted
  * all users
  */
diff --git a/gnss/1.0/vts/functional/Android.bp b/gnss/1.0/vts/functional/Android.bp
new file mode 100644
index 0000000..42f2ce8
--- /dev/null
+++ b/gnss/1.0/vts/functional/Android.bp
@@ -0,0 +1,37 @@
+//
+// 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.
+//
+
+cc_test {
+    name: "VtsHalGnssV1_0TargetTest",
+    gtest: true,
+    srcs: ["VtsHalGnssV1_0TargetTest.cpp"],
+    shared_libs: [
+        "android.hardware.gnss@1.0",
+        "libbase",
+        "libcutils",
+        "libhidlbase",
+        "libhidltransport",
+        "libhwbinder",
+        "liblog",
+        "libnativehelper",
+        "libutils",
+    ],
+    static_libs: ["libgtest"],
+    cflags: [
+        "-O0",
+        "-g",
+    ],
+}
\ No newline at end of file
diff --git a/gnss/1.0/vts/functional/VtsHalGnssV1_0TargetTest.cpp b/gnss/1.0/vts/functional/VtsHalGnssV1_0TargetTest.cpp
new file mode 100644
index 0000000..f1cd9ec
--- /dev/null
+++ b/gnss/1.0/vts/functional/VtsHalGnssV1_0TargetTest.cpp
@@ -0,0 +1,279 @@
+/*
+ * 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.
+ */
+
+#define LOG_TAG "VtsHalGnssV1_0TargetTest"
+#include <android/hardware/gnss/1.0/IGnss.h>
+#include <android/log.h>
+
+#include <gtest/gtest.h>
+
+#include <chrono>
+#include <condition_variable>
+#include <mutex>
+
+using android::hardware::Return;
+using android::hardware::Void;
+
+using android::hardware::gnss::V1_0::GnssLocation;
+using android::hardware::gnss::V1_0::GnssLocationFlags;
+using android::hardware::gnss::V1_0::IGnss;
+using android::hardware::gnss::V1_0::IGnssCallback;
+using android::sp;
+
+#define TIMEOUT_SECONDS 5  // for basic commands/responses
+
+// The main test class for GNSS HAL.
+class GnssHalTest : public ::testing::Test {
+ public:
+  virtual void SetUp() override {
+    /* TODO(b/35678469): Setup the init.rc for VTS such that there's a
+     * single caller
+     * to the GNSS HAL - as part of confirming that the info & capabilities
+     * callbacks trigger.
+     */
+
+    gnss_hal_ = IGnss::getService("gnss");
+    ASSERT_NE(gnss_hal_, nullptr);
+
+    gnss_cb_ = new GnssCallback(*this);
+    ASSERT_NE(gnss_cb_, nullptr);
+
+    auto result = gnss_hal_->setCallback(gnss_cb_);
+    if (!result.isOk()) {
+      ALOGE("result of failed callback set %s", result.description().c_str());
+    }
+
+    ASSERT_TRUE(result.isOk());
+    ASSERT_TRUE(result);
+
+    /* TODO(b/35678469): Implement the capabilities & info (year) checks &
+     * value store here.
+     */
+  }
+
+  virtual void TearDown() override {
+    if (gnss_hal_ != nullptr) {
+      gnss_hal_->cleanup();
+    }
+  }
+
+  /* Used as a mechanism to inform the test that a callback has occurred */
+  inline void notify() {
+    std::unique_lock<std::mutex> lock(mtx_);
+    count++;
+    cv_.notify_one();
+  }
+
+  /* Test code calls this function to wait for a callback */
+  inline std::cv_status wait(int timeoutSeconds) {
+    std::unique_lock<std::mutex> lock(mtx_);
+
+    std::cv_status status = std::cv_status::no_timeout;
+    auto now = std::chrono::system_clock::now();
+    while (count == 0) {
+      status = cv_.wait_until(lock, now + std::chrono::seconds(timeoutSeconds));
+      if (status == std::cv_status::timeout) return status;
+    }
+    count--;
+    return status;
+  }
+
+  /* Callback class for data & Event. */
+  class GnssCallback : public IGnssCallback {
+    GnssHalTest& parent_;
+
+   public:
+    GnssCallback(GnssHalTest& parent) : parent_(parent){};
+
+    virtual ~GnssCallback() = default;
+
+    // Dummy callback handlers
+    Return<void> gnssStatusCb(
+        const IGnssCallback::GnssStatusValue status) override {
+      return Void();
+    }
+    Return<void> gnssSvStatusCb(
+        const IGnssCallback::GnssSvStatus& svStatus) override {
+      return Void();
+    }
+    Return<void> gnssNmeaCb(
+        int64_t timestamp,
+        const android::hardware::hidl_string& nmea) override {
+      return Void();
+    }
+    Return<void> gnssAcquireWakelockCb() override { return Void(); }
+    Return<void> gnssReleaseWakelockCb() override { return Void(); }
+    Return<void> gnssRequestTimeCb() override { return Void(); }
+
+    // Actual (test) callback handlers
+    Return<void> gnssLocationCb(const GnssLocation& location) override {
+      ALOGI("Location received");
+      parent_.location_called_count_++;
+      parent_.last_location_ = location;
+      parent_.notify();
+      return Void();
+    }
+
+    Return<void> gnssSetCapabilitesCb(uint32_t capabilities) override {
+      ALOGI("Capabilities received %d", capabilities);
+      parent_.capabilities_called_count_++;
+      parent_.last_capabilities_ = capabilities;
+      parent_.notify();
+      return Void();
+    }
+
+    Return<void> gnssSetSystemInfoCb(
+        const IGnssCallback::GnssSystemInfo& info) override {
+      ALOGI("Info received, year %d", info.yearOfHw);
+      parent_.info_called_count_++;
+      parent_.last_info_ = info;
+      parent_.notify();
+      return Void();
+    }
+  };
+
+  sp<IGnss> gnss_hal_;         // GNSS HAL to call into
+  sp<IGnssCallback> gnss_cb_;  // Primary callback interface
+
+  /* Count of calls to set the following items, and the latest item (used by
+   * test.)
+   */
+  int capabilities_called_count_;
+  uint32_t last_capabilities_;
+
+  int location_called_count_;
+  GnssLocation last_location_;
+
+  int info_called_count_;
+  IGnssCallback::GnssSystemInfo last_info_;
+
+ private:
+  std::mutex mtx_;
+  std::condition_variable cv_;
+  int count;
+};
+
+/*
+ * SetCallbackCapabilitiesCleanup:
+ * Sets up the callback, awaits the capabilities, and calls cleanup
+ *
+ * Since this is just the basic operation of SetUp() and TearDown(),
+ * the function definition is intentionally kept empty
+ */
+TEST_F(GnssHalTest, SetCallbackCapabilitiesCleanup) {}
+
+void CheckLocation(GnssLocation& location) {
+  EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_LAT_LONG);
+  EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_ALTITUDE);
+  EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_SPEED);
+  EXPECT_TRUE(location.gnssLocationFlags &
+              GnssLocationFlags::HAS_HORIZONTAL_ACCURACY);
+  EXPECT_GE(location.latitudeDegrees, -90.0);
+  EXPECT_LE(location.latitudeDegrees, 90.0);
+  EXPECT_GE(location.longitudeDegrees, -180.0);
+  EXPECT_LE(location.longitudeDegrees, 180.0);
+  EXPECT_GE(location.altitudeMeters, -1000.0);
+  EXPECT_LE(location.altitudeMeters, 30000.0);
+  EXPECT_GE(location.speedMetersPerSec, 0.0);
+  EXPECT_LE(location.speedMetersPerSec, 5.0);  // VTS tests are stationary.
+
+  /*
+   * Tolerating some especially high values for accuracy estimate, in case of
+   * first fix with especially poor geoemtry (happens occasionally)
+   */
+  EXPECT_GT(location.horizontalAccuracyMeters, 0.0);
+  EXPECT_LE(location.horizontalAccuracyMeters, 200.0);
+
+  /*
+   * Some devices may define bearing as -180 to +180, others as 0 to 360.
+   * Both are okay & understandable.
+   */
+  if (location.gnssLocationFlags & GnssLocationFlags::HAS_BEARING) {
+    EXPECT_GE(location.bearingDegrees, -180.0);
+    EXPECT_LE(location.bearingDegrees, 360.0);
+  }
+  if (location.gnssLocationFlags & GnssLocationFlags::HAS_VERTICAL_ACCURACY) {
+    EXPECT_GT(location.verticalAccuracyMeters, 0.0);
+    EXPECT_LE(location.verticalAccuracyMeters, 500.0);
+  }
+  if (location.gnssLocationFlags & GnssLocationFlags::HAS_SPEED_ACCURACY) {
+    EXPECT_GT(location.speedAccuracyMetersPerSecond, 0.0);
+    EXPECT_LE(location.speedAccuracyMetersPerSecond, 50.0);
+  }
+  if (location.gnssLocationFlags & GnssLocationFlags::HAS_BEARING_ACCURACY) {
+    EXPECT_GT(location.bearingAccuracyDegrees, 0.0);
+    EXPECT_LE(location.bearingAccuracyDegrees, 360.0);
+  }
+
+  // Check timestamp > 1.48e12 (47 years in msec - 1970->2017+)
+  EXPECT_GT(location.timestamp, 1.48e12);
+
+  /* TODO(b/35678469): Check if the hardware year is 2017+, and if so,
+   * that bearing, plus vertical, speed & bearing accuracy are present.
+   * And allow bearing to be not present, only if associated with a speed of 0.0
+   */
+}
+
+/*
+ * GetLocation:
+ * Turns on location, waits 45 second for at least 5 locations,
+ * and checks them for reasonable validity.
+ */
+TEST_F(GnssHalTest, GetLocation) {
+#define MIN_INTERVAL_MSEC 500
+#define PREFERRED_ACCURACY 0   // Ideally perfect (matches GnssLocationProvider)
+#define PREFERRED_TIME_MSEC 0  // Ideally immediate
+
+#define LOCATION_TIMEOUT_FIRST_SEC 45
+#define LOCATION_TIMEOUT_SUBSEQUENT_SEC 3
+#define LOCATIONS_TO_CHECK 5
+
+  auto result = gnss_hal_->setPositionMode(
+      IGnss::GnssPositionMode::MS_BASED,
+      IGnss::GnssPositionRecurrence::RECURRENCE_PERIODIC, MIN_INTERVAL_MSEC,
+      PREFERRED_ACCURACY, PREFERRED_TIME_MSEC);
+
+  ASSERT_TRUE(result.isOk());
+  ASSERT_TRUE(result);
+
+  result = gnss_hal_->start();
+
+  ASSERT_TRUE(result.isOk());
+  ASSERT_TRUE(result);
+
+  EXPECT_EQ(std::cv_status::no_timeout, wait(LOCATION_TIMEOUT_FIRST_SEC));
+  EXPECT_EQ(location_called_count_, 1);
+  CheckLocation(last_location_);
+
+  for (int i = 1; i < LOCATIONS_TO_CHECK; i++) {
+    EXPECT_EQ(std::cv_status::no_timeout,
+              wait(LOCATION_TIMEOUT_SUBSEQUENT_SEC));
+    EXPECT_EQ(location_called_count_, i + 1);
+    CheckLocation(last_location_);
+  }
+
+  result = gnss_hal_->stop();
+
+  ASSERT_TRUE(result.isOk());
+  ASSERT_TRUE(result);
+}
+
+int main(int argc, char** argv) {
+  ::testing::InitGoogleTest(&argc, argv);
+  int status = RUN_ALL_TESTS();
+  ALOGI("Test result = %d", status);
+  return status;
+}
\ No newline at end of file
diff --git a/gnss/Android.bp b/gnss/Android.bp
index bbb3e4b..eabbe85 100644
--- a/gnss/Android.bp
+++ b/gnss/Android.bp
@@ -1,4 +1,4 @@
-// This is an autogenerated file, do not edit.
 subdirs = [
     "1.0",
-]
+    "1.0/vts/functional",
+]
\ No newline at end of file
diff --git a/power/1.0/vts/functional/VtsHalPowerV1_0TargetTest.cpp b/power/1.0/vts/functional/VtsHalPowerV1_0TargetTest.cpp
index b114944..6783961 100644
--- a/power/1.0/vts/functional/VtsHalPowerV1_0TargetTest.cpp
+++ b/power/1.0/vts/functional/VtsHalPowerV1_0TargetTest.cpp
@@ -23,6 +23,8 @@
 
 #include <gtest/gtest.h>
 
+#include <algorithm>
+
 using ::android::hardware::power::V1_0::IPower;
 using ::android::hardware::power::V1_0::Feature;
 using ::android::hardware::power::V1_0::PowerHint;
@@ -32,6 +34,13 @@
 using ::android::hardware::Return;
 using ::android::sp;
 
+using std::vector;
+
+#define CPU_GOVERNOR_PATH \
+  "/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor"
+#define AVAILABLE_GOVERNORS_PATH \
+  "/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors"
+
 class PowerHidlTest : public ::testing::Test {
  public:
   virtual void SetUp() override {
@@ -55,6 +64,48 @@
   ASSERT_TRUE(ret.isOk());
 }
 
+// Test Power::setInteractive and Power::powerHint(Launch)
+// with each available CPU governor, if available
+TEST_F(PowerHidlTest, TryDifferentGovernors) {
+  Return<void> ret;
+
+  int fd1 = open(CPU_GOVERNOR_PATH, O_RDWR);
+  int fd2 = open(AVAILABLE_GOVERNORS_PATH, O_RDONLY);
+  if (fd1 < 0 || fd2 < 0) {
+      // Files don't exist, so skip the rest of the test case
+      SUCCEED();
+  }
+
+  char old_governor[80];
+  ASSERT_LE(0, read(fd1, old_governor, 80));
+
+  char governors[1024];
+  ASSERT_LE(0, read(fd2, governors, 1024));
+  close(fd2);
+
+  char *saveptr;
+  char *name = strtok_r(governors, " ", &saveptr);
+  while (name && strlen(name) > 1) {
+    ASSERT_LE(0, write(fd1, name, strlen(name)));
+    ret = power->setInteractive(true);
+    ASSERT_TRUE(ret.isOk());
+
+    ret = power->setInteractive(false);
+    ASSERT_TRUE(ret.isOk());
+
+    ret = power->setInteractive(false);
+    ASSERT_TRUE(ret.isOk());
+
+    power->powerHint(PowerHint::LAUNCH, 1);
+    power->powerHint(PowerHint::LAUNCH, 0);
+
+    name = strtok_r(NULL, " ", &saveptr);
+  }
+
+  ASSERT_LE(0, write(fd1, old_governor, strlen(old_governor)));
+  close(fd1);
+}
+
 // Sanity check Power::powerHint on good and bad inputs.
 TEST_F(PowerHidlTest, PowerHint) {
   PowerHint badHint = static_cast<PowerHint>(0xA);
@@ -65,12 +116,32 @@
                 badHint};
   Return<void> ret;
   for (auto hint : hints) {
-    ret = power->powerHint(hint, 1);
+    ret = power->powerHint(hint, 30000);
     ASSERT_TRUE(ret.isOk());
 
     ret = power->powerHint(hint, 0);
     ASSERT_TRUE(ret.isOk());
   }
+
+  // Turning these hints on in different orders triggers different code paths,
+  // so iterate over possible orderings.
+  std::vector<PowerHint> hints2 = {PowerHint::LAUNCH, PowerHint::VR_MODE,
+                                   PowerHint::SUSTAINED_PERFORMANCE,
+                                   PowerHint::INTERACTION};
+  auto compareHints = [](PowerHint l, PowerHint r) {
+    return static_cast<uint32_t>(l) < static_cast<uint32_t>(r);
+  };
+  std::sort(hints2.begin(), hints2.end(), compareHints);
+  do {
+    for (auto iter = hints2.begin(); iter != hints2.end(); iter++) {
+      ret = power->powerHint(*iter, 0);
+      ASSERT_TRUE(ret.isOk());
+    }
+    for (auto iter = hints2.begin(); iter != hints2.end(); iter++) {
+      ret = power->powerHint(*iter, 30000);
+      ASSERT_TRUE(ret.isOk());
+    }
+  } while (std::next_permutation(hints2.begin(), hints2.end(), compareHints));
 }
 
 // Sanity check Power::setFeature() on good and bad inputs.
diff --git a/radio/1.0/IRadio.hal b/radio/1.0/IRadio.hal
index bda7d65..baa4df6 100644
--- a/radio/1.0/IRadio.hal
+++ b/radio/1.0/IRadio.hal
@@ -726,26 +726,6 @@
     oneway getDataCallList(int32_t serial);
 
     /*
-     * This request is reserved for OEM-specific uses. It passes raw byte arrays back and forth.
-     *
-     * @param serial Serial number of request.
-     * @param data data passed as raw bytes to oem
-     *
-     * Response function is IRadioResponse.sendOemRadioRequestRawResponse()
-     */
-    oneway sendOemRadioRequestRaw(int32_t serial, vec<uint8_t> data);
-
-    /*
-     * This request is reserved for OEM-specific uses. It passes strings back and forth.
-     *
-     * @param serial Serial number of request.
-     * @param data data passed as strings to oem
-     *
-     * Response function is IRadioResponse.sendOemRadioRequestStringsResponse()
-     */
-    oneway sendOemRadioRequestStrings(int32_t serial, vec<string> data);
-
-    /*
      * Indicates the current state of the screen. When the screen is off, the
      * Radio must notify the baseband to suppress certain notifications (eg,
      * signal strength and changes in LAC/CID or BID/SID/NID/latitude/longitude)
diff --git a/radio/1.0/IRadioIndication.hal b/radio/1.0/IRadioIndication.hal
index 81ac13a..0b95821 100644
--- a/radio/1.0/IRadioIndication.hal
+++ b/radio/1.0/IRadioIndication.hal
@@ -293,14 +293,6 @@
    oneway cdmaInfoRec(RadioIndicationType type, CdmaInformationRecords records);
 
    /*
-    * This is for OEM specific use.
-    *
-    * @param type Type of radio indication
-    * @param data data passed as raw bytes
-    */
-   oneway oemHookRaw(RadioIndicationType type, vec<uint8_t> data);
-
-   /*
     * Indicates that nework doesn't have in-band information, need to
     * play out-band tone.
     *
diff --git a/radio/1.0/IRadioResponse.hal b/radio/1.0/IRadioResponse.hal
index 637f697..11a1d03 100644
--- a/radio/1.0/IRadioResponse.hal
+++ b/radio/1.0/IRadioResponse.hal
@@ -923,30 +923,6 @@
 
     /*
      * @param info Response info struct containing response type, serial no. and error
-     * @param data data returned by oem
-     *
-     * Valid errors returned:
-     *   RadioError:NONE
-     *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:INVALID_ARGUMENTS
-     *   RadioError:OEM_ERROR_X
-     */
-    oneway sendOemRilRequestRawResponse(RadioResponseInfo info, vec<uint8_t> data);
-
-    /*
-     * @param info Response info struct containing response type, serial no. and error
-     * @param data data returned by oem
-     *
-     * Valid errors returned:
-     *   RadioError:NONE
-     *   RadioError:RADIO_NOT_AVAILABLE
-     *   RadioError:INVALID_ARGUMENTS
-     *   RadioError:OEM_ERROR_X
-     */
-    oneway sendOemRilRequestStringsResponse(RadioResponseInfo info, vec<string> data);
-
-    /*
-     * @param info Response info struct containing response type, serial no. and error
      *
      * Valid errors returned:
      *   RadioError:NONE
diff --git a/radio/Android.bp b/radio/Android.bp
index 33f70eb..8bda000 100644
--- a/radio/Android.bp
+++ b/radio/Android.bp
@@ -2,4 +2,5 @@
 subdirs = [
     "1.0",
     "1.0/vts/functional",
+    "deprecated/1.0",
 ]
diff --git a/radio/deprecated/1.0/Android.bp b/radio/deprecated/1.0/Android.bp
new file mode 100644
index 0000000..f8a9c64
--- /dev/null
+++ b/radio/deprecated/1.0/Android.bp
@@ -0,0 +1,75 @@
+// This file is autogenerated by hidl-gen. Do not edit manually.
+
+filegroup {
+    name: "android.hardware.radio.deprecated@1.0_hal",
+    srcs: [
+        "IOemHook.hal",
+        "IOemHookIndication.hal",
+        "IOemHookResponse.hal",
+    ],
+}
+
+genrule {
+    name: "android.hardware.radio.deprecated@1.0_genc++",
+    tools: ["hidl-gen"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.radio.deprecated@1.0",
+    srcs: [
+        ":android.hardware.radio.deprecated@1.0_hal",
+    ],
+    out: [
+        "android/hardware/radio/deprecated/1.0/OemHookAll.cpp",
+        "android/hardware/radio/deprecated/1.0/OemHookIndicationAll.cpp",
+        "android/hardware/radio/deprecated/1.0/OemHookResponseAll.cpp",
+    ],
+}
+
+genrule {
+    name: "android.hardware.radio.deprecated@1.0_genc++_headers",
+    tools: ["hidl-gen"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.radio.deprecated@1.0",
+    srcs: [
+        ":android.hardware.radio.deprecated@1.0_hal",
+    ],
+    out: [
+        "android/hardware/radio/deprecated/1.0/IOemHook.h",
+        "android/hardware/radio/deprecated/1.0/IHwOemHook.h",
+        "android/hardware/radio/deprecated/1.0/BnHwOemHook.h",
+        "android/hardware/radio/deprecated/1.0/BpHwOemHook.h",
+        "android/hardware/radio/deprecated/1.0/BsOemHook.h",
+        "android/hardware/radio/deprecated/1.0/IOemHookIndication.h",
+        "android/hardware/radio/deprecated/1.0/IHwOemHookIndication.h",
+        "android/hardware/radio/deprecated/1.0/BnHwOemHookIndication.h",
+        "android/hardware/radio/deprecated/1.0/BpHwOemHookIndication.h",
+        "android/hardware/radio/deprecated/1.0/BsOemHookIndication.h",
+        "android/hardware/radio/deprecated/1.0/IOemHookResponse.h",
+        "android/hardware/radio/deprecated/1.0/IHwOemHookResponse.h",
+        "android/hardware/radio/deprecated/1.0/BnHwOemHookResponse.h",
+        "android/hardware/radio/deprecated/1.0/BpHwOemHookResponse.h",
+        "android/hardware/radio/deprecated/1.0/BsOemHookResponse.h",
+    ],
+}
+
+cc_library_shared {
+    name: "android.hardware.radio.deprecated@1.0",
+    generated_sources: ["android.hardware.radio.deprecated@1.0_genc++"],
+    generated_headers: ["android.hardware.radio.deprecated@1.0_genc++_headers"],
+    export_generated_headers: ["android.hardware.radio.deprecated@1.0_genc++_headers"],
+    shared_libs: [
+        "libhidlbase",
+        "libhidltransport",
+        "libhwbinder",
+        "liblog",
+        "libutils",
+        "libcutils",
+        "android.hardware.radio@1.0",
+        "android.hidl.base@1.0",
+    ],
+    export_shared_lib_headers: [
+        "libhidlbase",
+        "libhidltransport",
+        "libhwbinder",
+        "libutils",
+        "android.hardware.radio@1.0",
+        "android.hidl.base@1.0",
+    ],
+}
diff --git a/radio/deprecated/1.0/Android.mk b/radio/deprecated/1.0/Android.mk
new file mode 100644
index 0000000..4cce633
--- /dev/null
+++ b/radio/deprecated/1.0/Android.mk
@@ -0,0 +1,162 @@
+# This file is autogenerated by hidl-gen. Do not edit manually.
+
+LOCAL_PATH := $(call my-dir)
+
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.radio.deprecated@1.0-java
+LOCAL_MODULE_CLASS := JAVA_LIBRARIES
+
+intermediates := $(call local-generated-sources-dir, COMMON)
+
+HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
+
+LOCAL_JAVA_LIBRARIES := \
+    android.hardware.radio@1.0-java \
+    android.hidl.base@1.0-java \
+
+
+#
+# Build IOemHook.hal
+#
+GEN := $(intermediates)/android/hardware/radio/deprecated/V1_0/IOemHook.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IOemHook.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IOemHookIndication.hal
+$(GEN): $(LOCAL_PATH)/IOemHookIndication.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IOemHookResponse.hal
+$(GEN): $(LOCAL_PATH)/IOemHookResponse.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.radio.deprecated@1.0::IOemHook
+
+$(GEN): $(LOCAL_PATH)/IOemHook.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IOemHookIndication.hal
+#
+GEN := $(intermediates)/android/hardware/radio/deprecated/V1_0/IOemHookIndication.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IOemHookIndication.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.radio.deprecated@1.0::IOemHookIndication
+
+$(GEN): $(LOCAL_PATH)/IOemHookIndication.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IOemHookResponse.hal
+#
+GEN := $(intermediates)/android/hardware/radio/deprecated/V1_0/IOemHookResponse.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IOemHookResponse.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.radio.deprecated@1.0::IOemHookResponse
+
+$(GEN): $(LOCAL_PATH)/IOemHookResponse.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+include $(BUILD_JAVA_LIBRARY)
+
+
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.radio.deprecated@1.0-java-static
+LOCAL_MODULE_CLASS := JAVA_LIBRARIES
+
+intermediates := $(call local-generated-sources-dir, COMMON)
+
+HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
+
+LOCAL_STATIC_JAVA_LIBRARIES := \
+    android.hardware.radio@1.0-java-static \
+    android.hidl.base@1.0-java-static \
+
+
+#
+# Build IOemHook.hal
+#
+GEN := $(intermediates)/android/hardware/radio/deprecated/V1_0/IOemHook.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IOemHook.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IOemHookIndication.hal
+$(GEN): $(LOCAL_PATH)/IOemHookIndication.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IOemHookResponse.hal
+$(GEN): $(LOCAL_PATH)/IOemHookResponse.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.radio.deprecated@1.0::IOemHook
+
+$(GEN): $(LOCAL_PATH)/IOemHook.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IOemHookIndication.hal
+#
+GEN := $(intermediates)/android/hardware/radio/deprecated/V1_0/IOemHookIndication.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IOemHookIndication.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.radio.deprecated@1.0::IOemHookIndication
+
+$(GEN): $(LOCAL_PATH)/IOemHookIndication.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IOemHookResponse.hal
+#
+GEN := $(intermediates)/android/hardware/radio/deprecated/V1_0/IOemHookResponse.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IOemHookResponse.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.radio.deprecated@1.0::IOemHookResponse
+
+$(GEN): $(LOCAL_PATH)/IOemHookResponse.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+include $(BUILD_STATIC_JAVA_LIBRARY)
+
+
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/radio/deprecated/1.0/IOemHook.hal b/radio/deprecated/1.0/IOemHook.hal
new file mode 100644
index 0000000..2b6db65
--- /dev/null
+++ b/radio/deprecated/1.0/IOemHook.hal
@@ -0,0 +1,57 @@
+/**
+ * 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.
+ */
+
+package android.hardware.radio.deprecated@1.0;
+
+import IOemHookResponse;
+import IOemHookIndication;
+
+/**
+ * This interface has APIs for OEM-specific use-cases.
+ * USE OF THIS INTERFACE IS DISCOURATED. IT IS PRESENT ONLY FOR BACKWARD COMPATIBILITY AND WILL BE
+ * REMOVED IN O (ATTEMPTING TO REMOVE IT IN O, BUT IF NOT IN O WILL BE REMOVED IN P).
+ * ALSO NOTE THAT FRAMEWORK EXPECTS THE SERVICE IMPLEMENTING THIS INTERFACE TO RESIDE
+ * IN THE SAME PROCESS AS IRADIO SERVICE.
+ */
+interface IOemHook {
+    /**
+     * Set response functions for oem hook requests & oem hook indications.
+     *
+     * @param oemHookResponse Object containing response functions
+     * @param oemHookIndication Object containing oem hook indications
+     */
+    setResponseFunctions(IOemHookResponse oemHookResponse, IOemHookIndication oemHookIndication);
+
+    /**
+     * This request passes raw byte arrays between framework and vendor code.
+     *
+     * @param serial Serial number of request.
+     * @param data data passed as raw bytes
+     *
+     * Response function is IOemHookResponse.sendRequestRawResponse()
+     */
+    oneway sendRequestRaw(int32_t serial, vec<uint8_t> data);
+
+    /**
+     * This request passes strings between framework and vendor code.
+     *
+     * @param serial Serial number of request.
+     * @param data data passed as strings
+     *
+     * Response function is IOemHookResponse.sendRequestStringsResponse()
+     */
+    oneway sendRequestStrings(int32_t serial, vec<string> data);
+};
\ No newline at end of file
diff --git a/radio/deprecated/1.0/IOemHookIndication.hal b/radio/deprecated/1.0/IOemHookIndication.hal
new file mode 100644
index 0000000..936779f
--- /dev/null
+++ b/radio/deprecated/1.0/IOemHookIndication.hal
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ */
+
+package android.hardware.radio.deprecated@1.0;
+
+import android.hardware.radio@1.0::types;
+
+/*
+ * Interface declaring unsolicited oem hook indications.
+ */
+interface IOemHookIndication {
+   /*
+    * This is for OEM specific use.
+    *
+    * @param type Type of radio indication
+    * @param data data passed as raw bytes
+    */
+   oneway oemHookRaw(RadioIndicationType type, vec<uint8_t> data);
+};
\ No newline at end of file
diff --git a/radio/deprecated/1.0/IOemHookResponse.hal b/radio/deprecated/1.0/IOemHookResponse.hal
new file mode 100644
index 0000000..4e49acc
--- /dev/null
+++ b/radio/deprecated/1.0/IOemHookResponse.hal
@@ -0,0 +1,50 @@
+/*
+ * 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.
+ */
+
+package android.hardware.radio.deprecated@1.0;
+
+import android.hardware.radio@1.0::types;
+
+/*
+ * Interface declaring response functions to solicited oem hook requests.
+ * Response functions defined in this interface are as per following convention:
+ * <xyz>Response is response to IOemHook.<xyz>
+ */
+interface IOemHookResponse {
+    /*
+     * @param info Response info struct containing response type, serial no. and error
+     * @param data data returned by oem
+     *
+     * Valid errors returned:
+     *   RadioError:NONE
+     *   RadioError:RADIO_NOT_AVAILABLE
+     *   RadioError:INVALID_ARGUMENTS
+     *   RadioError:OEM_ERROR_X
+     */
+    oneway sendRequestRawResponse(RadioResponseInfo info, vec<uint8_t> data);
+
+    /*
+     * @param info Response info struct containing response type, serial no. and error
+     * @param data data returned by oem
+     *
+     * Valid errors returned:
+     *   RadioError:NONE
+     *   RadioError:RADIO_NOT_AVAILABLE
+     *   RadioError:INVALID_ARGUMENTS
+     *   RadioError:OEM_ERROR_X
+     */
+    oneway sendRequestStringsResponse(RadioResponseInfo info, vec<string> data);
+};
\ No newline at end of file
diff --git a/wifi/1.0/Android.mk b/wifi/1.0/Android.mk
index 4476b14..fa6ef6c 100644
--- a/wifi/1.0/Android.mk
+++ b/wifi/1.0/Android.mk
@@ -796,25 +796,6 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (StaBackgroundScanBand)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/StaBackgroundScanBand.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.StaBackgroundScanBand
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
 # Build types.hal (StaBackgroundScanBucketEventReportSchemeMask)
 #
 GEN := $(intermediates)/android/hardware/wifi/V1_0/StaBackgroundScanBucketEventReportSchemeMask.java
@@ -1081,6 +1062,25 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
+# Build types.hal (WifiBand)
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_0/WifiBand.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.wifi@1.0::types.WifiBand
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
 # Build types.hal (WifiChannelInfo)
 #
 GEN := $(intermediates)/android/hardware/wifi/V1_0/WifiChannelInfo.java
@@ -2599,25 +2599,6 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (StaBackgroundScanBand)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/StaBackgroundScanBand.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.StaBackgroundScanBand
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
 # Build types.hal (StaBackgroundScanBucketEventReportSchemeMask)
 #
 GEN := $(intermediates)/android/hardware/wifi/V1_0/StaBackgroundScanBucketEventReportSchemeMask.java
@@ -2884,6 +2865,25 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
+# Build types.hal (WifiBand)
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_0/WifiBand.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.wifi@1.0::types.WifiBand
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
 # Build types.hal (WifiChannelInfo)
 #
 GEN := $(intermediates)/android/hardware/wifi/V1_0/WifiChannelInfo.java
diff --git a/wifi/1.0/IWifiApIface.hal b/wifi/1.0/IWifiApIface.hal
index aeca2cd..1f6ee7c 100644
--- a/wifi/1.0/IWifiApIface.hal
+++ b/wifi/1.0/IWifiApIface.hal
@@ -33,4 +33,21 @@
    *         |WifiStatusCode.FAILURE_IFACE_INVALID|
    */
   setCountryCode(int8_t[2] code) generates (WifiStatus status);
+
+  /**
+   * Used to query the list of valid frequencies (depending on country code set)
+   * for the provided band.
+   *
+   * @param band Band for which the frequency list is being generated.
+   * @return status WifiStatus of the operation.
+   *         Possible status codes:
+   *         |WifiStatusCode.SUCCESS|,
+   *         |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+   *         |WifiStatusCode.ERROR_NOT_SUPPORTED|,
+   *         |WifiStatusCode.ERROR_NOT_AVAILABLE|,
+   *         |WifiStatusCode.ERROR_UNKNOWN|
+   * @return frequencies vector of valid frequencies for the provided band.
+   */
+  getValidFrequenciesForBand(WifiBand band)
+      generates (WifiStatus status, vec<WifiChannelInMhz> frequencies);
 };
diff --git a/wifi/1.0/IWifiStaIface.hal b/wifi/1.0/IWifiStaIface.hal
index 96dc54a..43c3126 100644
--- a/wifi/1.0/IWifiStaIface.hal
+++ b/wifi/1.0/IWifiStaIface.hal
@@ -180,7 +180,6 @@
    * for the provided band. These channels may be specifed in the
    * |BackgroundScanBucketParameters.frequenciesInMhz| for a background scan
    * request.
-   * Must fail if |StaIfaceCapabilityMask.BACKGROUND_SCAN| is not set.
    *
    * @param band Band for which the frequency list is being generated.
    * @return status WifiStatus of the operation.
@@ -192,7 +191,7 @@
    *         |WifiStatusCode.ERROR_UNKNOWN|
    * @return frequencies vector of valid frequencies for the provided band.
    */
-  getValidFrequenciesForBackgroundScan(StaBackgroundScanBand band)
+  getValidFrequenciesForBand(WifiBand band)
       generates (WifiStatus status, vec<WifiChannelInMhz> frequencies);
 
   /**
diff --git a/wifi/1.0/default/hidl_callback_util.h b/wifi/1.0/default/hidl_callback_util.h
index a1c6819..7136279 100644
--- a/wifi/1.0/default/hidl_callback_util.h
+++ b/wifi/1.0/default/hidl_callback_util.h
@@ -82,14 +82,12 @@
     return true;
   }
 
-  const std::set<android::sp<CallbackType>> getCallbacks() {
-    return cb_set_;
-  }
+  const std::set<android::sp<CallbackType>> getCallbacks() { return cb_set_; }
 
   // Death notification for callbacks.
   void onObjectDeath(uint64_t cookie) {
-    CallbackType *cb = reinterpret_cast<CallbackType*>(cookie);
-    const auto& iter =  cb_set_.find(cb);
+    CallbackType* cb = reinterpret_cast<CallbackType*>(cookie);
+    const auto& iter = cb_set_.find(cb);
     if (iter == cb_set_.end()) {
       LOG(ERROR) << "Unknown callback death notification received";
       return;
diff --git a/wifi/1.0/default/hidl_struct_util.cpp b/wifi/1.0/default/hidl_struct_util.cpp
index 7dbc8eb..c7b8c41 100644
--- a/wifi/1.0/default/hidl_struct_util.cpp
+++ b/wifi/1.0/default/hidl_struct_util.cpp
@@ -306,21 +306,21 @@
   return true;
 }
 
-legacy_hal::wifi_band convertHidlGscanBandToLegacy(StaBackgroundScanBand band) {
+legacy_hal::wifi_band convertHidlWifiBandToLegacy(WifiBand band) {
   switch (band) {
-    case StaBackgroundScanBand::BAND_UNSPECIFIED:
+    case WifiBand::BAND_UNSPECIFIED:
       return legacy_hal::WIFI_BAND_UNSPECIFIED;
-    case StaBackgroundScanBand::BAND_24GHZ:
+    case WifiBand::BAND_24GHZ:
       return legacy_hal::WIFI_BAND_BG;
-    case StaBackgroundScanBand::BAND_5GHZ:
+    case WifiBand::BAND_5GHZ:
       return legacy_hal::WIFI_BAND_A;
-    case StaBackgroundScanBand::BAND_5GHZ_DFS:
+    case WifiBand::BAND_5GHZ_DFS:
       return legacy_hal::WIFI_BAND_A_DFS;
-    case StaBackgroundScanBand::BAND_5GHZ_WITH_DFS:
+    case WifiBand::BAND_5GHZ_WITH_DFS:
       return legacy_hal::WIFI_BAND_A_WITH_DFS;
-    case StaBackgroundScanBand::BAND_24GHZ_5GHZ:
+    case WifiBand::BAND_24GHZ_5GHZ:
       return legacy_hal::WIFI_BAND_ABG;
-    case StaBackgroundScanBand::BAND_24GHZ_5GHZ_WITH_DFS:
+    case WifiBand::BAND_24GHZ_5GHZ_WITH_DFS:
       return legacy_hal::WIFI_BAND_ABG_WITH_DFS;
   };
   CHECK(false);
diff --git a/wifi/1.0/default/hidl_struct_util.h b/wifi/1.0/default/hidl_struct_util.h
index 490dcae..41e97b3 100644
--- a/wifi/1.0/default/hidl_struct_util.h
+++ b/wifi/1.0/default/hidl_struct_util.h
@@ -60,7 +60,7 @@
 bool convertLegacyGscanCapabilitiesToHidl(
     const legacy_hal::wifi_gscan_capabilities& legacy_caps,
     StaBackgroundScanCapabilities* hidl_caps);
-legacy_hal::wifi_band convertHidlGscanBandToLegacy(StaBackgroundScanBand band);
+legacy_hal::wifi_band convertHidlWifiBandToLegacy(WifiBand band);
 bool convertHidlGscanParamsToLegacy(
     const StaBackgroundScanParameters& hidl_scan_params,
     legacy_hal::wifi_scan_cmd_params* legacy_scan_params);
diff --git a/wifi/1.0/default/wifi_ap_iface.cpp b/wifi/1.0/default/wifi_ap_iface.cpp
index 1a8b31d..e2beec2 100644
--- a/wifi/1.0/default/wifi_ap_iface.cpp
+++ b/wifi/1.0/default/wifi_ap_iface.cpp
@@ -17,6 +17,7 @@
 #include <android-base/logging.h>
 
 #include "hidl_return_util.h"
+#include "hidl_struct_util.h"
 #include "wifi_ap_iface.h"
 #include "wifi_status_util.h"
 
@@ -64,6 +65,15 @@
                          code);
 }
 
+Return<void> WifiApIface::getValidFrequenciesForBand(
+    WifiBand band, getValidFrequenciesForBand_cb hidl_status_cb) {
+  return validateAndCall(this,
+                         WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+                         &WifiApIface::getValidFrequenciesForBandInternal,
+                         hidl_status_cb,
+                         band);
+}
+
 std::pair<WifiStatus, std::string> WifiApIface::getNameInternal() {
   return {createWifiStatus(WifiStatusCode::SUCCESS), ifname_};
 }
@@ -79,6 +89,16 @@
   return createWifiStatusFromLegacyError(legacy_status);
 }
 
+std::pair<WifiStatus, std::vector<WifiChannelInMhz>>
+WifiApIface::getValidFrequenciesForBandInternal(WifiBand band) {
+  static_assert(sizeof(WifiChannelInMhz) == sizeof(uint32_t), "Size mismatch");
+  legacy_hal::wifi_error legacy_status;
+  std::vector<uint32_t> valid_frequencies;
+  std::tie(legacy_status, valid_frequencies) =
+      legacy_hal_.lock()->getValidFrequenciesForBand(
+          hidl_struct_util::convertHidlWifiBandToLegacy(band));
+  return {createWifiStatusFromLegacyError(legacy_status), valid_frequencies};
+}
 }  // namespace implementation
 }  // namespace V1_0
 }  // namespace wifi
diff --git a/wifi/1.0/default/wifi_ap_iface.h b/wifi/1.0/default/wifi_ap_iface.h
index 23d6435..efc168a 100644
--- a/wifi/1.0/default/wifi_ap_iface.h
+++ b/wifi/1.0/default/wifi_ap_iface.h
@@ -44,12 +44,16 @@
   Return<void> getType(getType_cb hidl_status_cb) override;
   Return<void> setCountryCode(const hidl_array<int8_t, 2>& code,
                               setCountryCode_cb hidl_status_cb) override;
+  Return<void> getValidFrequenciesForBand(
+      WifiBand band, getValidFrequenciesForBand_cb hidl_status_cb) override;
 
  private:
   // Corresponding worker functions for the HIDL methods.
   std::pair<WifiStatus, std::string> getNameInternal();
   std::pair<WifiStatus, IfaceType> getTypeInternal();
   WifiStatus setCountryCodeInternal(const std::array<int8_t, 2>& code);
+  std::pair<WifiStatus, std::vector<WifiChannelInMhz>>
+  getValidFrequenciesForBandInternal(WifiBand band);
 
   std::string ifname_;
   std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal_;
diff --git a/wifi/1.0/default/wifi_legacy_hal.cpp b/wifi/1.0/default/wifi_legacy_hal.cpp
index 7d58254..7390b65 100644
--- a/wifi/1.0/default/wifi_legacy_hal.cpp
+++ b/wifi/1.0/default/wifi_legacy_hal.cpp
@@ -562,7 +562,7 @@
 }
 
 std::pair<wifi_error, std::vector<uint32_t>>
-WifiLegacyHal::getValidFrequenciesForGscan(wifi_band band) {
+WifiLegacyHal::getValidFrequenciesForBand(wifi_band band) {
   static_assert(sizeof(uint32_t) >= sizeof(wifi_channel),
                 "Wifi Channel cannot be represented in output");
   std::vector<uint32_t> freqs;
diff --git a/wifi/1.0/default/wifi_legacy_hal.h b/wifi/1.0/default/wifi_legacy_hal.h
index ed020b0..c8fd5bd 100644
--- a/wifi/1.0/default/wifi_legacy_hal.h
+++ b/wifi/1.0/default/wifi_legacy_hal.h
@@ -175,7 +175,7 @@
       const on_gscan_results_callback& on_results_callback,
       const on_gscan_full_result_callback& on_full_result_callback);
   wifi_error stopGscan(wifi_request_id id);
-  std::pair<wifi_error, std::vector<uint32_t>> getValidFrequenciesForGscan(
+  std::pair<wifi_error, std::vector<uint32_t>> getValidFrequenciesForBand(
       wifi_band band);
   // Link layer stats functions.
   wifi_error enableLinkLayerStats(bool debug);
diff --git a/wifi/1.0/default/wifi_sta_iface.cpp b/wifi/1.0/default/wifi_sta_iface.cpp
index 55c9cf7..0c84102 100644
--- a/wifi/1.0/default/wifi_sta_iface.cpp
+++ b/wifi/1.0/default/wifi_sta_iface.cpp
@@ -106,15 +106,13 @@
                          hidl_status_cb);
 }
 
-Return<void> WifiStaIface::getValidFrequenciesForBackgroundScan(
-    StaBackgroundScanBand band,
-    getValidFrequenciesForBackgroundScan_cb hidl_status_cb) {
-  return validateAndCall(
-      this,
-      WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
-      &WifiStaIface::getValidFrequenciesForBackgroundScanInternal,
-      hidl_status_cb,
-      band);
+Return<void> WifiStaIface::getValidFrequenciesForBand(
+    WifiBand band, getValidFrequenciesForBand_cb hidl_status_cb) {
+  return validateAndCall(this,
+                         WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+                         &WifiStaIface::getValidFrequenciesForBandInternal,
+                         hidl_status_cb,
+                         band);
 }
 
 Return<void> WifiStaIface::startBackgroundScan(
@@ -363,14 +361,13 @@
 }
 
 std::pair<WifiStatus, std::vector<WifiChannelInMhz>>
-WifiStaIface::getValidFrequenciesForBackgroundScanInternal(
-    StaBackgroundScanBand band) {
+WifiStaIface::getValidFrequenciesForBandInternal(WifiBand band) {
   static_assert(sizeof(WifiChannelInMhz) == sizeof(uint32_t), "Size mismatch");
   legacy_hal::wifi_error legacy_status;
   std::vector<uint32_t> valid_frequencies;
   std::tie(legacy_status, valid_frequencies) =
-      legacy_hal_.lock()->getValidFrequenciesForGscan(
-          hidl_struct_util::convertHidlGscanBandToLegacy(band));
+      legacy_hal_.lock()->getValidFrequenciesForBand(
+          hidl_struct_util::convertHidlWifiBandToLegacy(band));
   return {createWifiStatusFromLegacyError(legacy_status), valid_frequencies};
 }
 
diff --git a/wifi/1.0/default/wifi_sta_iface.h b/wifi/1.0/default/wifi_sta_iface.h
index 5f0ffe9..08faa2f 100644
--- a/wifi/1.0/default/wifi_sta_iface.h
+++ b/wifi/1.0/default/wifi_sta_iface.h
@@ -57,9 +57,8 @@
       installApfPacketFilter_cb hidl_status_cb) override;
   Return<void> getBackgroundScanCapabilities(
       getBackgroundScanCapabilities_cb hidl_status_cb) override;
-  Return<void> getValidFrequenciesForBackgroundScan(
-      StaBackgroundScanBand band,
-      getValidFrequenciesForBackgroundScan_cb hidl_status_cb) override;
+  Return<void> getValidFrequenciesForBand(
+      WifiBand band, getValidFrequenciesForBand_cb hidl_status_cb) override;
   Return<void> startBackgroundScan(
       uint32_t cmd_id,
       const StaBackgroundScanParameters& params,
@@ -119,7 +118,7 @@
   std::pair<WifiStatus, StaBackgroundScanCapabilities>
   getBackgroundScanCapabilitiesInternal();
   std::pair<WifiStatus, std::vector<WifiChannelInMhz>>
-  getValidFrequenciesForBackgroundScanInternal(StaBackgroundScanBand band);
+  getValidFrequenciesForBandInternal(WifiBand band);
   WifiStatus startBackgroundScanInternal(
       uint32_t cmd_id, const StaBackgroundScanParameters& params);
   WifiStatus stopBackgroundScanInternal(uint32_t cmd_id);
diff --git a/wifi/1.0/types.hal b/wifi/1.0/types.hal
index 30e8943..a843ce8 100644
--- a/wifi/1.0/types.hal
+++ b/wifi/1.0/types.hal
@@ -210,6 +210,37 @@
 };
 
 /**
+ * Wifi bands defined in 80211 spec.
+ */
+enum WifiBand : uint32_t {
+  BAND_UNSPECIFIED = 0,
+  /**
+   * 2.4 GHz.
+   */
+  BAND_24GHZ = 1,
+  /**
+   * 5 GHz without DFS.
+   */
+  BAND_5GHZ = 2,
+  /**
+   * 5 GHz DFS only.
+   */
+  BAND_5GHZ_DFS = 4,
+  /**
+   * 5 GHz with DFS.
+   */
+  BAND_5GHZ_WITH_DFS = 6,
+  /**
+   * 2.4 GHz + 5 GHz; no DFS.
+   */
+  BAND_24GHZ_5GHZ = 3,
+  /**
+   * 2.4 GHz + 5 GHz with DFS
+   */
+  BAND_24GHZ_5GHZ_WITH_DFS = 7
+};
+
+/**
  * STA specific types.
  * TODO(b/32159498): Move to a separate sta_types.hal.
  */
@@ -251,37 +282,6 @@
 };
 
 /**
- * Bands that can be specified in Background scan requests.
- */
-enum StaBackgroundScanBand : uint32_t {
-  BAND_UNSPECIFIED = 0,
-  /**
-   * 2.4 GHz.
-   */
-  BAND_24GHZ = 1,
-  /**
-   * 5 GHz without DFS.
-   */
-  BAND_5GHZ = 2,
-  /**
-   * 5 GHz DFS only.
-   */
-  BAND_5GHZ_DFS = 4,
-  /**
-   * 5 GHz with DFS.
-   */
-  BAND_5GHZ_WITH_DFS = 6,
-  /**
-   * 2.4 GHz + 5 GHz; no DFS.
-   */
-  BAND_24GHZ_5GHZ = 3,
-  /**
-   * 2.4 GHz + 5 GHz with DFS
-   */
-  BAND_24GHZ_5GHZ_WITH_DFS = 7
-};
-
-/**
  * Mask of event reporting schemes that can be specified in background scan
  * requests.
  */
@@ -311,12 +311,13 @@
  */
 struct StaBackgroundScanBucketParameters {
   /**
-   * Bands to scan or 0 if frequencies list must be used instead.
+   * Bands to scan or |BAND_UNSPECIFIED| if frequencies list must be used
+   * instead.
    */
-  StaBackgroundScanBand band;
+  WifiBand band;
   /**
    * Channel frequencies (in Mhz) to scan if |band| is set to
-   * |UNSPECIFIED|.
+   * |BAND_UNSPECIFIED|.
    */
   vec<WifiChannelInMhz> frequencies;
   /**
@@ -1009,22 +1010,12 @@
   bool securityEnabledInNdp;
   /**
    * Specifies whether or not there is a ranging requirement in this discovery session.
-   * Ranging is only performed if all other match criteria with the peer are met.
+   * Ranging is only performed if all other match criteria with the peer are met. Ranging must
+   * be performed if both peers in the discovery session (publisher and subscriber) set this
+   * flag to true. Otherwise, if either peer sets this flag to false, ranging must not be performed
+   * and must not impact discovery decisions.
    * Note: specifying that ranging is required also implies that this device must automatically
    * accept ranging requests from peers.
-   *   Solicited Publisher + Passive Subscriber:
-   *     Publisher/Subscriber:
-   *     true/true: ranging performed.
-   *     true/false: subscriber doesn't require ranging (match if all other criteria met). I.e.
-   *                 publisher requiring range doesn't gate subscriber matching.
-   *     false/true: subscriber tries ranging but publisher refuses (no match).
-   *     false/false: ranging isn't attempted and doesn't impact match.
-   *   Unsolicited Publisher + Active Subscriber:
-   *     Publisher/Subscriber:
-   *     true/true: ranging performed.
-   *     true/false: publisher attempts ranging but subscriber doesn't allow - no match.
-   *     false/true: publisher doesn't attempt ranging, should not impact match.
-   *     false/false: ranging isn't attempted and doesn't impact match.
    * NAN Spec: Service Discovery Extension Attribute (SDEA) / Control / Ranging Require.
    */
   bool rangingRequired;
diff --git a/wifi/supplicant/1.0/ISupplicantStaNetwork.hal b/wifi/supplicant/1.0/ISupplicantStaNetwork.hal
index b16fb39..37e8d3f 100644
--- a/wifi/supplicant/1.0/ISupplicantStaNetwork.hal
+++ b/wifi/supplicant/1.0/ISupplicantStaNetwork.hal
@@ -434,9 +434,11 @@
   setEapClientCert(string path) generates (SupplicantStatus status);
 
   /**
-   * Set EAP private key file path for this network.
+   * Set EAP private key Id for this network.
+   * This is used if private key operations for EAP-TLS are performed
+   * using a smartcard.
    *
-   * @param path value to set.
+   * @param id value to set.
    * @return status Status of the operation.
    *         Possible status codes:
    *         |SupplicantStatusCode.SUCCESS|,
@@ -444,7 +446,7 @@
    *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
    *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
    */
-  setEapPrivateKey(string path) generates (SupplicantStatus status);
+  setEapPrivateKeyId(string id) generates (SupplicantStatus status);
 
   /**
    * Set EAP subject match for this network.
@@ -810,16 +812,16 @@
   getEapClientCert() generates (SupplicantStatus status, string path);
 
   /**
-   * Get EAP private key file path set for this network.
+   * Get EAP private key Id set for this network.
    *
    * @return status Status of the operation.
    *         Possible status codes:
    *         |SupplicantStatusCode.SUCCESS|,
    *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
    *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
-   * @return path value set.
+   * @return id value set.
    */
-  getEapPrivateKey() generates (SupplicantStatus status, string path);
+  getEapPrivateKeyId() generates (SupplicantStatus status, string id);
 
   /**
    * Get EAP subject match set for this network.