Remove outdated warning now that the v1.0 had shipped am: 897f0d48bb am: 1366d334a1 am: 3b12885c63 am: 149d54ec95
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1441474
Change-Id: I783eb94f4a36a7f8288150f99a867aa90eac6065
diff --git a/automotive/audiocontrol/2.0/vts/functional/Android.bp b/automotive/audiocontrol/2.0/vts/functional/Android.bp
index ac20509..520b042 100644
--- a/automotive/audiocontrol/2.0/vts/functional/Android.bp
+++ b/automotive/audiocontrol/2.0/vts/functional/Android.bp
@@ -24,6 +24,6 @@
],
test_suites: [
"general-tests",
- "vts",
+ "vts-core",
],
}
diff --git a/automotive/evs/1.1/vts/functional/Android.bp b/automotive/evs/1.1/vts/functional/Android.bp
index d61f0a8..086a199 100644
--- a/automotive/evs/1.1/vts/functional/Android.bp
+++ b/automotive/evs/1.1/vts/functional/Android.bp
@@ -38,7 +38,7 @@
"android.hardware.graphics.common@1.2",
"android.hardware.camera.device@3.2",
],
- test_suites: ["vts"],
+ test_suites: ["vts-core"],
cflags: [
"-O0",
"-g",
diff --git a/automotive/occupant_awareness/aidl/vts/functional/Android.bp b/automotive/occupant_awareness/aidl/vts/functional/Android.bp
index 514b0af..1256b69 100644
--- a/automotive/occupant_awareness/aidl/vts/functional/Android.bp
+++ b/automotive/occupant_awareness/aidl/vts/functional/Android.bp
@@ -12,6 +12,6 @@
"android.hardware.automotive.occupant_awareness-cpp",
],
test_suites: [
- "vts",
+ "vts-core",
],
}
diff --git a/automotive/sv/1.0/vts/functional/Android.bp b/automotive/sv/1.0/vts/functional/Android.bp
index d5d72a6..0e5d3df 100644
--- a/automotive/sv/1.0/vts/functional/Android.bp
+++ b/automotive/sv/1.0/vts/functional/Android.bp
@@ -33,7 +33,7 @@
"android.hidl.memory@1.0",
"libhidlmemory",
],
- test_suites: ["general-tests", "vts"],
+ test_suites: ["general-tests", "vts-core"],
cflags: [
"-O0",
"-g",
diff --git a/automotive/vehicle/2.0/default/common/src/VehicleHalManager.cpp b/automotive/vehicle/2.0/default/common/src/VehicleHalManager.cpp
index b09e9bf..dc5d3d3 100644
--- a/automotive/vehicle/2.0/default/common/src/VehicleHalManager.cpp
+++ b/automotive/vehicle/2.0/default/common/src/VehicleHalManager.cpp
@@ -78,6 +78,7 @@
} else {
ALOGW("Requested config for undefined property: 0x%x", prop);
_hidl_cb(StatusCode::INVALID_ARG, hidl_vec<VehiclePropConfig>());
+ return Void();
}
}
diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h
index 16c33b9..cf18404 100644
--- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h
+++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h
@@ -266,6 +266,20 @@
.initialValue = {.stringValue = "Toy Vehicle"}},
{.config =
{
+ .prop = toInt(VehicleProperty::INFO_MODEL),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::STATIC,
+ },
+ .initialValue = {.stringValue = "Speedy Model"}},
+ {.config =
+ {
+ .prop = toInt(VehicleProperty::INFO_MODEL_YEAR),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::STATIC,
+ },
+ .initialValue = {.int32Values = {2020}}},
+ {.config =
+ {
.prop = toInt(VehicleProperty::INFO_EXTERIOR_DIMENSIONS),
.access = VehiclePropertyAccess::READ,
.changeMode = VehiclePropertyChangeMode::STATIC,
@@ -674,6 +688,12 @@
.prop = toInt(VehicleProperty::GEAR_SELECTION),
.access = VehiclePropertyAccess::READ,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .configArray = {(int)VehicleGear::GEAR_PARK,
+ (int)VehicleGear::GEAR_NEUTRAL,
+ (int)VehicleGear::GEAR_REVERSE,
+ (int)VehicleGear::GEAR_DRIVE, (int)VehicleGear::GEAR_1,
+ (int)VehicleGear::GEAR_2, (int)VehicleGear::GEAR_3,
+ (int)VehicleGear::GEAR_4, (int)VehicleGear::GEAR_5},
},
.initialValue = {.int32Values = {toInt(VehicleGear::GEAR_PARK)}}},
diff --git a/automotive/vehicle/2.0/utils/UserHalHelper.cpp b/automotive/vehicle/2.0/utils/UserHalHelper.cpp
index fcfe4bf..abf59b7 100644
--- a/automotive/vehicle/2.0/utils/UserHalHelper.cpp
+++ b/automotive/vehicle/2.0/utils/UserHalHelper.cpp
@@ -141,11 +141,6 @@
template <typename T>
Result<T> verifyAndCast(int32_t value) {
T castValue = static_cast<T>(value);
- const auto iter = hidl_enum_range<T>();
- if (castValue < *iter.begin() || castValue > *std::prev(iter.end())) {
- return Error() << "Value " << value << " not in range [" << toString(*iter.begin()) << ", "
- << toString(*std::prev(iter.end())) << "]";
- }
for (const auto& v : hidl_enum_range<T>()) {
if (castValue == v) {
return castValue;
diff --git a/biometrics/fingerprint/2.2/vts/functional/Android.bp b/biometrics/fingerprint/2.2/vts/functional/Android.bp
index 5e8e7c8..496570c 100644
--- a/biometrics/fingerprint/2.2/vts/functional/Android.bp
+++ b/biometrics/fingerprint/2.2/vts/functional/Android.bp
@@ -24,6 +24,6 @@
],
test_suites: [
"general-tests",
- "vts",
+ "vts-core",
],
}
diff --git a/camera/provider/2.4/vts/functional/Android.bp b/camera/provider/2.4/vts/functional/Android.bp
index cd66f74..4b9d6f1 100644
--- a/camera/provider/2.4/vts/functional/Android.bp
+++ b/camera/provider/2.4/vts/functional/Android.bp
@@ -49,5 +49,5 @@
"libhidlmemory",
"libgralloctypes",
],
- test_suites: ["general-tests", "vts"],
+ test_suites: ["general-tests", "vts-core"],
}
diff --git a/cas/1.0/vts/functional/Android.bp b/cas/1.0/vts/functional/Android.bp
index 82dc568..ab39c0e 100644
--- a/cas/1.0/vts/functional/Android.bp
+++ b/cas/1.0/vts/functional/Android.bp
@@ -29,6 +29,6 @@
shared_libs: [
"libbinder",
],
- test_suites: ["general-tests", "vts"],
+ test_suites: ["general-tests", "vts-core"],
}
diff --git a/cas/1.1/vts/functional/Android.bp b/cas/1.1/vts/functional/Android.bp
index de223c8..9e8eb52 100644
--- a/cas/1.1/vts/functional/Android.bp
+++ b/cas/1.1/vts/functional/Android.bp
@@ -30,6 +30,6 @@
shared_libs: [
"libbinder",
],
- test_suites: ["general-tests", "vts"],
+ test_suites: ["general-tests", "vts-core"],
}
diff --git a/cas/1.2/vts/functional/Android.bp b/cas/1.2/vts/functional/Android.bp
index 74ea85f..2d6517f 100644
--- a/cas/1.2/vts/functional/Android.bp
+++ b/cas/1.2/vts/functional/Android.bp
@@ -33,6 +33,6 @@
],
test_suites: [
"general-tests",
- "vts",
+ "vts-core",
],
}
diff --git a/contexthub/1.1/vts/functional/Android.bp b/contexthub/1.1/vts/functional/Android.bp
index 034c11f..f1625a6 100644
--- a/contexthub/1.1/vts/functional/Android.bp
+++ b/contexthub/1.1/vts/functional/Android.bp
@@ -25,6 +25,6 @@
],
test_suites: [
"general-tests",
- "vts",
+ "vts-core",
],
}
diff --git a/drm/1.3/vts/functional/Android.bp b/drm/1.3/vts/functional/Android.bp
index 3e40adf..bd9db85 100644
--- a/drm/1.3/vts/functional/Android.bp
+++ b/drm/1.3/vts/functional/Android.bp
@@ -87,6 +87,6 @@
},
test_suites: [
"general-tests",
- "vts",
+ "vts-core",
],
}
diff --git a/gnss/1.1/vts/functional/Android.bp b/gnss/1.1/vts/functional/Android.bp
index 94bfb89..c9914fb 100644
--- a/gnss/1.1/vts/functional/Android.bp
+++ b/gnss/1.1/vts/functional/Android.bp
@@ -34,6 +34,6 @@
],
test_suites: [
"general-tests",
- "vts",
+ "vts-core",
],
}
diff --git a/gnss/2.0/vts/functional/Android.bp b/gnss/2.0/vts/functional/Android.bp
index d67677a..da5289d 100644
--- a/gnss/2.0/vts/functional/Android.bp
+++ b/gnss/2.0/vts/functional/Android.bp
@@ -31,5 +31,5 @@
"android.hardware.gnss@2.1",
"android.hardware.gnss@common-vts-lib",
],
- test_suites: ["general-tests", "vts"],
+ test_suites: ["general-tests", "vts-core"],
}
diff --git a/gnss/2.1/vts/functional/Android.bp b/gnss/2.1/vts/functional/Android.bp
index b3051d4..f008a26 100644
--- a/gnss/2.1/vts/functional/Android.bp
+++ b/gnss/2.1/vts/functional/Android.bp
@@ -34,6 +34,6 @@
],
test_suites: [
"general-tests",
- "vts",
+ "vts-core",
],
}
diff --git a/graphics/composer/2.1/vts/functional/Android.bp b/graphics/composer/2.1/vts/functional/Android.bp
index e137afb..3678a04 100644
--- a/graphics/composer/2.1/vts/functional/Android.bp
+++ b/graphics/composer/2.1/vts/functional/Android.bp
@@ -43,5 +43,5 @@
"android.hardware.graphics.composer@2.1-command-buffer",
],
disable_framework: true,
- test_suites: ["general-tests", "vts"],
+ test_suites: ["general-tests", "vts-core"],
}
diff --git a/graphics/composer/2.2/vts/functional/Android.bp b/graphics/composer/2.2/vts/functional/Android.bp
index d80845f..a8a05e4 100644
--- a/graphics/composer/2.2/vts/functional/Android.bp
+++ b/graphics/composer/2.2/vts/functional/Android.bp
@@ -61,6 +61,6 @@
disable_framework: true,
test_suites: [
"general-tests",
- "vts",
+ "vts-core",
],
}
diff --git a/graphics/composer/2.3/vts/functional/Android.bp b/graphics/composer/2.3/vts/functional/Android.bp
index 1ab6b3b..fdb055a 100644
--- a/graphics/composer/2.3/vts/functional/Android.bp
+++ b/graphics/composer/2.3/vts/functional/Android.bp
@@ -50,5 +50,5 @@
"android.hardware.graphics.composer@2.3-command-buffer",
],
disable_framework: true,
- test_suites: ["general-tests", "vts"],
+ test_suites: ["general-tests", "vts-core"],
}
diff --git a/graphics/composer/2.4/vts/functional/Android.bp b/graphics/composer/2.4/vts/functional/Android.bp
index d0209b7..88b6114 100644
--- a/graphics/composer/2.4/vts/functional/Android.bp
+++ b/graphics/composer/2.4/vts/functional/Android.bp
@@ -52,5 +52,5 @@
"android.hardware.graphics.composer@2.4-command-buffer",
],
disable_framework: true,
- test_suites: ["general-tests", "vts"],
+ test_suites: ["general-tests", "vts-core"],
}
diff --git a/graphics/mapper/4.0/vts/functional/Android.bp b/graphics/mapper/4.0/vts/functional/Android.bp
index 03abc89..3542a6e 100644
--- a/graphics/mapper/4.0/vts/functional/Android.bp
+++ b/graphics/mapper/4.0/vts/functional/Android.bp
@@ -36,6 +36,6 @@
],
test_suites: [
"general-tests",
- "vts",
+ "vts-core",
],
}
diff --git a/input/classifier/1.0/vts/functional/Android.bp b/input/classifier/1.0/vts/functional/Android.bp
index 99fdb8c..150324b 100644
--- a/input/classifier/1.0/vts/functional/Android.bp
+++ b/input/classifier/1.0/vts/functional/Android.bp
@@ -25,6 +25,6 @@
],
test_suites: [
"general-tests",
- "vts",
+ "vts-core",
],
}
diff --git a/rebootescrow/aidl/vts/functional/Android.bp b/rebootescrow/aidl/vts/functional/Android.bp
index 2cc0068..5d51a53 100644
--- a/rebootescrow/aidl/vts/functional/Android.bp
+++ b/rebootescrow/aidl/vts/functional/Android.bp
@@ -28,7 +28,7 @@
"android.hardware.rebootescrow-cpp",
],
test_suites: [
- "vts",
+ "vts-core",
],
require_root: true,
}
diff --git a/sensors/1.0/vts/functional/Android.bp b/sensors/1.0/vts/functional/Android.bp
index c77733b..4941ac2 100644
--- a/sensors/1.0/vts/functional/Android.bp
+++ b/sensors/1.0/vts/functional/Android.bp
@@ -28,6 +28,6 @@
],
test_suites: [
"general-tests",
- "vts",
+ "vts-core",
],
}
diff --git a/sensors/2.0/vts/functional/Android.bp b/sensors/2.0/vts/functional/Android.bp
index 83ebc6b..c0803c7 100644
--- a/sensors/2.0/vts/functional/Android.bp
+++ b/sensors/2.0/vts/functional/Android.bp
@@ -35,6 +35,6 @@
],
test_suites: [
"general-tests",
- "vts",
+ "vts-core",
],
}
diff --git a/sensors/2.1/vts/functional/Android.bp b/sensors/2.1/vts/functional/Android.bp
index d257993..920b642 100644
--- a/sensors/2.1/vts/functional/Android.bp
+++ b/sensors/2.1/vts/functional/Android.bp
@@ -37,6 +37,6 @@
],
test_suites: [
"general-tests",
- "vts",
+ "vts-core",
],
}
diff --git a/sensors/common/default/2.X/multihal/HalProxy.cpp b/sensors/common/default/2.X/multihal/HalProxy.cpp
index 4527c75..8dda0af 100644
--- a/sensors/common/default/2.X/multihal/HalProxy.cpp
+++ b/sensors/common/default/2.X/multihal/HalProxy.cpp
@@ -693,6 +693,10 @@
int64_t timeoutStart /* = -1 */) {
if (!mThreadsRun.load()) return;
std::lock_guard<std::recursive_mutex> lockGuard(mWakelockMutex);
+ if (delta > mWakelockRefCount) {
+ ALOGE("Decrementing wakelock ref count by %zu when count is %zu",
+ delta, mWakelockRefCount);
+ }
if (timeoutStart == -1) timeoutStart = mWakelockTimeoutResetTime;
if (mWakelockRefCount == 0 || timeoutStart < mWakelockTimeoutResetTime) return;
mWakelockRefCount -= std::min(mWakelockRefCount, delta);
diff --git a/sensors/common/default/2.X/multihal/ScopedWakelock.cpp b/sensors/common/default/2.X/multihal/ScopedWakelock.cpp
index bf2ad35..2a2baa2 100644
--- a/sensors/common/default/2.X/multihal/ScopedWakelock.cpp
+++ b/sensors/common/default/2.X/multihal/ScopedWakelock.cpp
@@ -28,6 +28,21 @@
.count();
}
+ScopedWakelock::ScopedWakelock(ScopedWakelock&& other) {
+ *this = std::move(other);
+}
+
+ScopedWakelock& ScopedWakelock::operator=(ScopedWakelock&& other) {
+ mRefCounter = other.mRefCounter;
+ mCreatedAtTimeNs = other.mCreatedAtTimeNs;
+ mLocked = other.mLocked;
+
+ other.mRefCounter = nullptr;
+ other.mCreatedAtTimeNs = 0;
+ other.mLocked = false;
+ return *this;
+}
+
ScopedWakelock::ScopedWakelock(IScopedWakelockRefCounter* refCounter, bool locked)
: mRefCounter(refCounter), mLocked(locked) {
if (mLocked) {
diff --git a/sensors/common/default/2.X/multihal/include/V2_0/ScopedWakelock.h b/sensors/common/default/2.X/multihal/include/V2_0/ScopedWakelock.h
index 1cc5cd5..b3f398c 100644
--- a/sensors/common/default/2.X/multihal/include/V2_0/ScopedWakelock.h
+++ b/sensors/common/default/2.X/multihal/include/V2_0/ScopedWakelock.h
@@ -81,14 +81,15 @@
*/
class ScopedWakelock {
public:
- ScopedWakelock(ScopedWakelock&&) = default;
- ScopedWakelock& operator=(ScopedWakelock&&) = default;
+ ScopedWakelock(ScopedWakelock&& other);
+ ScopedWakelock& operator=(ScopedWakelock&& other);
virtual ~ScopedWakelock();
bool isLocked() const { return mLocked; }
private:
friend class HalProxyCallbackBase;
+ friend class ScopedWakelockTest;
IScopedWakelockRefCounter* mRefCounter;
int64_t mCreatedAtTimeNs;
bool mLocked;
diff --git a/sensors/common/default/2.X/multihal/tests/Android.bp b/sensors/common/default/2.X/multihal/tests/Android.bp
index a15faed..1b60f4b 100644
--- a/sensors/common/default/2.X/multihal/tests/Android.bp
+++ b/sensors/common/default/2.X/multihal/tests/Android.bp
@@ -90,7 +90,10 @@
cc_test {
name: "android.hardware.sensors@2.X-halproxy-unit-tests",
- srcs: ["HalProxy_test.cpp"],
+ srcs: [
+ "HalProxy_test.cpp",
+ "ScopedWakelock_test.cpp",
+ ],
vendor: true,
header_libs: [
"android.hardware.sensors@2.X-shared-utils",
diff --git a/sensors/common/default/2.X/multihal/tests/ScopedWakelock_test.cpp b/sensors/common/default/2.X/multihal/tests/ScopedWakelock_test.cpp
new file mode 100644
index 0000000..133d9e8
--- /dev/null
+++ b/sensors/common/default/2.X/multihal/tests/ScopedWakelock_test.cpp
@@ -0,0 +1,110 @@
+//
+// Copyright (C) 2020 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <gtest/gtest.h>
+
+#include "V2_0/ScopedWakelock.h"
+
+namespace android {
+namespace hardware {
+namespace sensors {
+namespace V2_0 {
+namespace implementation {
+
+class RefCounter : public IScopedWakelockRefCounter {
+ public:
+ size_t incCount = 0;
+ size_t decCount = 0;
+
+ bool incrementRefCountAndMaybeAcquireWakelock(size_t /* delta */,
+ int64_t* /* timeoutStart */) override {
+ incCount++;
+ return true;
+ }
+
+ void decrementRefCountAndMaybeReleaseWakelock(size_t /* delta */,
+ int64_t /* timeoutStart */) override {
+ decCount++;
+ }
+};
+
+class ScopedWakelockTest : public testing::Test {
+ public:
+ ScopedWakelock createScopedWakelock(bool locked) {
+ return ScopedWakelock(&mRefCounter, locked);
+ }
+
+ RefCounter mRefCounter;
+};
+
+TEST_F(ScopedWakelockTest, UnlockedAfterMoved) {
+ ScopedWakelock wakelock = createScopedWakelock(false /* locked */);
+
+ ScopedWakelock movedWakelock(std::move(wakelock));
+
+ EXPECT_FALSE(wakelock.isLocked());
+ EXPECT_FALSE(movedWakelock.isLocked());
+}
+
+TEST_F(ScopedWakelockTest, LockedAfterMoved) {
+ ScopedWakelock wakelock = createScopedWakelock(true /* locked */);
+
+ ScopedWakelock movedWakelock(std::move(wakelock));
+
+ EXPECT_FALSE(wakelock.isLocked());
+ EXPECT_TRUE(movedWakelock.isLocked());
+}
+
+TEST_F(ScopedWakelockTest, Locked) {
+ ScopedWakelock wakelock = createScopedWakelock(true /* locked */);
+
+ EXPECT_TRUE(wakelock.isLocked());
+}
+
+TEST_F(ScopedWakelockTest, Unlocked) {
+ ScopedWakelock wakelock = createScopedWakelock(false /* locked */);
+
+ EXPECT_FALSE(wakelock.isLocked());
+}
+
+TEST_F(ScopedWakelockTest, ScopedLocked) {
+ { createScopedWakelock(true /* locked */); }
+
+ EXPECT_EQ(mRefCounter.incCount, 1);
+ EXPECT_EQ(mRefCounter.decCount, 1);
+}
+
+TEST_F(ScopedWakelockTest, ScopedUnlockIsNoop) {
+ { createScopedWakelock(false /* locked */); }
+
+ EXPECT_EQ(mRefCounter.incCount, 0);
+ EXPECT_EQ(mRefCounter.decCount, 0);
+}
+
+TEST_F(ScopedWakelockTest, ScopedLockedMove) {
+ {
+ ScopedWakelock wakelock = createScopedWakelock(true /* locked */);
+ ScopedWakelock movedWakelock(std::move(wakelock));
+ }
+
+ EXPECT_EQ(mRefCounter.incCount, 1);
+ EXPECT_EQ(mRefCounter.decCount, 1);
+}
+
+} // namespace implementation
+} // namespace V2_0
+} // namespace sensors
+} // namespace hardware
+} // namespace android
\ No newline at end of file
diff --git a/soundtrigger/2.3/vts/functional/Android.bp b/soundtrigger/2.3/vts/functional/Android.bp
index 2c1b9e5..e3855fc 100644
--- a/soundtrigger/2.3/vts/functional/Android.bp
+++ b/soundtrigger/2.3/vts/functional/Android.bp
@@ -26,6 +26,6 @@
],
test_suites: [
"general-tests",
- "vts",
+ "vts-core",
],
}
diff --git a/tv/input/1.0/vts/functional/Android.bp b/tv/input/1.0/vts/functional/Android.bp
index 29d4e21..5d20bce 100644
--- a/tv/input/1.0/vts/functional/Android.bp
+++ b/tv/input/1.0/vts/functional/Android.bp
@@ -21,7 +21,7 @@
static_libs: ["android.hardware.tv.input@1.0"],
test_suites: [
"general-tests",
- "vts",
+ "vts-core",
],
require_root: true,
}
diff --git a/wifi/1.4/default/wifi_chip.cpp b/wifi/1.4/default/wifi_chip.cpp
index 8747e61..8cba464 100644
--- a/wifi/1.4/default/wifi_chip.cpp
+++ b/wifi/1.4/default/wifi_chip.cpp
@@ -624,6 +624,15 @@
Return<void> WifiChip::debug(const hidl_handle& handle,
const hidl_vec<hidl_string>&) {
if (handle != nullptr && handle->numFds >= 1) {
+ {
+ std::unique_lock<std::mutex> lk(lock_t);
+ for (const auto& item : ringbuffer_map_) {
+ forceDumpToDebugRingBufferInternal(item.first);
+ }
+ // unique_lock unlocked here
+ }
+ usleep(100 * 1000); // sleep for 100 milliseconds to wait for
+ // ringbuffer updates.
int fd = handle->data[0];
if (!writeRingbufferFilesInternal()) {
LOG(ERROR) << "Error writing files to flash";
@@ -1120,6 +1129,9 @@
legacy_hal::wifi_error legacy_status =
legacy_hal_.lock()->deregisterRingBufferCallbackHandler(
getFirstActiveWlanIfaceName());
+ if (legacy_status == legacy_hal::WIFI_SUCCESS) {
+ debug_ring_buffer_cb_registered_ = false;
+ }
return createWifiStatusFromLegacyError(legacy_status);
}
@@ -1335,7 +1347,7 @@
LOG(ERROR) << "Ringname " << name << " not found";
return;
}
- // unlock
+ // unique_lock unlocked here
}
};
legacy_hal::wifi_error legacy_status =
@@ -1637,7 +1649,7 @@
}
}
}
- // unlock
+ // unique_lock unlocked here
}
return true;
}
diff --git a/wifi/1.4/default/wifi_legacy_hal.cpp b/wifi/1.4/default/wifi_legacy_hal.cpp
index 29123bf..75f22ec 100644
--- a/wifi/1.4/default/wifi_legacy_hal.cpp
+++ b/wifi/1.4/default/wifi_legacy_hal.cpp
@@ -367,8 +367,8 @@
}
LOG(DEBUG) << "Waiting for the driver ready";
wifi_error status = global_func_table_.wifi_wait_for_driver_ready();
- if (status == WIFI_ERROR_TIMED_OUT) {
- LOG(ERROR) << "Timed out awaiting driver ready";
+ if (status == WIFI_ERROR_TIMED_OUT || status == WIFI_ERROR_UNKNOWN) {
+ LOG(ERROR) << "Failed or timed out awaiting driver ready";
return status;
}
property_set(kDriverPropName, "ok");
diff --git a/wifi/1.4/default/wifi_nan_iface.cpp b/wifi/1.4/default/wifi_nan_iface.cpp
index 5764d35..24ffb17 100644
--- a/wifi/1.4/default/wifi_nan_iface.cpp
+++ b/wifi/1.4/default/wifi_nan_iface.cpp
@@ -534,6 +534,9 @@
}
void WifiNanIface::invalidate() {
+ if (!isValid()) {
+ return;
+ }
// send commands to HAL to actually disable and destroy interfaces
legacy_hal_.lock()->nanDisableRequest(ifname_, 0xFFFF);
legacy_hal_.lock()->nanDataInterfaceDelete(ifname_, 0xFFFE, "aware_data0");