1#!/usr/bin/env python3.4 2# 3# Copyright 2022 - The Android Open Source Project 4# 5# Licensed under the Apache License, Version 2.0 (the "License"); 6# you may not use this file except in compliance with the License. 7# You may obtain a copy of the License at 8# 9# http://www.apache.org/licenses/LICENSE-2.0 10# 11# Unless required by applicable law or agreed to in writing, software 12# distributed under the License is distributed on an "AS IS" BASIS, 13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14# See the License for the specific language governing permissions and 15# limitations under the License. 16 17import time 18 19from acts.test_decorators import test_tracker_info 20from acts_contrib.test_utils.tel.TelephonyBaseTest import TelephonyBaseTest 21from acts_contrib.test_utils.tel.tel_atten_utils import set_rssi 22from acts_contrib.test_utils.tel.tel_defines import MAX_RSSI_RESERVED_VALUE 23from acts_contrib.test_utils.tel.tel_defines import MIN_RSSI_RESERVED_VALUE 24from acts_contrib.test_utils.tel.tel_defines import MAX_WAIT_TIME_NW_SELECTION 25from acts_contrib.test_utils.tel.tel_defines import NETWORK_SERVICE_DATA 26from acts_contrib.test_utils.tel.tel_defines import GEN_4G 27from acts_contrib.test_utils.tel.tel_data_utils import active_file_download_test 28from acts_contrib.test_utils.tel.tel_data_utils import wait_for_cell_data_connection 29from acts_contrib.test_utils.tel.tel_data_utils import wait_for_wifi_data_connection 30from acts_contrib.test_utils.tel.tel_phone_setup_utils import ensure_network_generation 31from acts_contrib.test_utils.tel.tel_test_utils import toggle_airplane_mode 32from acts_contrib.test_utils.tel.tel_test_utils import verify_internet_connection 33from acts_contrib.test_utils.tel.tel_test_utils import get_telephony_signal_strength 34from acts_contrib.test_utils.tel.tel_test_utils import reboot_device 35from acts_contrib.test_utils.tel.tel_wifi_utils import ensure_wifi_connected 36from acts_contrib.test_utils.tel.tel_wifi_utils import get_wifi_signal_strength 37from acts.utils import adb_shell_ping 38from acts.libs.utils.multithread import run_multithread_func 39 40# Attenuator name 41ATTEN_NAME_FOR_WIFI_2G = 'wifi0' 42ATTEN_NAME_FOR_WIFI_5G = 'wifi1' 43ATTEN_NAME_FOR_CELL_3G = 'cell0' 44ATTEN_NAME_FOR_CELL_4G = 'cell1' 45 46DEFAULT_PING_DURATION = 120 47DEFAULT_IRAT_DURATION = 60 48 49 50class TelWifiDataTest(TelephonyBaseTest): 51 def setup_class(self): 52 super().setup_class() 53 54 self.stress_test_number = self.get_stress_test_number() 55 56 self.attens = {} 57 for atten in self.attenuators: 58 self.attens[atten.path] = atten 59 attentuator_name_list = [ 60 ATTEN_NAME_FOR_WIFI_2G, ATTEN_NAME_FOR_WIFI_5G, 61 ATTEN_NAME_FOR_CELL_3G, ATTEN_NAME_FOR_CELL_4G 62 ] 63 for atten_name in attentuator_name_list: 64 set_rssi(self.log, self.attens[atten_name], 0, 65 MAX_RSSI_RESERVED_VALUE) 66 67 def teardown_test(self): 68 super().teardown_test() 69 set_rssi(self.log, self.attens[ATTEN_NAME_FOR_WIFI_2G], 0, 70 MAX_RSSI_RESERVED_VALUE) 71 set_rssi(self.log, self.attens[ATTEN_NAME_FOR_WIFI_5G], 0, 72 MAX_RSSI_RESERVED_VALUE) 73 set_rssi(self.log, self.attens[ATTEN_NAME_FOR_CELL_3G], 0, 74 MAX_RSSI_RESERVED_VALUE) 75 set_rssi(self.log, self.attens[ATTEN_NAME_FOR_CELL_4G], 0, 76 MAX_RSSI_RESERVED_VALUE) 77 return True 78 79 def _basic_connectivity_check(self): 80 """ 81 Set Attenuator Value for WiFi and Cell to 0 82 Make sure DUT get Cell Data coverage (LTE) 83 Make sure DUT WiFi is connected 84 """ 85 ad = self.android_devices[0] 86 toggle_airplane_mode(self.log, ad, False) 87 if not ensure_network_generation(self.log, ad, GEN_4G, 88 MAX_WAIT_TIME_NW_SELECTION, 89 NETWORK_SERVICE_DATA): 90 return False 91 92 if not ensure_wifi_connected(self.log, ad, self.wifi_network_ssid, 93 self.wifi_network_pass): 94 ad.log.error("connect WiFi failed") 95 return False 96 return True 97 98 def _atten_setup_wifi_cell(self): 99 set_rssi(self.log, self.attens[ATTEN_NAME_FOR_WIFI_2G], 0, 100 MAX_RSSI_RESERVED_VALUE) 101 set_rssi(self.log, self.attens[ATTEN_NAME_FOR_WIFI_5G], 0, 102 MAX_RSSI_RESERVED_VALUE) 103 set_rssi(self.log, self.attens[ATTEN_NAME_FOR_CELL_3G], 0, 104 MAX_RSSI_RESERVED_VALUE) 105 set_rssi(self.log, self.attens[ATTEN_NAME_FOR_CELL_4G], 0, 106 MAX_RSSI_RESERVED_VALUE) 107 108 def _atten_setup_cell_only(self): 109 set_rssi(self.log, self.attens[ATTEN_NAME_FOR_WIFI_2G], 0, 110 MIN_RSSI_RESERVED_VALUE) 111 set_rssi(self.log, self.attens[ATTEN_NAME_FOR_WIFI_5G], 0, 112 MIN_RSSI_RESERVED_VALUE) 113 set_rssi(self.log, self.attens[ATTEN_NAME_FOR_CELL_3G], 0, 114 MAX_RSSI_RESERVED_VALUE) 115 set_rssi(self.log, self.attens[ATTEN_NAME_FOR_CELL_4G], 0, 116 MAX_RSSI_RESERVED_VALUE) 117 118 def _atten_setup_lte_only(self): 119 set_rssi(self.log, self.attens[ATTEN_NAME_FOR_WIFI_2G], 0, 120 MIN_RSSI_RESERVED_VALUE) 121 set_rssi(self.log, self.attens[ATTEN_NAME_FOR_WIFI_5G], 0, 122 MIN_RSSI_RESERVED_VALUE) 123 set_rssi(self.log, self.attens[ATTEN_NAME_FOR_CELL_3G], 0, 124 MAX_RSSI_RESERVED_VALUE) 125 set_rssi(self.log, self.attens[ATTEN_NAME_FOR_CELL_4G], 0, 126 MAX_RSSI_RESERVED_VALUE) 127 128 def _atten_setup_wcdma_only(self): 129 set_rssi(self.log, self.attens[ATTEN_NAME_FOR_WIFI_2G], 0, 130 MIN_RSSI_RESERVED_VALUE) 131 set_rssi(self.log, self.attens[ATTEN_NAME_FOR_WIFI_5G], 0, 132 MIN_RSSI_RESERVED_VALUE) 133 set_rssi(self.log, self.attens[ATTEN_NAME_FOR_CELL_3G], 0, 134 MAX_RSSI_RESERVED_VALUE) 135 set_rssi(self.log, self.attens[ATTEN_NAME_FOR_CELL_4G], 0, 136 MIN_RSSI_RESERVED_VALUE) 137 138 def _atten_setup_wifi_only(self): 139 set_rssi(self.log, self.attens[ATTEN_NAME_FOR_WIFI_2G], 0, 140 MAX_RSSI_RESERVED_VALUE) 141 set_rssi(self.log, self.attens[ATTEN_NAME_FOR_WIFI_5G], 0, 142 MAX_RSSI_RESERVED_VALUE) 143 set_rssi(self.log, self.attens[ATTEN_NAME_FOR_CELL_3G], 0, 144 MIN_RSSI_RESERVED_VALUE) 145 set_rssi(self.log, self.attens[ATTEN_NAME_FOR_CELL_4G], 0, 146 MIN_RSSI_RESERVED_VALUE) 147 148 def _atten_setup_no_service(self): 149 set_rssi(self.log, self.attens[ATTEN_NAME_FOR_WIFI_2G], 0, 150 MIN_RSSI_RESERVED_VALUE) 151 set_rssi(self.log, self.attens[ATTEN_NAME_FOR_WIFI_5G], 0, 152 MIN_RSSI_RESERVED_VALUE) 153 set_rssi(self.log, self.attens[ATTEN_NAME_FOR_CELL_3G], 0, 154 MIN_RSSI_RESERVED_VALUE) 155 set_rssi(self.log, self.attens[ATTEN_NAME_FOR_CELL_4G], 0, 156 MIN_RSSI_RESERVED_VALUE) 157 158 @TelephonyBaseTest.tel_test_wrap 159 def _wifi_cell_irat_task(self, ad, irat_wait_time=60): 160 """ 161 Atten only WiFi to MIN and MAX 162 WiFi --> Cellular 163 """ 164 self._atten_setup_wifi_cell() 165 if (not wait_for_wifi_data_connection(self.log, ad, True, 166 irat_wait_time) 167 or not verify_internet_connection(self.log, ad)): 168 ad.log.error("Data not on WiFi") 169 get_telephony_signal_strength(ad) 170 get_wifi_signal_strength(ad) 171 return False 172 173 ad.log.info("Triggering WiFi to Cellular IRAT") 174 self._atten_setup_cell_only() 175 if (not wait_for_cell_data_connection(self.log, ad, True, 176 irat_wait_time) 177 or not verify_internet_connection(self.log, ad)): 178 ad.log.error("Data not on Cell") 179 get_telephony_signal_strength(ad) 180 get_wifi_signal_strength(ad) 181 return False 182 return True 183 184 @test_tracker_info(uuid="b223f74b-59f4-4eec-8785-67420bd96bd1") 185 @TelephonyBaseTest.tel_test_wrap 186 def test_wifi_cell_irat_stress_ping_continuous(self): 187 """Test for data switch between WiFi and Cell. DUT go in and out WiFi 188 coverage for multiple times. 189 190 Steps: 191 1. Set WiFi and Cellular signal to good (attenuation value to MIN). 192 2. Make sure DUT get Cell data coverage (LTE) and WiFi connected. 193 3. Set WiFi RSSI to MAX (WiFi attenuator value to MIN). 194 4. Verify DUT report WiFi connected and Internet access OK. 195 5. Set WiFi RSSI to MIN (WiFi attenuator value to MAX). 196 6. Verify DUT report Cellular Data connected and Internet access OK. 197 7. Repeat Step 3~6 for stress number. 198 199 Expected Results: 200 4. DUT report WiFi connected and Internet access OK. 201 6. DUT report Cellular Data connected and Internet access OK. 202 7. Stress test should pass. 203 204 Returns: 205 True if Pass. False if fail. 206 """ 207 if not self._basic_connectivity_check(): 208 self.log.error("Basic Connectivity Check Failed") 209 return False 210 211 total_iteration = self.stress_test_number 212 ad = self.android_devices[0] 213 ping_task = (adb_shell_ping, (ad, DEFAULT_PING_DURATION, 214 "www.google.com", 200, 40)) 215 irat_task = (self._wifi_cell_irat_task, (ad, DEFAULT_IRAT_DURATION)) 216 current_iteration = 1 217 while (current_iteration <= total_iteration): 218 self.log.info(">----Current iteration = %d/%d----<", 219 current_iteration, total_iteration) 220 results = run_multithread_func(self.log, [ping_task, irat_task]) 221 if not results[1]: 222 ad.log.error("Data IRAT failed in active ICMP transfer") 223 break 224 if results[0]: 225 ad.log.info("ICMP transfer succeeded with parallel IRAT") 226 else: 227 ad.log.error("ICMP transfer failed with parallel IRAT") 228 break 229 self.log.info(">----Iteration : %d/%d succeed.----<", 230 current_iteration, total_iteration) 231 current_iteration += 1 232 if current_iteration <= total_iteration: 233 self.log.info(">----Iteration : %d/%d failed.----<", 234 current_iteration, total_iteration) 235 return False 236 else: 237 return True 238 239 @test_tracker_info(uuid="72d2aa4d-c395-417e-99c5-12dc22ea90a1") 240 @TelephonyBaseTest.tel_test_wrap 241 def test_wifi_cell_irat_stress_http_dl(self): 242 """Test for data switch between WiFi and Cell. DUT go in and out WiFi 243 coverage for multiple times. 244 245 Steps: 246 1. Set WiFi and Cellular signal to good (attenuation value to MIN). 247 2. Make sure DUT get Cell data coverage (LTE) and WiFi connected. 248 3. Set WiFi RSSI to MAX (WiFi attenuator value to MIN). 249 4. Verify DUT report WiFi connected and able to download file 250 5. Set WiFi RSSI to MIN (WiFi attenuator value to MAX). 251 6. Verify DUT report Cellular Data connected and able to download file 252 7. Repeat Step 3~6 for stress number. 253 254 Expected Results: 255 4. DUT report WiFi connected and able to download file 256 6. DUT report Cellular Data connected and able to download file 257 7. Stress test should pass. 258 259 Returns: 260 True if Pass. False if fail. 261 """ 262 ad = self.android_devices[0] 263 if not self._basic_connectivity_check(): 264 self.log.error("Basic Connectivity Check Failed") 265 return False 266 267 total_iteration = self.stress_test_number 268 self.log.info("Stress test. Total iteration = %d.", total_iteration) 269 current_iteration = 1 270 while (current_iteration <= total_iteration): 271 self.log.info(">----Current iteration = %d/%d----<", 272 current_iteration, total_iteration) 273 274 self._atten_setup_wifi_cell() 275 if (not wait_for_wifi_data_connection(self.log, ad, True)): 276 ad.log.error("Data not on WiFi") 277 get_telephony_signal_strength(ad) 278 get_wifi_signal_strength(ad) 279 break 280 281 ad.on_mobile_data = False 282 if not active_file_download_test(self.log, ad): 283 ad.log.error("HTTP file download failed on WiFi") 284 get_telephony_signal_strength(ad) 285 get_wifi_signal_strength(ad) 286 break 287 288 self._atten_setup_cell_only() 289 if (not wait_for_cell_data_connection(self.log, ad, True)): 290 ad.log.error("Data not on Cell") 291 get_telephony_signal_strength(ad) 292 get_wifi_signal_strength(ad) 293 break 294 295 ad.on_mobile_data = True 296 if not active_file_download_test(self.log, ad): 297 ad.log.error("HTTP file download failed on cell") 298 get_telephony_signal_strength(ad) 299 get_wifi_signal_strength(ad) 300 break 301 302 self.log.info(">----Iteration : %d/%d succeed.----<", 303 current_iteration, total_iteration) 304 current_iteration += 1 305 306 if current_iteration <= total_iteration: 307 self.log.info(">----Iteration : %d/%d failed.----<", 308 current_iteration, total_iteration) 309 return False 310 else: 311 return True 312 313 @test_tracker_info(uuid="bce71469-114c-489f-b9c4-26c53c29a553") 314 @TelephonyBaseTest.tel_test_wrap 315 def test_wifi_cell_irat_stress_ping(self): 316 """Test for data switch between WiFi and Cell. DUT go in and out WiFi 317 coverage for multiple times. 318 319 Steps: 320 1. Set WiFi and Cellular signal to good (attenuation value to MIN). 321 2. Make sure DUT get Cell data coverage (LTE) and WiFi connected. 322 3. Set WiFi RSSI to MAX (WiFi attenuator value to MIN). 323 4. Verify DUT report WiFi connected and Internet access OK. 324 5. Set WiFi RSSI to MIN (WiFi attenuator value to MAX). 325 6. Verify DUT report Cellular Data connected and Internet access OK. 326 7. Repeat Step 3~6 for stress number. 327 328 Expected Results: 329 4. DUT report WiFi connected and Internet access OK. 330 6. DUT report Cellular Data connected and Internet access OK. 331 7. Stress test should pass. 332 333 Returns: 334 True if Pass. False if fail. 335 """ 336 ad = self.android_devices[0] 337 if not self._basic_connectivity_check(): 338 self.log.error("Basic Connectivity Check Failed") 339 return False 340 341 total_iteration = self.stress_test_number 342 self.log.info("Stress test. Total iteration = %d.", total_iteration) 343 current_iteration = 1 344 while (current_iteration <= total_iteration): 345 self.log.info(">----Current iteration = %d/%d----<", 346 current_iteration, total_iteration) 347 348 self._atten_setup_wifi_cell() 349 if (not wait_for_wifi_data_connection(self.log, ad, True) 350 or not verify_internet_connection(self.log, ad)): 351 ad.log.error("Data not on WiFi") 352 get_telephony_signal_strength(ad) 353 get_wifi_signal_strength(ad) 354 break 355 356 self._atten_setup_cell_only() 357 if (not wait_for_cell_data_connection(self.log, ad, True) 358 or not verify_internet_connection(self.log, ad)): 359 ad.log.error("Data not on Cell") 360 get_telephony_signal_strength(ad) 361 get_wifi_signal_strength(ad) 362 break 363 364 self.log.info(">----Iteration : %d/%d succeed.----<", 365 current_iteration, total_iteration) 366 current_iteration += 1 367 if current_iteration <= total_iteration: 368 self.log.info(">----Iteration : %d/%d failed.----<", 369 current_iteration, total_iteration) 370 return False 371 else: 372 return True 373 374 @test_tracker_info(uuid="696f22ef-39cd-4e15-bbb2-f836d2ee47f1") 375 @TelephonyBaseTest.tel_test_wrap 376 def test_wifi_only_http_dl(self): 377 """Test for 10MB file download on WiFi Only 378 379 Steps: 380 1. Set WiFi atten to MIN and Cellular to MAX 381 2. Start downloading 1GB file from net 382 3. Verify is the download is successfull 383 384 Expected Results: 385 1. File should download over WiFi 386 387 Returns: 388 True if Pass. False if fail. 389 """ 390 ad = self.android_devices[0] 391 if not self._basic_connectivity_check(): 392 self.log.error("Basic Connectivity Check Failed") 393 return False 394 self._atten_setup_wifi_only() 395 if (not wait_for_wifi_data_connection(self.log, ad, True) 396 or not verify_internet_connection(self.log, ad)): 397 ad.log.error("Data not on WiFi") 398 get_telephony_signal_strength(ad) 399 get_wifi_signal_strength(ad) 400 return False 401 ad.on_mobile_data = False 402 if not active_file_download_test(self.log, ad, "10MB"): 403 ad.log.error("HTTP file download failed on WiFi") 404 get_telephony_signal_strength(ad) 405 get_wifi_signal_strength(ad) 406 return False 407 return True 408 409 @test_tracker_info(uuid="6c9bf89b-5469-4b08-acf4-0ef651b1a318") 410 @TelephonyBaseTest.tel_test_wrap 411 def test_lte_only_http_dl(self): 412 """Test for 1GB file download on WiFi Only 413 414 Steps: 415 1. Set WiFi atten to MIN and Cellular to MAX 416 2. Start downloading 1GB file from net 417 3. Verify is the download is successfull 418 419 Expected Results: 420 1. File should download over WiFi 421 422 Returns: 423 True if Pass. False if fail. 424 """ 425 ad = self.android_devices[0] 426 if not self._basic_connectivity_check(): 427 self.log.error("Basic Connectivity Check Failed") 428 return False 429 self._atten_setup_lte_only() 430 if (not wait_for_cell_data_connection(self.log, ad, True) 431 or not verify_internet_connection(self.log, ad)): 432 ad.log.error("Data not on LTE") 433 get_telephony_signal_strength(ad) 434 get_wifi_signal_strength(ad) 435 return False 436 ad.on_mobile_data = True 437 if not active_file_download_test(self.log, ad, "512MB"): 438 ad.log.error("HTTP file download failed on LTE") 439 get_telephony_signal_strength(ad) 440 get_wifi_signal_strength(ad) 441 return False 442 return True 443 444 @test_tracker_info(uuid="ba183bde-6763-411a-ad29-7f1e96479950") 445 @TelephonyBaseTest.tel_test_wrap 446 def test_lte_oos_lte_camping(self): 447 """Test for Out Of Service Scenarios 448 449 Steps: 450 1. Set WiFi and Cell available 451 2. Setup Attenuator as No Service Scenario 452 3. Verify there is no LTE or WiFi Signal 453 4. Wait for 2 mins 454 5. Setup Attenuator as Cellular only service 455 6. Verify Data Connection 456 457 Expected Results: 458 1. Device should camp back on LTE after OOS 459 2. Data should be in working state 460 461 Returns: 462 True if Pass. False if fail. 463 """ 464 ad = self.android_devices[0] 465 if not self._basic_connectivity_check(): 466 self.log.error("Basic Connectivity Check Failed") 467 return False 468 self._atten_setup_no_service() 469 ad.log.info("Waiting for 1 min") 470 time.sleep(60) 471 if (wait_for_cell_data_connection(self.log, ad, True) or 472 wait_for_wifi_data_connection(self.log, ad, True)): 473 ad.log.error("Data is available, Expecting no Cellular/WiFi Signal") 474 get_telephony_signal_strength(ad) 475 get_wifi_signal_strength(ad) 476 return False 477 ad.log.info("Waiting for 2 mins") 478 time.sleep(120) 479 self._atten_setup_lte_only() 480 ad.on_mobile_data = True 481 if (not wait_for_cell_data_connection(self.log, ad, True) 482 or not verify_internet_connection(self.log, ad)): 483 ad.log.error("Data not on LTE") 484 get_telephony_signal_strength(ad) 485 get_wifi_signal_strength(ad) 486 return False 487 return True 488 489 @test_tracker_info(uuid="c5581e04-4589-4f32-b1f9-76f0b16666ce") 490 @TelephonyBaseTest.tel_test_wrap 491 def test_modem_power_poor_coverage(self): 492 """Connectivity Monitor reports Poor Coverage to User 493 494 Steps: 495 1. Set WiFi, Cellular atten to MAX 496 2. Wait for X amount of time 497 3. Verify if the user gets a notification on UI 498 499 Expected Results: 500 1. User gets notification "Cellular battery issue: Poor coverage" 501 502 Returns: 503 True if Pass. False if fail. 504 """ 505 ad = self.android_devices[0] 506 # Ensure apk is installed 507 monitor_apk = None 508 for apk in ("com.google.telephonymonitor", 509 "com.google.android.connectivitymonitor"): 510 if ad.is_apk_installed(apk): 511 ad.log.info("apk %s is installed", apk) 512 monitor_apk = apk 513 break 514 if not monitor_apk: 515 ad.log.info( 516 "ConnectivityMonitor|TelephonyMonitor is not installed") 517 return False 518 519 # Ensure apk is running 520 ad.adb.shell( 521 "am start -n com.android.settings/.DevelopmentSettings", 522 ignore_status=True) 523 for cmd in ("setprop persist.radio.enable_tel_mon user_enabled", 524 "setprop persist.radio.con_mon_hbeat 15000"): 525 ad.log.info(cmd) 526 ad.adb.shell(cmd) 527 ad.log.info("reboot to bring up %s", monitor_apk) 528 reboot_device(ad) 529 for i in range(30): 530 if ad.is_apk_running(monitor_apk): 531 ad.log.info("%s is running after reboot", monitor_apk) 532 break 533 elif i == 19: 534 ad.log.error("%s is not running after reboot", 535 monitor_apk) 536 return False 537 else: 538 ad.log.info( 539 "%s is not running after reboot. Wait and check again", 540 monitor_apk) 541 time.sleep(30) 542 543 # Setup all Notify Poor Coverage params 544 for cmd in ("am broadcast -a " 545 "com.google.gservices.intent.action.GSERVICES_OVERRIDE " 546 "-e \"ce.cm.bi.c.notify_poor_coverage\" \"true\"", 547 "am broadcast -a " 548 "com.google.gservices.intent.action.GSERVICES_OVERRIDE " 549 "-e \"ce.cm.bi.c.max_time_lowest_signal_strength_level_ms\" \"1\"", 550 "am broadcast -a " 551 "com.google.gservices.intent.action.GSERVICES_OVERRIDE " 552 "-e \"ce.cm.bi.c.max_temperature_c\" \"1\"", 553 "dumpsys battery set usb 0"): 554 time.sleep(1) 555 ad.log.info(cmd) 556 ad.adb.shell(cmd) 557 558 # Make Chamber ready for test 559 self._atten_setup_no_service() 560 ad.log.info("Waiting 1 min for attens to settle") 561 time.sleep(60) 562 if (wait_for_cell_data_connection(self.log, ad, True) or 563 wait_for_wifi_data_connection(self.log, ad, True)): 564 ad.log.error("Data is available, Expecting no Cellular/WiFi Signal") 565 get_telephony_signal_strength(ad) 566 get_wifi_signal_strength(ad) 567 return False 568 ad.log.info("Wait time for 2 CM Heart Beats") 569 time.sleep(60) 570 ad.log.info("dumpsys battery set usb 1") 571 ad.adb.shell("dumpsys battery set usb 1") 572 if ad.search_logcat( 573 "Bugreport notification title Cellular battery drain"): 574 ad.log.info("User got Poor coverage notification") 575 else: 576 ad.log.error("User didn't get Poor coverage notification") 577 result = False 578 return True 579 580 581if __name__ == "__main__": 582 raise Exception("Cannot run this class directly") 583