blob: b3ab594445c27943f70644d6365be0ede8b3c1a3 [file] [log] [blame]
Wyatt Riley6c26ed72017-02-21 17:21:53 -08001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#define LOG_TAG "VtsHalGnssV1_0TargetTest"
18#include <android/hardware/gnss/1.0/IGnss.h>
Steven Moreland4e7a3072017-04-06 12:15:23 -070019#include <log/log.h>
Wyatt Riley6c26ed72017-02-21 17:21:53 -080020
Yuexi Maed2bb4e2017-03-10 00:44:45 -080021#include <VtsHalHidlTargetTestBase.h>
Wyatt Riley6c26ed72017-02-21 17:21:53 -080022
23#include <chrono>
24#include <condition_variable>
25#include <mutex>
26
27using android::hardware::Return;
28using android::hardware::Void;
29
30using android::hardware::gnss::V1_0::GnssLocation;
31using android::hardware::gnss::V1_0::GnssLocationFlags;
32using android::hardware::gnss::V1_0::IGnss;
33using android::hardware::gnss::V1_0::IGnssCallback;
Wyatt Rileyc1399592017-03-22 14:08:26 -070034using android::hardware::gnss::V1_0::IGnssDebug;
35using android::hardware::gnss::V1_0::IGnssMeasurement;
Wyatt Riley6c26ed72017-02-21 17:21:53 -080036using android::sp;
37
Wyatt Riley0ee0cfb2017-04-04 12:34:53 -070038#define TIMEOUT_SEC 2 // for basic commands/responses
Wyatt Riley6c26ed72017-02-21 17:21:53 -080039
Wyatt Riley0ee0cfb2017-04-04 12:34:53 -070040// for command line argument on how strictly to run the test
41bool sAgpsIsPresent = false; // if SUPL or XTRA assistance available
Wyatt Riley94c7a042017-06-15 17:16:24 -070042bool sSignalIsWeak = false; // if GNSS signals are weak (e.g. light indoor)
Wyatt Rileyc1399592017-03-22 14:08:26 -070043
Wyatt Riley6c26ed72017-02-21 17:21:53 -080044// The main test class for GNSS HAL.
Yuexi Maed2bb4e2017-03-10 00:44:45 -080045class GnssHalTest : public ::testing::VtsHalHidlTargetTestBase {
Wyatt Riley6c26ed72017-02-21 17:21:53 -080046 public:
47 virtual void SetUp() override {
Wyatt Riley917640b2017-03-16 16:25:55 -070048 // Clean between tests
49 capabilities_called_count_ = 0;
50 location_called_count_ = 0;
51 info_called_count_ = 0;
Wyatt Riley6ec696b2017-06-19 14:42:34 -070052 notify_count_ = 0;
Wyatt Riley6c26ed72017-02-21 17:21:53 -080053
Yuexi Maed2bb4e2017-03-10 00:44:45 -080054 gnss_hal_ = ::testing::VtsHalHidlTargetTestBase::getService<IGnss>();
Wyatt Riley6c26ed72017-02-21 17:21:53 -080055 ASSERT_NE(gnss_hal_, nullptr);
56
57 gnss_cb_ = new GnssCallback(*this);
58 ASSERT_NE(gnss_cb_, nullptr);
59
60 auto result = gnss_hal_->setCallback(gnss_cb_);
61 if (!result.isOk()) {
Wyatt Riley917640b2017-03-16 16:25:55 -070062 ALOGE("result of failed setCallback %s", result.description().c_str());
Wyatt Riley6c26ed72017-02-21 17:21:53 -080063 }
64
65 ASSERT_TRUE(result.isOk());
66 ASSERT_TRUE(result);
67
Wyatt Riley917640b2017-03-16 16:25:55 -070068 /*
69 * At least one callback should trigger - it may be capabilites, or
70 * system info first, so wait again if capabilities not received.
Wyatt Riley6c26ed72017-02-21 17:21:53 -080071 */
Wyatt Riley917640b2017-03-16 16:25:55 -070072 EXPECT_EQ(std::cv_status::no_timeout, wait(TIMEOUT_SEC));
73 if (capabilities_called_count_ == 0) {
74 EXPECT_EQ(std::cv_status::no_timeout, wait(TIMEOUT_SEC));
75 }
76
77 /*
78 * Generally should be 1 capabilites callback -
79 * or possibly 2 in some recovery cases (default cached & refreshed)
80 */
81 EXPECT_GE(capabilities_called_count_, 1);
82 EXPECT_LE(capabilities_called_count_, 2);
83
84 /*
85 * Clear notify/waiting counter, allowing up till the timeout after
86 * the last reply for final startup messages to arrive (esp. system
87 * info.)
88 */
89 while (wait(TIMEOUT_SEC) == std::cv_status::no_timeout) {
90 }
Wyatt Riley6c26ed72017-02-21 17:21:53 -080091 }
92
93 virtual void TearDown() override {
94 if (gnss_hal_ != nullptr) {
95 gnss_hal_->cleanup();
96 }
Wyatt Riley6ec696b2017-06-19 14:42:34 -070097 if (notify_count_ > 0) {
98 ALOGW("%d unprocessed callbacks discarded", notify_count_);
99 }
Wyatt Riley6c26ed72017-02-21 17:21:53 -0800100 }
101
102 /* Used as a mechanism to inform the test that a callback has occurred */
103 inline void notify() {
104 std::unique_lock<std::mutex> lock(mtx_);
Wyatt Riley6ec696b2017-06-19 14:42:34 -0700105 notify_count_++;
Wyatt Riley6c26ed72017-02-21 17:21:53 -0800106 cv_.notify_one();
107 }
108
109 /* Test code calls this function to wait for a callback */
110 inline std::cv_status wait(int timeoutSeconds) {
111 std::unique_lock<std::mutex> lock(mtx_);
112
113 std::cv_status status = std::cv_status::no_timeout;
114 auto now = std::chrono::system_clock::now();
Wyatt Riley6ec696b2017-06-19 14:42:34 -0700115 while (notify_count_ == 0) {
116 status = cv_.wait_until(lock, now + std::chrono::seconds(timeoutSeconds));
117 if (status == std::cv_status::timeout) return status;
Wyatt Riley6c26ed72017-02-21 17:21:53 -0800118 }
Wyatt Riley6ec696b2017-06-19 14:42:34 -0700119 notify_count_--;
Wyatt Riley6c26ed72017-02-21 17:21:53 -0800120 return status;
121 }
122
Wyatt Riley94c7a042017-06-15 17:16:24 -0700123 /*
124 * StartAndGetSingleLocation:
125 * Helper function to get one Location and check fields
126 *
127 * returns true if a location was successfully generated
128 */
129 bool StartAndGetSingleLocation(bool checkAccuracies) {
130 auto result = gnss_hal_->start();
131
132 EXPECT_TRUE(result.isOk());
133 EXPECT_TRUE(result);
134
135 /*
136 * GPS signals initially optional for this test, so don't expect fast fix,
137 * or no timeout, unless signal is present
138 */
139 int firstGnssLocationTimeoutSeconds = sAgpsIsPresent ? 15 : 45;
140 if (sSignalIsWeak) {
141 // allow more time for weak signals
142 firstGnssLocationTimeoutSeconds += 30;
143 }
144
145 wait(firstGnssLocationTimeoutSeconds);
146 if (sAgpsIsPresent) {
147 EXPECT_EQ(location_called_count_, 1);
148 }
149 if (location_called_count_ > 0) {
Wyatt Rileyadca98d2017-10-26 16:37:30 -0700150 // don't require speed on first fix
151 CheckLocation(last_location_, checkAccuracies, false);
Wyatt Riley94c7a042017-06-15 17:16:24 -0700152 return true;
153 }
154 return false;
155 }
156
157 /*
158 * StopAndClearLocations:
159 * Helper function to stop locations
160 *
161 * returns true if a location was successfully generated
162 */
163 void StopAndClearLocations() {
164 auto result = gnss_hal_->stop();
165
166 EXPECT_TRUE(result.isOk());
167 EXPECT_TRUE(result);
168
169 /*
170 * Clear notify/waiting counter, allowing up till the timeout after
171 * the last reply for final startup messages to arrive (esp. system
172 * info.)
173 */
174 while (wait(TIMEOUT_SEC) == std::cv_status::no_timeout) {
175 }
176 }
177
178 /*
179 * CheckLocation:
Wyatt Rileyadca98d2017-10-26 16:37:30 -0700180 * Helper function to vet Location fields
Wyatt Riley94c7a042017-06-15 17:16:24 -0700181 */
Wyatt Rileyadca98d2017-10-26 16:37:30 -0700182 void CheckLocation(GnssLocation& location, bool checkAccuracies, bool checkSpeed) {
Wyatt Riley94c7a042017-06-15 17:16:24 -0700183 EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_LAT_LONG);
184 EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_ALTITUDE);
Wyatt Rileyadca98d2017-10-26 16:37:30 -0700185 if (checkSpeed) {
186 EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_SPEED);
187 }
Wyatt Riley94c7a042017-06-15 17:16:24 -0700188 EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_HORIZONTAL_ACCURACY);
189 // New uncertainties available in O must be provided,
190 // at least when paired with modern hardware (2017+)
191 if (checkAccuracies) {
192 EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_VERTICAL_ACCURACY);
Wyatt Rileyadca98d2017-10-26 16:37:30 -0700193 if (checkSpeed) {
194 EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_SPEED_ACCURACY);
195 if (location.gnssLocationFlags & GnssLocationFlags::HAS_BEARING) {
196 EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_BEARING_ACCURACY);
197 }
Wyatt Riley94c7a042017-06-15 17:16:24 -0700198 }
199 }
200 EXPECT_GE(location.latitudeDegrees, -90.0);
201 EXPECT_LE(location.latitudeDegrees, 90.0);
202 EXPECT_GE(location.longitudeDegrees, -180.0);
203 EXPECT_LE(location.longitudeDegrees, 180.0);
204 EXPECT_GE(location.altitudeMeters, -1000.0);
205 EXPECT_LE(location.altitudeMeters, 30000.0);
Wyatt Rileyadca98d2017-10-26 16:37:30 -0700206 if (checkSpeed) {
207 EXPECT_GE(location.speedMetersPerSec, 0.0);
208 EXPECT_LE(location.speedMetersPerSec, 5.0); // VTS tests are stationary.
Wyatt Riley94c7a042017-06-15 17:16:24 -0700209
Wyatt Rileyadca98d2017-10-26 16:37:30 -0700210 // Non-zero speeds must be reported with an associated bearing
211 if (location.speedMetersPerSec > 0.0) {
212 EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_BEARING);
213 }
Wyatt Riley94c7a042017-06-15 17:16:24 -0700214 }
215
216 /*
217 * Tolerating some especially high values for accuracy estimate, in case of
218 * first fix with especially poor geometry (happens occasionally)
219 */
220 EXPECT_GT(location.horizontalAccuracyMeters, 0.0);
221 EXPECT_LE(location.horizontalAccuracyMeters, 250.0);
222
223 /*
224 * Some devices may define bearing as -180 to +180, others as 0 to 360.
225 * Both are okay & understandable.
226 */
227 if (location.gnssLocationFlags & GnssLocationFlags::HAS_BEARING) {
228 EXPECT_GE(location.bearingDegrees, -180.0);
229 EXPECT_LE(location.bearingDegrees, 360.0);
230 }
231 if (location.gnssLocationFlags & GnssLocationFlags::HAS_VERTICAL_ACCURACY) {
232 EXPECT_GT(location.verticalAccuracyMeters, 0.0);
233 EXPECT_LE(location.verticalAccuracyMeters, 500.0);
234 }
235 if (location.gnssLocationFlags & GnssLocationFlags::HAS_SPEED_ACCURACY) {
236 EXPECT_GT(location.speedAccuracyMetersPerSecond, 0.0);
237 EXPECT_LE(location.speedAccuracyMetersPerSecond, 50.0);
238 }
239 if (location.gnssLocationFlags & GnssLocationFlags::HAS_BEARING_ACCURACY) {
240 EXPECT_GT(location.bearingAccuracyDegrees, 0.0);
241 EXPECT_LE(location.bearingAccuracyDegrees, 360.0);
242 }
243
244 // Check timestamp > 1.48e12 (47 years in msec - 1970->2017+)
245 EXPECT_GT(location.timestamp, 1.48e12);
246 }
247
Wyatt Riley6c26ed72017-02-21 17:21:53 -0800248 /* Callback class for data & Event. */
249 class GnssCallback : public IGnssCallback {
Wyatt Riley917640b2017-03-16 16:25:55 -0700250 public:
Wyatt Riley6c26ed72017-02-21 17:21:53 -0800251 GnssHalTest& parent_;
252
Wyatt Riley6c26ed72017-02-21 17:21:53 -0800253 GnssCallback(GnssHalTest& parent) : parent_(parent){};
254
255 virtual ~GnssCallback() = default;
256
257 // Dummy callback handlers
258 Return<void> gnssStatusCb(
Steven Moreland4b523952017-03-08 19:20:30 -0800259 const IGnssCallback::GnssStatusValue /* status */) override {
Wyatt Riley6c26ed72017-02-21 17:21:53 -0800260 return Void();
261 }
262 Return<void> gnssSvStatusCb(
Steven Moreland4b523952017-03-08 19:20:30 -0800263 const IGnssCallback::GnssSvStatus& /* svStatus */) override {
Wyatt Riley6c26ed72017-02-21 17:21:53 -0800264 return Void();
265 }
266 Return<void> gnssNmeaCb(
Steven Moreland4b523952017-03-08 19:20:30 -0800267 int64_t /* timestamp */,
268 const android::hardware::hidl_string& /* nmea */) override {
Wyatt Riley6c26ed72017-02-21 17:21:53 -0800269 return Void();
270 }
271 Return<void> gnssAcquireWakelockCb() override { return Void(); }
272 Return<void> gnssReleaseWakelockCb() override { return Void(); }
273 Return<void> gnssRequestTimeCb() override { return Void(); }
274
275 // Actual (test) callback handlers
276 Return<void> gnssLocationCb(const GnssLocation& location) override {
277 ALOGI("Location received");
278 parent_.location_called_count_++;
279 parent_.last_location_ = location;
280 parent_.notify();
281 return Void();
282 }
283
284 Return<void> gnssSetCapabilitesCb(uint32_t capabilities) override {
285 ALOGI("Capabilities received %d", capabilities);
286 parent_.capabilities_called_count_++;
287 parent_.last_capabilities_ = capabilities;
288 parent_.notify();
289 return Void();
290 }
291
292 Return<void> gnssSetSystemInfoCb(
293 const IGnssCallback::GnssSystemInfo& info) override {
294 ALOGI("Info received, year %d", info.yearOfHw);
295 parent_.info_called_count_++;
296 parent_.last_info_ = info;
297 parent_.notify();
298 return Void();
299 }
300 };
301
302 sp<IGnss> gnss_hal_; // GNSS HAL to call into
303 sp<IGnssCallback> gnss_cb_; // Primary callback interface
304
305 /* Count of calls to set the following items, and the latest item (used by
306 * test.)
307 */
308 int capabilities_called_count_;
309 uint32_t last_capabilities_;
310
311 int location_called_count_;
312 GnssLocation last_location_;
313
314 int info_called_count_;
315 IGnssCallback::GnssSystemInfo last_info_;
316
317 private:
318 std::mutex mtx_;
319 std::condition_variable cv_;
Wyatt Riley6ec696b2017-06-19 14:42:34 -0700320 int notify_count_;
Wyatt Riley6c26ed72017-02-21 17:21:53 -0800321};
322
323/*
324 * SetCallbackCapabilitiesCleanup:
325 * Sets up the callback, awaits the capabilities, and calls cleanup
326 *
327 * Since this is just the basic operation of SetUp() and TearDown(),
Wyatt Riley917640b2017-03-16 16:25:55 -0700328 * the function definition is intentionally empty
Wyatt Riley6c26ed72017-02-21 17:21:53 -0800329 */
330TEST_F(GnssHalTest, SetCallbackCapabilitiesCleanup) {}
331
Wyatt Riley917640b2017-03-16 16:25:55 -0700332/*
Wyatt Riley6c26ed72017-02-21 17:21:53 -0800333 * GetLocation:
334 * Turns on location, waits 45 second for at least 5 locations,
335 * and checks them for reasonable validity.
336 */
337TEST_F(GnssHalTest, GetLocation) {
338#define MIN_INTERVAL_MSEC 500
339#define PREFERRED_ACCURACY 0 // Ideally perfect (matches GnssLocationProvider)
340#define PREFERRED_TIME_MSEC 0 // Ideally immediate
341
Wyatt Riley6c26ed72017-02-21 17:21:53 -0800342#define LOCATION_TIMEOUT_SUBSEQUENT_SEC 3
343#define LOCATIONS_TO_CHECK 5
344
Wyatt Riley917640b2017-03-16 16:25:55 -0700345 bool checkMoreAccuracies =
346 (info_called_count_ > 0 && last_info_.yearOfHw >= 2017);
347
Wyatt Riley6c26ed72017-02-21 17:21:53 -0800348 auto result = gnss_hal_->setPositionMode(
349 IGnss::GnssPositionMode::MS_BASED,
350 IGnss::GnssPositionRecurrence::RECURRENCE_PERIODIC, MIN_INTERVAL_MSEC,
351 PREFERRED_ACCURACY, PREFERRED_TIME_MSEC);
352
353 ASSERT_TRUE(result.isOk());
Wyatt Rileyc1399592017-03-22 14:08:26 -0700354 EXPECT_TRUE(result);
Wyatt Riley6c26ed72017-02-21 17:21:53 -0800355
Wyatt Rileyc1399592017-03-22 14:08:26 -0700356 /*
357 * GPS signals initially optional for this test, so don't expect no timeout
358 * yet
359 */
Wyatt Riley94c7a042017-06-15 17:16:24 -0700360 bool gotLocation = StartAndGetSingleLocation(checkMoreAccuracies);
Wyatt Riley6c26ed72017-02-21 17:21:53 -0800361
Wyatt Riley0ee0cfb2017-04-04 12:34:53 -0700362 if (gotLocation) {
363 for (int i = 1; i < LOCATIONS_TO_CHECK; i++) {
Wyatt Riley94c7a042017-06-15 17:16:24 -0700364 EXPECT_EQ(std::cv_status::no_timeout, wait(LOCATION_TIMEOUT_SUBSEQUENT_SEC));
365 EXPECT_EQ(location_called_count_, i + 1);
Wyatt Rileyadca98d2017-10-26 16:37:30 -0700366 CheckLocation(last_location_, checkMoreAccuracies, true);
Wyatt Riley917640b2017-03-16 16:25:55 -0700367 }
Wyatt Riley6c26ed72017-02-21 17:21:53 -0800368 }
369
Wyatt Riley94c7a042017-06-15 17:16:24 -0700370 StopAndClearLocations();
Wyatt Riley6c26ed72017-02-21 17:21:53 -0800371}
372
Wyatt Rileyc1399592017-03-22 14:08:26 -0700373/*
374 * InjectDelete:
375 * Ensures that calls to inject and/or delete information state are handled.
Wyatt Rileyc1399592017-03-22 14:08:26 -0700376 */
377TEST_F(GnssHalTest, InjectDelete) {
378 // confidently, well north of Alaska
379 auto result = gnss_hal_->injectLocation(80.0, -170.0, 1000.0);
380
Wyatt Rileyc1399592017-03-22 14:08:26 -0700381 ASSERT_TRUE(result.isOk());
382 EXPECT_TRUE(result);
383
384 // fake time, but generally reasonable values (time in Aug. 2018)
385 result = gnss_hal_->injectTime(1534567890123L, 123456L, 10000L);
386
387 ASSERT_TRUE(result.isOk());
388 EXPECT_TRUE(result);
389
390 auto resultVoid = gnss_hal_->deleteAidingData(IGnss::GnssAidingData::DELETE_ALL);
391
392 ASSERT_TRUE(resultVoid.isOk());
Wyatt Riley0ee0cfb2017-04-04 12:34:53 -0700393
394 // Ensure we can get a good location after a bad injection has been deleted
Wyatt Riley94c7a042017-06-15 17:16:24 -0700395 StartAndGetSingleLocation(false);
396
397 StopAndClearLocations();
Wyatt Rileyc1399592017-03-22 14:08:26 -0700398}
399
400/*
401 * GetAllExtentions:
402 * Tries getting all optional extensions, and ensures a valid return
403 * null or actual extension, no crash.
404 * Confirms year-based required extensions (Measurement & Debug) are present
405 */
406TEST_F(GnssHalTest, GetAllExtensions) {
407 // Basic call-is-handled checks
408 auto gnssXtra = gnss_hal_->getExtensionXtra();
409 ASSERT_TRUE(gnssXtra.isOk());
410
411 auto gnssRil = gnss_hal_->getExtensionAGnssRil();
412 ASSERT_TRUE(gnssRil.isOk());
413
414 auto gnssAgnss = gnss_hal_->getExtensionAGnss();
415 ASSERT_TRUE(gnssAgnss.isOk());
416
417 auto gnssNi = gnss_hal_->getExtensionGnssNi();
418 ASSERT_TRUE(gnssNi.isOk());
419
420 auto gnssNavigationMessage = gnss_hal_->getExtensionGnssNavigationMessage();
421 ASSERT_TRUE(gnssNavigationMessage.isOk());
422
423 auto gnssConfiguration = gnss_hal_->getExtensionGnssConfiguration();
424 ASSERT_TRUE(gnssConfiguration.isOk());
425
426 auto gnssGeofencing = gnss_hal_->getExtensionGnssGeofencing();
427 ASSERT_TRUE(gnssGeofencing.isOk());
428
429 auto gnssBatching = gnss_hal_->getExtensionGnssBatching();
430 ASSERT_TRUE(gnssBatching.isOk());
431
432 // Verifying, in some cases, that these return actual extensions
433 auto gnssMeasurement = gnss_hal_->getExtensionGnssMeasurement();
434 ASSERT_TRUE(gnssMeasurement.isOk());
435 if (last_capabilities_ & IGnssCallback::Capabilities::MEASUREMENTS) {
436 sp<IGnssMeasurement> iGnssMeas = gnssMeasurement;
437 EXPECT_NE(iGnssMeas, nullptr);
438 }
439
440 auto gnssDebug = gnss_hal_->getExtensionGnssDebug();
441 ASSERT_TRUE(gnssDebug.isOk());
442 if (info_called_count_ > 0 && last_info_.yearOfHw >= 2017) {
443 sp<IGnssDebug> iGnssDebug = gnssDebug;
444 EXPECT_NE(iGnssDebug, nullptr);
445 }
446}
447
448/*
449 * MeasurementCapabilities:
450 * Verifies that modern hardware supports measurement capabilities.
451 */
452TEST_F(GnssHalTest, MeasurementCapabilites) {
453 if (info_called_count_ > 0 && last_info_.yearOfHw >= 2016) {
454 EXPECT_TRUE(last_capabilities_ & IGnssCallback::Capabilities::MEASUREMENTS);
455 }
456}
457
Wyatt Riley6c26ed72017-02-21 17:21:53 -0800458int main(int argc, char** argv) {
459 ::testing::InitGoogleTest(&argc, argv);
Wyatt Riley0ee0cfb2017-04-04 12:34:53 -0700460 /*
461 * These arguments not used by automated VTS testing.
462 * Only for use in manual testing, when wanting to run
463 * stronger tests that require the presence of GPS signal.
464 */
465 for (int i = 1; i < argc; i++) {
Wyatt Riley94c7a042017-06-15 17:16:24 -0700466 if (strcmp(argv[i], "-agps") == 0) {
467 sAgpsIsPresent = true;
468 } else if (strcmp(argv[i], "-weak") == 0) {
469 sSignalIsWeak = true;
Wyatt Riley0ee0cfb2017-04-04 12:34:53 -0700470 }
471 }
Wyatt Riley6c26ed72017-02-21 17:21:53 -0800472 int status = RUN_ALL_TESTS();
473 ALOGI("Test result = %d", status);
474 return status;
Wyatt Riley94c7a042017-06-15 17:16:24 -0700475}