Merge "Rename the enums that are supposed to match OBD2 values to have an Obd2 prefix Rename the enums that contain a list of sensors and don't directly map to OBD2 to have a Diagnostic prefix" into oc-mr1-dev
diff --git a/broadcastradio/1.1/default/Tuner.cpp b/broadcastradio/1.1/default/Tuner.cpp
index 0a45208..2985d42 100644
--- a/broadcastradio/1.1/default/Tuner.cpp
+++ b/broadcastradio/1.1/default/Tuner.cpp
@@ -20,7 +20,7 @@
 #include "BroadcastRadio.h"
 #include "Tuner.h"
 
-#include <Utils.h>
+#include <broadcastradio-utils/Utils.h>
 #include <log/log.h>
 
 namespace android {
@@ -52,7 +52,8 @@
 Tuner::Tuner(const sp<V1_0::ITunerCallback>& callback)
     : mCallback(callback),
       mCallback1_1(ITunerCallback::castFrom(callback).withDefault(nullptr)),
-      mVirtualFm(make_fm_radio()) {
+      mVirtualFm(make_fm_radio()),
+      mIsAnalogForced(false) {
     // TODO (b/36864090): inject this data in a more elegant way
     setCompatibilityLevel(mCallback1_1 == nullptr ? 1 : 2);
 }
@@ -320,15 +321,14 @@
 
 Return<void> Tuner::isAnalogForced(isAnalogForced_cb _hidl_cb) {
     ALOGV("%s", __func__);
-    // TODO(b/36864090): implement
-    _hidl_cb(Result::INVALID_STATE, false);
+    _hidl_cb(Result::OK, mIsAnalogForced);
     return Void();
 }
 
-Return<Result> Tuner::setAnalogForced(bool isForced __unused) {
+Return<Result> Tuner::setAnalogForced(bool isForced) {
     ALOGV("%s", __func__);
-    // TODO(b/36864090): implement
-    return Result::INVALID_STATE;
+    mIsAnalogForced = isForced;
+    return Result::OK;
 }
 
 }  // namespace implementation
diff --git a/broadcastradio/1.1/default/Tuner.h b/broadcastradio/1.1/default/Tuner.h
index 2ab4f40..3efbd09 100644
--- a/broadcastradio/1.1/default/Tuner.h
+++ b/broadcastradio/1.1/default/Tuner.h
@@ -18,9 +18,9 @@
 
 #include "VirtualRadio.h"
 
-#include <WorkerThread.h>
 #include <android/hardware/broadcastradio/1.1/ITuner.h>
 #include <android/hardware/broadcastradio/1.1/ITunerCallback.h>
+#include <broadcastradio-utils/WorkerThread.h>
 
 namespace android {
 namespace hardware {
@@ -65,6 +65,7 @@
     bool mIsTuneCompleted = false;
     ProgramSelector mCurrentProgram = {};
     ProgramInfo mCurrentProgramInfo = {};
+    std::atomic<bool> mIsAnalogForced;
 
     void tuneInternalLocked(const ProgramSelector& sel);
     bool isFmLocked();  // TODO(b/36864090): make it generic, not FM only
diff --git a/broadcastradio/1.1/default/VirtualProgram.cpp b/broadcastradio/1.1/default/VirtualProgram.cpp
index 1f3b693..4c6b3b1 100644
--- a/broadcastradio/1.1/default/VirtualProgram.cpp
+++ b/broadcastradio/1.1/default/VirtualProgram.cpp
@@ -15,7 +15,7 @@
  */
 #include "VirtualProgram.h"
 
-#include <Utils.h>
+#include <broadcastradio-utils/Utils.h>
 
 #include "resources.h"
 
diff --git a/broadcastradio/1.1/default/VirtualRadio.cpp b/broadcastradio/1.1/default/VirtualRadio.cpp
index 89b2b0a..692e7bc 100644
--- a/broadcastradio/1.1/default/VirtualRadio.cpp
+++ b/broadcastradio/1.1/default/VirtualRadio.cpp
@@ -15,7 +15,7 @@
  */
 #include "VirtualRadio.h"
 
-#include <Utils.h>
+#include <broadcastradio-utils/Utils.h>
 
 namespace android {
 namespace hardware {
diff --git a/broadcastradio/1.1/tests/WorkerThread_test.cpp b/broadcastradio/1.1/tests/WorkerThread_test.cpp
index a0e0ebb..ed36de3 100644
--- a/broadcastradio/1.1/tests/WorkerThread_test.cpp
+++ b/broadcastradio/1.1/tests/WorkerThread_test.cpp
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include <WorkerThread.h>
+#include <broadcastradio-utils/WorkerThread.h>
 #include <gtest/gtest.h>
 
 namespace {
diff --git a/broadcastradio/1.1/utils/Android.bp b/broadcastradio/1.1/utils/Android.bp
index 73c6680..e80d133 100644
--- a/broadcastradio/1.1/utils/Android.bp
+++ b/broadcastradio/1.1/utils/Android.bp
@@ -27,7 +27,7 @@
         "Utils.cpp",
         "WorkerThread.cpp",
     ],
-    export_include_dirs: ["."],
+    export_include_dirs: ["include"],
     shared_libs: [
         "android.hardware.broadcastradio@1.1",
     ],
diff --git a/broadcastradio/1.1/utils/Utils.cpp b/broadcastradio/1.1/utils/Utils.cpp
index f8a4479..8bb7691 100644
--- a/broadcastradio/1.1/utils/Utils.cpp
+++ b/broadcastradio/1.1/utils/Utils.cpp
@@ -16,7 +16,7 @@
 #define LOG_TAG "BroadcastRadioDefault.utils"
 //#define LOG_NDEBUG 0
 
-#include "Utils.h"
+#include <broadcastradio-utils/Utils.h>
 
 #include <log/log.h>
 
@@ -208,6 +208,26 @@
 
 }  // namespace utils
 }  // namespace V1_1
+
+namespace V1_0 {
+
+bool operator==(const BandConfig& l, const BandConfig& r) {
+    if (l.type != r.type) return false;
+    if (l.antennaConnected != r.antennaConnected) return false;
+    if (l.lowerLimit != r.lowerLimit) return false;
+    if (l.upperLimit != r.upperLimit) return false;
+    if (l.spacings != r.spacings) return false;
+    if (l.type == Band::AM || l.type == Band::AM_HD) {
+        return l.ext.am == r.ext.am;
+    } else if (l.type == Band::FM || l.type == Band::FM_HD) {
+        return l.ext.fm == r.ext.fm;
+    } else {
+        ALOGW("Unsupported band config type: %s", toString(l.type).c_str());
+        return false;
+    }
+}
+
+}  // namespace V1_0
 }  // namespace broadcastradio
 }  // namespace hardware
 }  // namespace android
diff --git a/broadcastradio/1.1/utils/WorkerThread.cpp b/broadcastradio/1.1/utils/WorkerThread.cpp
index a3ceaa1..bfcbb39 100644
--- a/broadcastradio/1.1/utils/WorkerThread.cpp
+++ b/broadcastradio/1.1/utils/WorkerThread.cpp
@@ -17,7 +17,7 @@
 #define LOG_TAG "WorkerThread"
 //#define LOG_NDEBUG 0
 
-#include "WorkerThread.h"
+#include <broadcastradio-utils/WorkerThread.h>
 
 #include <log/log.h>
 
diff --git a/broadcastradio/1.1/utils/Utils.h b/broadcastradio/1.1/utils/include/broadcastradio-utils/Utils.h
similarity index 95%
rename from broadcastradio/1.1/utils/Utils.h
rename to broadcastradio/1.1/utils/include/broadcastradio-utils/Utils.h
index cd86ffa..a7da9fe 100644
--- a/broadcastradio/1.1/utils/Utils.h
+++ b/broadcastradio/1.1/utils/include/broadcastradio-utils/Utils.h
@@ -66,6 +66,13 @@
 
 }  // namespace utils
 }  // namespace V1_1
+
+namespace V1_0 {
+
+bool operator==(const BandConfig& l, const BandConfig& r);
+
+}  // namespace V1_0
+
 }  // namespace broadcastradio
 }  // namespace hardware
 }  // namespace android
diff --git a/broadcastradio/1.1/utils/WorkerThread.h b/broadcastradio/1.1/utils/include/broadcastradio-utils/WorkerThread.h
similarity index 100%
rename from broadcastradio/1.1/utils/WorkerThread.h
rename to broadcastradio/1.1/utils/include/broadcastradio-utils/WorkerThread.h
diff --git a/broadcastradio/1.1/vts/functional/Android.bp b/broadcastradio/1.1/vts/functional/Android.bp
index c136019..6e5c84c 100644
--- a/broadcastradio/1.1/vts/functional/Android.bp
+++ b/broadcastradio/1.1/vts/functional/Android.bp
@@ -31,7 +31,8 @@
     ],
     static_libs: [
         "VtsHalHidlTargetTestBase",
-        "broadcastradio-vts-call-barrier",
+        "android.hardware.broadcastradio@1.1-utils-lib",
+        "android.hardware.broadcastradio@1.1-vts-utils-lib",
         "libgmock",
     ],
     cflags: [
@@ -40,16 +41,3 @@
         "-g",
     ],
 }
-
-cc_library_static {
-    name: "broadcastradio-vts-call-barrier",
-    srcs: [
-        "call-barrier.cpp",
-    ],
-    export_include_dirs: ["."],
-    cflags: [
-        "-Wall",
-        "-Wextra",
-        "-Werror",
-    ],
-}
diff --git a/broadcastradio/1.1/vts/functional/VtsHalBroadcastradioV1_1TargetTest.cpp b/broadcastradio/1.1/vts/functional/VtsHalBroadcastradioV1_1TargetTest.cpp
index d20452b..bd2e0a7 100644
--- a/broadcastradio/1.1/vts/functional/VtsHalBroadcastradioV1_1TargetTest.cpp
+++ b/broadcastradio/1.1/vts/functional/VtsHalBroadcastradioV1_1TargetTest.cpp
@@ -17,8 +17,15 @@
 #define LOG_TAG "broadcastradio.vts"
 
 #include <VtsHalHidlTargetTestBase.h>
+#include <android/hardware/broadcastradio/1.1/IBroadcastRadio.h>
+#include <android/hardware/broadcastradio/1.1/IBroadcastRadioFactory.h>
+#include <android/hardware/broadcastradio/1.1/ITuner.h>
+#include <android/hardware/broadcastradio/1.1/ITunerCallback.h>
+#include <android/hardware/broadcastradio/1.1/types.h>
 #include <android-base/logging.h>
-#include <call-barrier.h>
+#include <broadcastradio-utils/Utils.h>
+#include <broadcastradio-vts-utils/call-barrier.h>
+#include <broadcastradio-vts-utils/mock-timeout.h>
 #include <cutils/native_handle.h>
 #include <cutils/properties.h>
 #include <gmock/gmock.h>
@@ -27,14 +34,6 @@
 
 #include <chrono>
 
-#include <android/hardware/broadcastradio/1.1/IBroadcastRadio.h>
-#include <android/hardware/broadcastradio/1.1/IBroadcastRadioFactory.h>
-#include <android/hardware/broadcastradio/1.1/ITuner.h>
-#include <android/hardware/broadcastradio/1.1/ITunerCallback.h>
-#include <android/hardware/broadcastradio/1.1/types.h>
-
-#include "mock-timeout.h"
-
 namespace android {
 namespace hardware {
 namespace broadcastradio {
@@ -57,6 +56,9 @@
 using V1_0::MetadataKey;
 using V1_0::MetadataType;
 
+using std::chrono::steady_clock;
+using std::this_thread::sleep_for;
+
 static constexpr auto kConfigTimeout = 10s;
 static constexpr auto kConnectModuleTimeout = 1s;
 static constexpr auto kTuneTimeout = 30s;
@@ -91,10 +93,8 @@
     virtual void SetUp() override;
     virtual void TearDown() override;
 
-    // TODO(b/36864490): check all bands for good test conditions (ie. FM is more likely to have
-    // any stations on the list, so don't pick AM blindly).
-    bool openTuner(unsigned band);
-    const BandConfig& getBand(unsigned idx);
+    bool openTuner();
+    bool nextBand();
     bool getProgramList(std::function<void(const hidl_vec<ProgramInfo>& list)> cb);
 
     Class radioClass;
@@ -105,9 +105,33 @@
     sp<TunerCallbackMock> mCallback = new TunerCallbackMock();
 
    private:
+    const BandConfig& getBand(unsigned idx);
+
+    unsigned currentBandIndex = 0;
     hidl_vec<BandConfig> mBands;
 };
 
+/**
+ * Clears strong pointer and waits until the object gets destroyed.
+ *
+ * @param ptr The pointer to get cleared.
+ * @param timeout Time to wait for other references.
+ */
+template <typename T>
+static void clearAndWait(sp<T>& ptr, std::chrono::milliseconds timeout) {
+    wp<T> wptr = ptr;
+    ptr.clear();
+    auto limit = steady_clock::now() + timeout;
+    while (wptr.promote() != nullptr) {
+        constexpr auto step = 10ms;
+        if (steady_clock::now() + step > limit) {
+            FAIL() << "Pointer was not released within timeout";
+            break;
+        }
+        sleep_for(step);
+    }
+}
+
 void BroadcastRadioHalTest::SetUp() {
     radioClass = GetParam();
 
@@ -153,10 +177,10 @@
 void BroadcastRadioHalTest::TearDown() {
     mTuner.clear();
     mRadioModule.clear();
-    // TODO(b/36864490): wait (with timeout) until mCallback has only one reference
+    clearAndWait(mCallback, 1s);
 }
 
-bool BroadcastRadioHalTest::openTuner(unsigned band) {
+bool BroadcastRadioHalTest::openTuner() {
     EXPECT_EQ(nullptr, mTuner.get());
 
     if (radioClass == Class::AM_FM) {
@@ -169,7 +193,8 @@
         if (result != Result::OK) return;
         mTuner = ITuner::castFrom(tuner);
     };
-    auto hidlResult = mRadioModule->openTuner(getBand(band), true, mCallback, openCb);
+    currentBandIndex = 0;
+    auto hidlResult = mRadioModule->openTuner(getBand(0), true, mCallback, openCb);
 
     EXPECT_TRUE(hidlResult.isOk());
     EXPECT_EQ(Result::OK, halResult);
@@ -210,6 +235,21 @@
     return band;
 }
 
+bool BroadcastRadioHalTest::nextBand() {
+    if (currentBandIndex + 1 >= mBands.size()) return false;
+    currentBandIndex++;
+
+    BandConfig bandCb;
+    EXPECT_TIMEOUT_CALL(*mCallback, configChange, Result::OK, _)
+        .WillOnce(DoAll(SaveArg<1>(&bandCb), testing::Return(ByMove(Void()))));
+    auto hidlResult = mTuner->setConfiguration(getBand(currentBandIndex));
+    EXPECT_EQ(Result::OK, hidlResult);
+    EXPECT_TIMEOUT_CALL_WAIT(*mCallback, configChange, kConfigTimeout);
+    EXPECT_EQ(getBand(currentBandIndex), bandCb);
+
+    return true;
+}
+
 bool BroadcastRadioHalTest::getProgramList(
     std::function<void(const hidl_vec<ProgramInfo>& list)> cb) {
     ProgramListResult getListResult = ProgramListResult::NOT_INITIALIZED;
@@ -244,11 +284,7 @@
         EXPECT_EQ(ProgramListResult::OK, getListResult);
     }
 
-    if (isListEmpty) {
-        printSkipped("Program list is empty.");
-        return false;
-    }
-    return true;
+    return !isListEmpty;
 }
 
 /**
@@ -263,13 +299,13 @@
  */
 TEST_P(BroadcastRadioHalTest, OpenTunerTwice) {
     if (skipped) return;
-    ASSERT_TRUE(openTuner(0));
 
-    Result halResult = Result::NOT_INITIALIZED;
-    auto openCb = [&](Result result, const sp<V1_0::ITuner>&) { halResult = result; };
-    auto hidlResult = mRadioModule->openTuner(getBand(0), true, mCallback, openCb);
-    ASSERT_TRUE(hidlResult.isOk());
-    ASSERT_EQ(Result::OK, halResult);
+    ASSERT_TRUE(openTuner());
+
+    auto secondTuner = mTuner;
+    mTuner.clear();
+
+    ASSERT_TRUE(openTuner());
 }
 
 /**
@@ -283,17 +319,25 @@
  */
 TEST_P(BroadcastRadioHalTest, TuneFromProgramList) {
     if (skipped) return;
-    ASSERT_TRUE(openTuner(0));
+    ASSERT_TRUE(openTuner());
 
     ProgramInfo firstProgram;
-    auto getCb = [&](const hidl_vec<ProgramInfo>& list) {
-        // don't copy the whole list out, it might be heavy
-        firstProgram = list[0];
-    };
-    if (!getProgramList(getCb)) return;
+    bool foundAny = false;
+    do {
+        auto getCb = [&](const hidl_vec<ProgramInfo>& list) {
+            // don't copy the whole list out, it might be heavy
+            firstProgram = list[0];
+        };
+        if (getProgramList(getCb)) foundAny = true;
+    } while (nextBand());
+    if (HasFailure()) return;
+    if (!foundAny) {
+        printSkipped("Program list is empty.");
+        return;
+    }
 
     ProgramSelector selCb;
-    EXPECT_CALL(*mCallback, tuneComplete(_, _));
+    EXPECT_CALL(*mCallback, tuneComplete(_, _)).Times(0);
     EXPECT_TIMEOUT_CALL(*mCallback, tuneComplete_1_1, Result::OK, _)
         .WillOnce(DoAll(SaveArg<1>(&selCb), testing::Return(ByMove(Void()))));
     auto tuneResult = mTuner->tune_1_1(firstProgram.selector);
@@ -304,7 +348,7 @@
 
 TEST_P(BroadcastRadioHalTest, CancelAnnouncement) {
     if (skipped) return;
-    ASSERT_TRUE(openTuner(0));
+    ASSERT_TRUE(openTuner());
 
     auto hidlResult = mTuner->cancelAnnouncement();
     EXPECT_EQ(Result::OK, hidlResult);
@@ -336,23 +380,24 @@
  */
 TEST_P(BroadcastRadioHalTest, OobImagesOnly) {
     if (skipped) return;
-    ASSERT_TRUE(openTuner(0));
+    ASSERT_TRUE(openTuner());
 
     std::vector<int> imageIds;
 
-    ProgramInfo firstProgram;
-    auto getCb = [&](const hidl_vec<ProgramInfo>& list) {
-        for (auto&& program : list) {
-            for (auto&& entry : program.base.metadata) {
-                EXPECT_NE(MetadataType::RAW, entry.type);
-                if (entry.key != MetadataKey::ICON && entry.key != MetadataKey::ART) continue;
-                EXPECT_NE(0, entry.intValue);
-                EXPECT_EQ(0u, entry.rawValue.size());
-                if (entry.intValue != 0) imageIds.push_back(entry.intValue);
+    do {
+        auto getCb = [&](const hidl_vec<ProgramInfo>& list) {
+            for (auto&& program : list) {
+                for (auto&& entry : program.base.metadata) {
+                    EXPECT_NE(MetadataType::RAW, entry.type);
+                    if (entry.key != MetadataKey::ICON && entry.key != MetadataKey::ART) continue;
+                    EXPECT_NE(0, entry.intValue);
+                    EXPECT_EQ(0u, entry.rawValue.size());
+                    if (entry.intValue != 0) imageIds.push_back(entry.intValue);
+                }
             }
-        }
-    };
-    if (!getProgramList(getCb)) return;
+        };
+        getProgramList(getCb);
+    } while (nextBand());
 
     if (imageIds.size() == 0) {
         printSkipped("No images found");
@@ -371,6 +416,52 @@
     }
 }
 
+/**
+ * Test AnalogForced switch.
+ *
+ * Verifies that:
+ * - setAnalogForced results either with INVALID_STATE, or isAnalogForced replying the same
+ */
+TEST_P(BroadcastRadioHalTest, AnalogForcedSwitch) {
+    if (skipped) return;
+    ASSERT_TRUE(openTuner());
+
+    bool forced;
+    Result halIsResult;
+    auto isCb = [&](Result result, bool isForced) {
+        halIsResult = result;
+        forced = isForced;
+    };
+
+    // set analog mode
+    auto setResult = mTuner->setAnalogForced(true);
+    ASSERT_TRUE(setResult.isOk());
+    if (Result::INVALID_STATE == setResult) {
+        // if setter fails, getter should fail too - it means the switch is not supported at all
+        auto isResult = mTuner->isAnalogForced(isCb);
+        ASSERT_TRUE(isResult.isOk());
+        EXPECT_EQ(Result::INVALID_STATE, halIsResult);
+        return;
+    }
+    ASSERT_EQ(Result::OK, setResult);
+
+    // check, if it's analog
+    auto isResult = mTuner->isAnalogForced(isCb);
+    ASSERT_TRUE(isResult.isOk());
+    EXPECT_EQ(Result::OK, halIsResult);
+    ASSERT_TRUE(forced);
+
+    // set digital mode
+    setResult = mTuner->setAnalogForced(false);
+    ASSERT_EQ(Result::OK, setResult);
+
+    // check, if it's digital
+    isResult = mTuner->isAnalogForced(isCb);
+    ASSERT_TRUE(isResult.isOk());
+    EXPECT_EQ(Result::OK, halIsResult);
+    ASSERT_FALSE(forced);
+}
+
 INSTANTIATE_TEST_CASE_P(BroadcastRadioHalTestCases, BroadcastRadioHalTest,
                         ::testing::Values(Class::AM_FM, Class::SAT, Class::DT));
 
diff --git a/broadcastradio/1.1/vts/utils/Android.bp b/broadcastradio/1.1/vts/utils/Android.bp
new file mode 100644
index 0000000..0c7e2a4
--- /dev/null
+++ b/broadcastradio/1.1/vts/utils/Android.bp
@@ -0,0 +1,28 @@
+//
+// 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_library_static {
+    name: "android.hardware.broadcastradio@1.1-vts-utils-lib",
+    srcs: [
+        "call-barrier.cpp",
+    ],
+    export_include_dirs: ["include"],
+    cflags: [
+        "-Wall",
+        "-Wextra",
+        "-Werror",
+    ],
+}
diff --git a/broadcastradio/1.1/vts/functional/call-barrier.cpp b/broadcastradio/1.1/vts/utils/call-barrier.cpp
similarity index 95%
rename from broadcastradio/1.1/vts/functional/call-barrier.cpp
rename to broadcastradio/1.1/vts/utils/call-barrier.cpp
index fede297..d8c4716 100644
--- a/broadcastradio/1.1/vts/functional/call-barrier.cpp
+++ b/broadcastradio/1.1/vts/utils/call-barrier.cpp
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#include "call-barrier.h"
+#include <broadcastradio-vts-utils/call-barrier.h>
 
 namespace android {
 namespace hardware {
diff --git a/broadcastradio/1.1/vts/functional/call-barrier.h b/broadcastradio/1.1/vts/utils/include/broadcastradio-vts-utils/call-barrier.h
similarity index 100%
rename from broadcastradio/1.1/vts/functional/call-barrier.h
rename to broadcastradio/1.1/vts/utils/include/broadcastradio-vts-utils/call-barrier.h
diff --git a/broadcastradio/1.1/vts/functional/mock-timeout.h b/broadcastradio/1.1/vts/utils/include/broadcastradio-vts-utils/mock-timeout.h
similarity index 100%
rename from broadcastradio/1.1/vts/functional/mock-timeout.h
rename to broadcastradio/1.1/vts/utils/include/broadcastradio-vts-utils/mock-timeout.h
diff --git a/broadcastradio/Android.bp b/broadcastradio/Android.bp
index a5ad5e7..8c65bf6 100644
--- a/broadcastradio/Android.bp
+++ b/broadcastradio/Android.bp
@@ -8,4 +8,5 @@
     "1.1/tests",
     "1.1/utils",
     "1.1/vts/functional",
+    "1.1/vts/utils",
 ]
diff --git a/camera/device/1.0/default/OWNERS b/camera/device/1.0/default/OWNERS
new file mode 100644
index 0000000..18acfee
--- /dev/null
+++ b/camera/device/1.0/default/OWNERS
@@ -0,0 +1,6 @@
+cychen@google.com
+epeev@google.com
+etalvala@google.com
+shuzhenwang@google.com
+yinchiayeh@google.com
+zhijunhe@google.com
diff --git a/camera/device/3.2/default/CameraDeviceSession.cpp b/camera/device/3.2/default/CameraDeviceSession.cpp
index f33adf8..fcd134f 100644
--- a/camera/device/3.2/default/CameraDeviceSession.cpp
+++ b/camera/device/3.2/default/CameraDeviceSession.cpp
@@ -923,6 +923,7 @@
         status = Status::INTERNAL_ERROR;
     } else {
         convertToHidl(stream_list, &outStreams);
+        mFirstRequest = true;
     }
 
     _hidl_cb(status, outStreams);
@@ -1022,7 +1023,13 @@
 
     if (!converted) {
         ALOGE("%s: capture request settings metadata is corrupt!", __FUNCTION__);
-        return Status::INTERNAL_ERROR;
+        return Status::ILLEGAL_ARGUMENT;
+    }
+
+    if (mFirstRequest && halRequest.settings == nullptr) {
+        ALOGE("%s: capture request settings must not be null for first request!",
+                __FUNCTION__);
+        return Status::ILLEGAL_ARGUMENT;
     }
 
     hidl_vec<buffer_handle_t*> allBufPtrs;
@@ -1031,6 +1038,12 @@
             request.inputBuffer.bufferId != 0);
     size_t numOutputBufs = request.outputBuffers.size();
     size_t numBufs = numOutputBufs + (hasInputBuf ? 1 : 0);
+
+    if (numOutputBufs == 0) {
+        ALOGE("%s: capture request must have at least one output buffer!", __FUNCTION__);
+        return Status::ILLEGAL_ARGUMENT;
+    }
+
     status = importRequest(request, allBufPtrs, allFences);
     if (status != Status::OK) {
         return status;
@@ -1102,6 +1115,7 @@
         return Status::INTERNAL_ERROR;
     }
 
+    mFirstRequest = false;
     return Status::OK;
 }
 
diff --git a/camera/device/3.2/default/CameraDeviceSession.h b/camera/device/3.2/default/CameraDeviceSession.h
index fb3fc02..2fe189f 100644
--- a/camera/device/3.2/default/CameraDeviceSession.h
+++ b/camera/device/3.2/default/CameraDeviceSession.h
@@ -148,6 +148,7 @@
     static HandleImporter sHandleImporter;
 
     bool mInitFail;
+    bool mFirstRequest = false;
 
     common::V1_0::helper::CameraMetadata mDeviceInfo;
 
diff --git a/camera/device/3.2/default/OWNERS b/camera/device/3.2/default/OWNERS
new file mode 100644
index 0000000..18acfee
--- /dev/null
+++ b/camera/device/3.2/default/OWNERS
@@ -0,0 +1,6 @@
+cychen@google.com
+epeev@google.com
+etalvala@google.com
+shuzhenwang@google.com
+yinchiayeh@google.com
+zhijunhe@google.com
diff --git a/camera/provider/2.4/default/OWNERS b/camera/provider/2.4/default/OWNERS
new file mode 100644
index 0000000..18acfee
--- /dev/null
+++ b/camera/provider/2.4/default/OWNERS
@@ -0,0 +1,6 @@
+cychen@google.com
+epeev@google.com
+etalvala@google.com
+shuzhenwang@google.com
+yinchiayeh@google.com
+zhijunhe@google.com
diff --git a/camera/provider/2.4/vts/OWNERS b/camera/provider/2.4/vts/OWNERS
new file mode 100644
index 0000000..003fe71
--- /dev/null
+++ b/camera/provider/2.4/vts/OWNERS
@@ -0,0 +1,11 @@
+# Camera team
+cychen@google.com
+epeev@google.com
+etalvala@google.com
+shuzhenwang@google.com
+yinchiayeh@google.com
+zhijunhe@google.com
+
+# VTS team
+yim@google.com
+zhuoyao@google.com
diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
index 5ece765..c9f03b0 100644
--- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
+++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
@@ -132,22 +132,34 @@
     const char *kHAL1_0 = "1.0";
 
     bool matchDeviceName(const hidl_string& deviceName,
-            const hidl_string &providerType, std::smatch& sm) {
+            const hidl_string &providerType,
+            std::string* deviceVersion,
+            std::string* cameraId) {
         ::android::String8 pattern;
         pattern.appendFormat(kDeviceNameRE, providerType.c_str());
         std::regex e(pattern.string());
         std::string deviceNameStd(deviceName.c_str());
-        return std::regex_match(deviceNameStd, sm, e);
+        std::smatch sm;
+        if (std::regex_match(deviceNameStd, sm, e)) {
+            if (deviceVersion != nullptr) {
+                *deviceVersion = sm[1];
+            }
+            if (cameraId != nullptr) {
+                *cameraId = sm[2];
+            }
+            return true;
+        }
+        return false;
     }
 
     int getCameraDeviceVersion(const hidl_string& deviceName,
             const hidl_string &providerType) {
-        std::smatch sm;
-        bool match = matchDeviceName(deviceName, providerType, sm);
+        std::string version;
+        bool match = matchDeviceName(deviceName, providerType, &version, nullptr);
         if (!match) {
             return -1;
         }
-        std::string version = sm[1].str();
+
         if (version.compare(kHAL3_2) == 0) {
             // maybe switched to 3.4 or define the hidl version enumlater
             return CAMERA_DEVICE_API_VERSION_3_2;
@@ -1072,6 +1084,9 @@
     auto status = mProvider->setCallback(cb);
     ASSERT_TRUE(status.isOk());
     ASSERT_EQ(Status::OK, status);
+    status = mProvider->setCallback(nullptr);
+    ASSERT_TRUE(status.isOk());
+    ASSERT_EQ(Status::OK, status);
 }
 
 // Test if ICameraProvider::getCameraDeviceInterface returns Status::OK and non-null device
@@ -2717,6 +2732,9 @@
                 // Empty settings should be supported after the first call
                 // for repeating requests.
                 request.settings.setToExternal(nullptr, 0, true);
+                // The buffer has been registered to HAL by bufferId, so per
+                // API contract we should send a null handle for this buffer
+                request.outputBuffers[0].buffer = nullptr;
                 mInflightMap.clear();
                 inflightReq = {1, false, supportsPartialResults, partialResultCount, resultQueue};
                 mInflightMap.add(request.frameNumber, &inflightReq);
@@ -2800,7 +2818,7 @@
                     numRequestProcessed = n;
                 });
             ASSERT_TRUE(ret.isOk());
-            ASSERT_EQ(Status::INTERNAL_ERROR, status);
+            ASSERT_EQ(Status::ILLEGAL_ARGUMENT, status);
             ASSERT_EQ(numRequestProcessed, 0u);
 
             ret = session->close();
@@ -2854,7 +2872,7 @@
                     numRequestProcessed = n;
                 });
             ASSERT_TRUE(ret.isOk());
-            ASSERT_EQ(Status::INTERNAL_ERROR, status);
+            ASSERT_EQ(Status::ILLEGAL_ARGUMENT, status);
             ASSERT_EQ(numRequestProcessed, 0u);
 
             ret = session->close();
diff --git a/current.txt b/current.txt
index 67f1169..cc89c69 100644
--- a/current.txt
+++ b/current.txt
@@ -220,4 +220,4 @@
 c3354ab0d381a236c12dc486ad4b6bec28c979d26748b4661f12ede36f392808 android.hardware.wifi.offload@1.0::IOffloadCallback
 b18caefefcc765092412285d776234fcf213b73bdf07ae1b67a5f71b2d2464e3 android.hardware.wifi.offload@1.0::types
 c26473e2e4a00af43e28a0ddf9002e5062a7d0940429e5efb6e5513a8abcb75c android.hardware.wifi@1.1::IWifi
-bfcf4856c7b6c66ebc56785ed3e5d181b7be859c2add672497a843b024518737 android.hardware.wifi@1.1::IWifiChip
+b056e1defab4071584214584057d0bc73a613081bf1152590549649d4582c13c android.hardware.wifi@1.1::IWifiChip
diff --git a/radio/1.1/vts/functional/radio_hidl_hal_api.cpp b/radio/1.1/vts/functional/radio_hidl_hal_api.cpp
index 4bf6f87..549b592 100644
--- a/radio/1.1/vts/functional/radio_hidl_hal_api.cpp
+++ b/radio/1.1/vts/functional/radio_hidl_hal_api.cpp
@@ -63,7 +63,8 @@
     if (cardStatus.cardState == CardState::ABSENT) {
         ASSERT_TRUE(radioRsp_v1_1->rspInfo.error == RadioError::NONE ||
                     radioRsp_v1_1->rspInfo.error == RadioError::SIM_ABSENT ||
-                    radioRsp_v1_1->rspInfo.error == RadioError::INVALID_ARGUMENTS);
+                    radioRsp_v1_1->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
+                    radioRsp_v1_1->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED);
     }
 }
 
@@ -84,7 +85,8 @@
 
     if (cardStatus.cardState == CardState::ABSENT) {
         ASSERT_TRUE(radioRsp_v1_1->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
-                    radioRsp_v1_1->rspInfo.error == RadioError::SIM_ABSENT);
+                    radioRsp_v1_1->rspInfo.error == RadioError::SIM_ABSENT ||
+                    radioRsp_v1_1->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED);
     }
 }
 
@@ -101,6 +103,30 @@
 
     if (cardStatus.cardState == CardState::ABSENT) {
         ASSERT_TRUE(radioRsp_v1_1->rspInfo.error == RadioError::NONE ||
-                    radioRsp_v1_1->rspInfo.error == RadioError::SIM_ABSENT);
+                    radioRsp_v1_1->rspInfo.error == RadioError::SIM_ABSENT ||
+                    radioRsp_v1_1->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED);
+    }
+}
+
+/*
+ * Test IRadio.setCarrierInfoForImsiEncryption() for the response returned.
+ */
+TEST_F(RadioHidlTest_v1_1, setCarrierInfoForImsiEncryption) {
+    int serial = GetRandomSerialNumber();
+    ImsiEncryptionInfo imsiInfo;
+    imsiInfo.mcc = "310";
+    imsiInfo.mnc = "004";
+    imsiInfo.carrierKey = (std::vector<uint8_t>){1, 2, 3, 4, 5, 6};
+    imsiInfo.keyIdentifier = "Test";
+    imsiInfo.expirationTime = 20180101;
+
+    radio_v1_1->setCarrierInfoForImsiEncryption(serial, imsiInfo);
+    EXPECT_EQ(std::cv_status::no_timeout, wait());
+    EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_1->rspInfo.type);
+    EXPECT_EQ(serial, radioRsp_v1_1->rspInfo.serial);
+
+    if (cardStatus.cardState == CardState::ABSENT) {
+        ASSERT_TRUE(radioRsp_v1_1->rspInfo.error == RadioError::NONE ||
+                    radioRsp_v1_1->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED);
     }
 }
\ No newline at end of file
diff --git a/radio/1.1/vts/functional/radio_response.cpp b/radio/1.1/vts/functional/radio_response.cpp
index 37b80b1..407b464 100644
--- a/radio/1.1/vts/functional/radio_response.cpp
+++ b/radio/1.1/vts/functional/radio_response.cpp
@@ -659,7 +659,9 @@
 
 /* 1.1 Apis */
 Return<void> RadioResponse_v1_1::setCarrierInfoForImsiEncryptionResponse(
-    const RadioResponseInfo& /*info*/) {
+    const RadioResponseInfo& info) {
+    rspInfo = info;
+    parent_v1_1.notify();
     return Void();
 }
 
diff --git a/tests/msgq/1.0/default/Android.bp b/tests/msgq/1.0/default/Android.bp
index e3c49e7..eb25ac2 100644
--- a/tests/msgq/1.0/default/Android.bp
+++ b/tests/msgq/1.0/default/Android.bp
@@ -17,7 +17,6 @@
     name: "android.hardware.tests.msgq@1.0-impl",
     defaults: ["hidl_defaults"],
     relative_install_path: "hw",
-    proprietary: true,
     srcs: [
         "TestMsgQ.cpp",
         "BenchmarkMsgQ.cpp"
diff --git a/wifi/1.1/IWifiChip.hal b/wifi/1.1/IWifiChip.hal
index 50cd02d..1af1f71 100644
--- a/wifi/1.1/IWifiChip.hal
+++ b/wifi/1.1/IWifiChip.hal
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 The Android Open Source Project
+ * Copyright 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.
@@ -44,24 +44,40 @@
   };
 
   /**
-   * API to set TX power limit.
-   * This is used for meeting SAR requirements while making VOIP calls for
-   * example.
-   *
-   * @param powerInDbm Power level in dBm.
-   * @return status WifiStatus of the operation.
-   *         Possible status codes:
-   *         |WifiStatusCode.SUCCESS|,
-   *         |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
-   *         |WifiStatusCode.ERROR_NOT_SUPPORTED|,
-   *         |WifiStatusCode.NOT_AVAILABLE|,
-   *         |WifiStatusCode.UNKNOWN|
+   * List of preset wifi radio TX power levels for different scenarios.
+   * The actual power values (typically varies based on the channel,
+   * 802.11 connection type, number of MIMO streams, etc) for each scenario
+   * is defined by the OEM as a BDF file since it varies for each wifi chip
+   * vendor and device.
    */
-  setTxPowerLimit(int32_t powerInDbm) generates (WifiStatus status);
+  enum TxPowerScenario : uint32_t {
+    VOICE_CALL = 0,
+  };
 
   /**
-   * API to reset TX power limit.
-   * This is used to set the power back to default values.
+   * API to select one of the preset TX power scenarios.
+   *
+   * The framework must invoke this method with the appropriate scenario to let
+   * the wifi chip change it's transmitting power levels.
+   * OEM's should define various power profiles for each of the scenarios
+   * above (defined in |TxPowerScenario|).
+   *
+   * @param scenario One of the preselected scenarios defined in
+   *        |TxPowerScenario|.
+   * @return status WifiStatus of the operation.
+   *         Possible status codes:
+   *         |WifiStatusCode.SUCCESS|,
+   *         |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
+   *         |WifiStatusCode.ERROR_NOT_SUPPORTED|,
+   *         |WifiStatusCode.NOT_AVAILABLE|,
+   *         |WifiStatusCode.UNKNOWN|
+   */
+  selectTxPowerScenario(TxPowerScenario scenario) generates (WifiStatus status);
+
+  /**
+   * API to reset TX power levels.
+   * This is used to indicate the end of the previously selected TX power
+   * scenario and let the wifi chip fall back to the default power values.
    *
    * @return status WifiStatus of the operation.
    *         Possible status codes:
@@ -71,5 +87,5 @@
    *         |WifiStatusCode.NOT_AVAILABLE|,
    *         |WifiStatusCode.UNKNOWN|
    */
-  resetTxPowerLimit() generates (WifiStatus status);
+  resetTxPowerScenario() generates (WifiStatus status);
 };
diff --git a/wifi/1.1/default/hidl_struct_util.cpp b/wifi/1.1/default/hidl_struct_util.cpp
index 6b93b9e..c53cdc5 100644
--- a/wifi/1.1/default/hidl_struct_util.cpp
+++ b/wifi/1.1/default/hidl_struct_util.cpp
@@ -17,9 +17,6 @@
 #include <android-base/logging.h>
 #include <utils/SystemClock.h>
 
-#include <android/hardware/wifi/1.0/IWifiChip.h>
-#include <android/hardware/wifi/1.1/IWifiChip.h>
-
 #include "hidl_struct_util.h"
 
 namespace android {
@@ -260,6 +257,15 @@
   return true;
 }
 
+legacy_hal::wifi_power_scenario convertHidlTxPowerScenarioToLegacy(
+    V1_1::IWifiChip::TxPowerScenario hidl_scenario) {
+  switch (hidl_scenario) {
+    case V1_1::IWifiChip::TxPowerScenario::VOICE_CALL:
+      return legacy_hal::WIFI_POWER_SCENARIO_VOICE_CALL;
+  };
+  CHECK(false);
+}
+
 bool convertLegacyFeaturesToHidlStaCapabilities(
     uint32_t legacy_feature_set,
     uint32_t legacy_logger_feature_set,
diff --git a/wifi/1.1/default/hidl_struct_util.h b/wifi/1.1/default/hidl_struct_util.h
index 7a840f9..747fd2f 100644
--- a/wifi/1.1/default/hidl_struct_util.h
+++ b/wifi/1.1/default/hidl_struct_util.h
@@ -20,6 +20,8 @@
 #include <vector>
 
 #include <android/hardware/wifi/1.0/types.h>
+#include <android/hardware/wifi/1.0/IWifiChip.h>
+#include <android/hardware/wifi/1.1/IWifiChip.h>
 
 #include "wifi_legacy_hal.h"
 
@@ -51,6 +53,8 @@
 bool convertLegacyWakeReasonStatsToHidl(
     const legacy_hal::WakeReasonStats& legacy_stats,
     WifiDebugHostWakeReasonStats* hidl_stats);
+legacy_hal::wifi_power_scenario convertHidlTxPowerScenarioToLegacy(
+    V1_1::IWifiChip::TxPowerScenario hidl_scenario);
 
 // STA iface conversion methods.
 bool convertLegacyFeaturesToHidlStaCapabilities(
diff --git a/wifi/1.1/default/wifi_chip.cpp b/wifi/1.1/default/wifi_chip.cpp
index 2beac26..2f40234 100644
--- a/wifi/1.1/default/wifi_chip.cpp
+++ b/wifi/1.1/default/wifi_chip.cpp
@@ -343,20 +343,20 @@
                          enable);
 }
 
-Return<void> WifiChip::setTxPowerLimit(
-    int32_t powerInDbm, setTxPowerLimit_cb hidl_status_cb) {
+Return<void> WifiChip::selectTxPowerScenario(
+    TxPowerScenario scenario, selectTxPowerScenario_cb hidl_status_cb) {
   return validateAndCall(this,
                          WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
-                         &WifiChip::setTxPowerLimitInternal,
+                         &WifiChip::selectTxPowerScenarioInternal,
                          hidl_status_cb,
-                         powerInDbm);
+                         scenario);
 }
 
-Return<void> WifiChip::resetTxPowerLimit(
-    resetTxPowerLimit_cb hidl_status_cb) {
+Return<void> WifiChip::resetTxPowerScenario(
+    resetTxPowerScenario_cb hidl_status_cb) {
   return validateAndCall(this,
                          WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
-                         &WifiChip::resetTxPowerLimitInternal,
+                         &WifiChip::resetTxPowerScenarioInternal,
                          hidl_status_cb);
 }
 
@@ -824,13 +824,14 @@
   return createWifiStatusFromLegacyError(legacy_status);
 }
 
-WifiStatus WifiChip::setTxPowerLimitInternal(int32_t powerInDbm) {
-  auto legacy_status = legacy_hal_.lock()->setTxPowerLimit(powerInDbm);
+WifiStatus WifiChip::selectTxPowerScenarioInternal(TxPowerScenario scenario) {
+  auto legacy_status = legacy_hal_.lock()->selectTxPowerScenario(
+      hidl_struct_util::convertHidlTxPowerScenarioToLegacy(scenario));
   return createWifiStatusFromLegacyError(legacy_status);
 }
 
-WifiStatus WifiChip::resetTxPowerLimitInternal() {
-  auto legacy_status = legacy_hal_.lock()->resetTxPowerLimit();
+WifiStatus WifiChip::resetTxPowerScenarioInternal() {
+  auto legacy_status = legacy_hal_.lock()->resetTxPowerScenario();
   return createWifiStatusFromLegacyError(legacy_status);
 }
 
diff --git a/wifi/1.1/default/wifi_chip.h b/wifi/1.1/default/wifi_chip.h
index b7dde50..e88100b 100644
--- a/wifi/1.1/default/wifi_chip.h
+++ b/wifi/1.1/default/wifi_chip.h
@@ -126,9 +126,11 @@
       getDebugHostWakeReasonStats_cb hidl_status_cb) override;
   Return<void> enableDebugErrorAlerts(
       bool enable, enableDebugErrorAlerts_cb hidl_status_cb) override;
-  Return<void> setTxPowerLimit(
-      int32_t powerInDbm, setTxPowerLimit_cb hidl_status_cb) override;
-  Return<void> resetTxPowerLimit(resetTxPowerLimit_cb hidl_status_cb) override;
+  Return<void> selectTxPowerScenario(
+      TxPowerScenario scenario,
+      selectTxPowerScenario_cb hidl_status_cb) override;
+  Return<void> resetTxPowerScenario(
+      resetTxPowerScenario_cb hidl_status_cb) override;
 
  private:
   void invalidateAndRemoveAllIfaces();
@@ -180,8 +182,8 @@
   std::pair<WifiStatus, WifiDebugHostWakeReasonStats>
   getDebugHostWakeReasonStatsInternal();
   WifiStatus enableDebugErrorAlertsInternal(bool enable);
-  WifiStatus setTxPowerLimitInternal(int32_t powerInDbm);
-  WifiStatus resetTxPowerLimitInternal();
+  WifiStatus selectTxPowerScenarioInternal(TxPowerScenario scenario);
+  WifiStatus resetTxPowerScenarioInternal();
 
   WifiStatus handleChipConfiguration(ChipModeId mode_id);
   WifiStatus registerDebugRingBufferCallback();
diff --git a/wifi/1.1/default/wifi_legacy_hal.cpp b/wifi/1.1/default/wifi_legacy_hal.cpp
index 052aafb..7d683d3 100644
--- a/wifi/1.1/default/wifi_legacy_hal.cpp
+++ b/wifi/1.1/default/wifi_legacy_hal.cpp
@@ -752,13 +752,13 @@
                                                       oui_internal.data());
 }
 
-wifi_error WifiLegacyHal::setTxPowerLimit(int32_t tx_level_dbm) {
-  return global_func_table_.wifi_set_tx_power_limit(wlan_interface_handle_,
-                                                    tx_level_dbm);
+wifi_error WifiLegacyHal::selectTxPowerScenario(wifi_power_scenario scenario) {
+  return global_func_table_.wifi_select_tx_power_scenario(
+      wlan_interface_handle_, scenario);
 }
 
-wifi_error WifiLegacyHal::resetTxPowerLimit() {
-  return global_func_table_.wifi_reset_tx_power_limit(wlan_interface_handle_);
+wifi_error WifiLegacyHal::resetTxPowerScenario() {
+  return global_func_table_.wifi_reset_tx_power_scenario(wlan_interface_handle_);
 }
 
 std::pair<wifi_error, uint32_t> WifiLegacyHal::getLoggerSupportedFeatureSet() {
diff --git a/wifi/1.1/default/wifi_legacy_hal.h b/wifi/1.1/default/wifi_legacy_hal.h
index 8d9144d..caa1bd5 100644
--- a/wifi/1.1/default/wifi_legacy_hal.h
+++ b/wifi/1.1/default/wifi_legacy_hal.h
@@ -205,8 +205,8 @@
       uint32_t period_in_ms);
   wifi_error stopSendingOffloadedPacket(uint32_t cmd_id);
   wifi_error setScanningMacOui(const std::array<uint8_t, 3>& oui);
-  wifi_error setTxPowerLimit(int32_t tx_level_dbm);
-  wifi_error resetTxPowerLimit();
+  wifi_error selectTxPowerScenario(wifi_power_scenario scenario);
+  wifi_error resetTxPowerScenario();
   // Logger/debug functions.
   std::pair<wifi_error, uint32_t> getLoggerSupportedFeatureSet();
   wifi_error startPktFateMonitoring();
diff --git a/wifi/1.1/default/wifi_legacy_hal_stubs.cpp b/wifi/1.1/default/wifi_legacy_hal_stubs.cpp
index 24ed548..c02e3ba 100644
--- a/wifi/1.1/default/wifi_legacy_hal_stubs.cpp
+++ b/wifi/1.1/default/wifi_legacy_hal_stubs.cpp
@@ -132,8 +132,8 @@
   populateStubFor(&hal_fn->wifi_get_roaming_capabilities);
   populateStubFor(&hal_fn->wifi_enable_firmware_roaming);
   populateStubFor(&hal_fn->wifi_configure_roaming);
-  populateStubFor(&hal_fn->wifi_set_tx_power_limit);
-  populateStubFor(&hal_fn->wifi_reset_tx_power_limit);
+  populateStubFor(&hal_fn->wifi_select_tx_power_scenario);
+  populateStubFor(&hal_fn->wifi_reset_tx_power_scenario);
   return true;
 }
 }  // namespace legacy_hal
diff --git a/wifi/1.1/vts/functional/wifi_chip_hidl_test.cpp b/wifi/1.1/vts/functional/wifi_chip_hidl_test.cpp
index 839b6c4..d3a983c 100644
--- a/wifi/1.1/vts/functional/wifi_chip_hidl_test.cpp
+++ b/wifi/1.1/vts/functional/wifi_chip_hidl_test.cpp
@@ -37,7 +37,8 @@
 using ::android::hardware::wifi::V1_0::IWifiStaIface;
 
 namespace {
-constexpr int32_t kFakePowerInDbm = -56;
+constexpr IWifiChip::TxPowerScenario kFakePowerScenario =
+    IWifiChip::TxPowerScenario::VOICE_CALL;
 }; //namespace
 
 /**
@@ -66,12 +67,12 @@
 };
 
 /*
- * SetTxPowerLimit
+ * SelectTxPowerScenario
  */
-TEST_F(WifiChipHidlTest, SetTxPowerLimit) {
+TEST_F(WifiChipHidlTest, SelectTxPowerScenario) {
     uint32_t caps = configureChipForStaIfaceAndGetCapabilities();
     const auto& status =
-        HIDL_INVOKE(wifi_chip_, setTxPowerLimit, kFakePowerInDbm);
+        HIDL_INVOKE(wifi_chip_, selectTxPowerScenario, kFakePowerScenario);
     if (caps & IWifiChip::ChipCapabilityMask::SET_TX_POWER_LIMIT) {
         EXPECT_EQ(WifiStatusCode::SUCCESS, status.code);
     } else {
@@ -80,12 +81,12 @@
 }
 
 /*
- * SetTxPowerLimit
+ * ResetTxPowerScenario
  */
-TEST_F(WifiChipHidlTest, ResetTxPowerLimit) {
+TEST_F(WifiChipHidlTest, ResetTxPowerScenario) {
     uint32_t caps = configureChipForStaIfaceAndGetCapabilities();
     const auto& status =
-        HIDL_INVOKE(wifi_chip_, resetTxPowerLimit);
+        HIDL_INVOKE(wifi_chip_, resetTxPowerScenario);
     if (caps & IWifiChip::ChipCapabilityMask::SET_TX_POWER_LIMIT) {
         EXPECT_EQ(WifiStatusCode::SUCCESS, status.code);
     } else {