Merge "Vts: thermal: Test notification with an unregistered local callback" into sc-qpr1-dev
diff --git a/thermal/2.0/vts/functional/VtsHalThermalV2_0TargetTest.cpp b/thermal/2.0/vts/functional/VtsHalThermalV2_0TargetTest.cpp
index 2ee91f4..6c5aca7 100644
--- a/thermal/2.0/vts/functional/VtsHalThermalV2_0TargetTest.cpp
+++ b/thermal/2.0/vts/functional/VtsHalThermalV2_0TargetTest.cpp
@@ -106,9 +106,10 @@
// Note: a real thermal throttling event from the Thermal HAL could be
// inadvertently received here.
TEST_P(ThermalHidlTest, NotifyThrottlingTest) {
- auto ret = mThermalCallback->notifyThrottling(kThrottleTemp);
+ sp<ThermalCallback> thermalCallback = new (std::nothrow) ThermalCallback();
+ auto ret = thermalCallback->notifyThrottling(kThrottleTemp);
ASSERT_TRUE(ret.isOk());
- auto res = mThermalCallback->WaitForCallback(kCallbackNameNotifyThrottling);
+ auto res = thermalCallback->WaitForCallback(kCallbackNameNotifyThrottling);
EXPECT_TRUE(res.no_timeout);
ASSERT_TRUE(res.args);
EXPECT_EQ(kThrottleTemp, res.args->temperature);