shill: cellular: Use ConnectionHealthChecker for out-of-credit detection

Added code to trigger active connection monitoring using
ConnectionHealthChecker to detect out-of-credit scenarios, when:

  1. TrafficMonitor detects congestion and thus a possible out-of-credit
     situation;

  2. Portal detection fails after Cellular connects.

BUG=chromium:225912,225915
TEST=1. Build and run unit tests.
     2. While using a link device, run it out of credit. An
        out-of-credit dialog should pop up and the service should
        disconnect,
     3. While on a link device with an out-of-credit SIM, try to connect
        to Cellular. If it successfully connects and the connection
        does not drop, an out-of-credit dialog should pop up and the
        service should disconnect.

Change-Id: If70069c3630757b74099a4cefdfe6c67d8d308de
Reviewed-on: https://gerrit.chromium.org/gerrit/47717
Reviewed-by: Thieu Le <thieule@chromium.org>
Commit-Queue: Arman Uguray <armansito@chromium.org>
Tested-by: Arman Uguray <armansito@chromium.org>
19 files changed
tree: 5ed64948e560d24beee1c24a5090a137c20e9452
  1. bin/
  2. data/
  3. dbus_bindings/
  4. doc/
  5. shims/
  6. test-scripts/
  7. .gitignore
  8. accessor_interface.h
  9. activating_iccid_store.cc
  10. activating_iccid_store.h
  11. activating_iccid_store_unittest.cc
  12. adaptor_interfaces.h
  13. arp_client.cc
  14. arp_client.h
  15. arp_client_unittest.cc
  16. arp_packet.cc
  17. arp_packet.h
  18. arp_packet_unittest.cc
  19. async_connection.cc
  20. async_connection.h
  21. async_connection_unittest.cc
  22. attribute_list.cc
  23. attribute_list.h
  24. byte_string.cc
  25. byte_string.h
  26. byte_string_unittest.cc
  27. callback80211_metrics.cc
  28. callback80211_metrics.h
  29. callbacks.h
  30. cellular.cc
  31. cellular.h
  32. cellular_capability.cc
  33. cellular_capability.h
  34. cellular_capability_cdma.cc
  35. cellular_capability_cdma.h
  36. cellular_capability_cdma_unittest.cc
  37. cellular_capability_classic.cc
  38. cellular_capability_classic.h
  39. cellular_capability_classic_unittest.cc
  40. cellular_capability_gsm.cc
  41. cellular_capability_gsm.h
  42. cellular_capability_gsm_unittest.cc
  43. cellular_capability_universal.cc
  44. cellular_capability_universal.h
  45. cellular_capability_universal_unittest.cc
  46. cellular_error.cc
  47. cellular_error.h
  48. cellular_operator_info.cc
  49. cellular_operator_info.h
  50. cellular_operator_info_unittest.cc
  51. cellular_service.cc
  52. cellular_service.h
  53. cellular_service_unittest.cc
  54. cellular_unittest.cc
  55. certificate_file.cc
  56. certificate_file.h
  57. certificate_file_unittest.cc
  58. config80211.cc
  59. config80211.h
  60. config80211_unittest.cc
  61. connection.cc
  62. connection.h
  63. connection_health_checker.cc
  64. connection_health_checker.h
  65. connection_health_checker_unittest.cc
  66. connection_unittest.cc
  67. control_interface.h
  68. control_netlink_attribute.cc
  69. control_netlink_attribute.h
  70. crypto_des_cbc.cc
  71. crypto_des_cbc.h
  72. crypto_des_cbc_unittest.cc
  73. crypto_interface.h
  74. crypto_provider.cc
  75. crypto_provider.h
  76. crypto_provider_unittest.cc
  77. crypto_rot47.cc
  78. crypto_rot47.h
  79. crypto_rot47_unittest.cc
  80. crypto_util_proxy.cc
  81. crypto_util_proxy.h
  82. crypto_util_proxy_unittest.cc
  83. dbus_adaptor.cc
  84. dbus_adaptor.h
  85. dbus_adaptor_unittest.cc
  86. dbus_control.cc
  87. dbus_control.h
  88. dbus_manager.cc
  89. dbus_manager.h
  90. dbus_manager_unittest.cc
  91. dbus_objectmanager_proxy.cc
  92. dbus_objectmanager_proxy.h
  93. dbus_objectmanager_proxy_interface.h
  94. dbus_properties.cc
  95. dbus_properties.h
  96. dbus_properties_proxy.cc
  97. dbus_properties_proxy.h
  98. dbus_properties_proxy_interface.h
  99. dbus_properties_unittest.cc
  100. dbus_property_matchers.h
  101. dbus_service_proxy.cc
  102. dbus_service_proxy.h
  103. dbus_service_proxy_interface.h
  104. default_profile.cc
  105. default_profile.h
  106. default_profile_unittest.cc
  107. device.cc
  108. device.h
  109. device_dbus_adaptor.cc
  110. device_dbus_adaptor.h
  111. device_info.cc
  112. device_info.h
  113. device_info_unittest.cc
  114. device_stub.h
  115. device_unittest.cc
  116. dhcp_config.cc
  117. dhcp_config.h
  118. dhcp_config_unittest.cc
  119. dhcp_provider.cc
  120. dhcp_provider.h
  121. dhcp_provider_unittest.cc
  122. dhcp_proxy_interface.h
  123. dhcpcd_proxy.cc
  124. dhcpcd_proxy.h
  125. diagnostics_reporter.cc
  126. diagnostics_reporter.h
  127. diagnostics_reporter_unittest.cc
  128. dns_client.cc
  129. dns_client.h
  130. dns_client_unittest.cc
  131. eap_credentials.h
  132. eap_listener.cc
  133. eap_listener.h
  134. eap_listener_unittest.cc
  135. eap_protocol.h
  136. endpoint.cc
  137. endpoint.h
  138. ephemeral_profile.cc
  139. ephemeral_profile.h
  140. error.cc
  141. error.h
  142. error_unittest.cc
  143. ethernet.cc
  144. ethernet.h
  145. ethernet_service.cc
  146. ethernet_service.h
  147. ethernet_service_unittest.cc
  148. ethernet_unittest.cc
  149. event_dispatcher.cc
  150. event_dispatcher.h
  151. file_io.cc
  152. file_io.h
  153. file_reader.cc
  154. file_reader.h
  155. file_reader_unittest.cc
  156. geolocation_info.cc
  157. geolocation_info.h
  158. glib.cc
  159. glib.h
  160. glib_io_input_handler.cc
  161. glib_io_input_handler.h
  162. glib_io_ready_handler.cc
  163. glib_io_ready_handler.h
  164. HACKING
  165. hook_table.cc
  166. hook_table.h
  167. hook_table_unittest.cc
  168. http_proxy.cc
  169. http_proxy.h
  170. http_proxy_unittest.cc
  171. http_request.cc
  172. http_request.h
  173. http_request_unittest.cc
  174. http_url.cc
  175. http_url.h
  176. http_url_unittest.cc
  177. ieee80211.h
  178. io_handler.h
  179. ip_address.cc
  180. ip_address.h
  181. ip_address_unittest.cc
  182. ipconfig.cc
  183. ipconfig.h
  184. ipconfig_dbus_adaptor.cc
  185. ipconfig_dbus_adaptor.h
  186. ipconfig_unittest.cc
  187. key_file_store.cc
  188. key_file_store.h
  189. key_file_store_unittest.cc
  190. key_value_store.cc
  191. key_value_store.h
  192. key_value_store_unittest.cc
  193. l2tp_ipsec_driver.cc
  194. l2tp_ipsec_driver.h
  195. l2tp_ipsec_driver_unittest.cc
  196. LICENSE
  197. link_monitor.cc
  198. link_monitor.h
  199. link_monitor_unittest.cc
  200. logging.h
  201. Makefile
  202. manager.cc
  203. manager.h
  204. manager_dbus_adaptor.cc
  205. manager_dbus_adaptor.h
  206. manager_unittest.cc
  207. memory_log.cc
  208. memory_log.h
  209. memory_log_unittest.cc
  210. metrics.cc
  211. metrics.h
  212. metrics_unittest.cc
  213. minijail.cc
  214. minijail.h
  215. mm1_bearer_proxy.cc
  216. mm1_bearer_proxy.h
  217. mm1_bearer_proxy_interface.h
  218. mm1_modem_location_proxy.cc
  219. mm1_modem_location_proxy.h
  220. mm1_modem_location_proxy_interface.h
  221. mm1_modem_modem3gpp_proxy.cc
  222. mm1_modem_modem3gpp_proxy.h
  223. mm1_modem_modem3gpp_proxy_interface.h
  224. mm1_modem_modemcdma_proxy.cc
  225. mm1_modem_modemcdma_proxy.h
  226. mm1_modem_modemcdma_proxy_interface.h
  227. mm1_modem_proxy.cc
  228. mm1_modem_proxy.h
  229. mm1_modem_proxy_interface.h
  230. mm1_modem_simple_proxy.cc
  231. mm1_modem_simple_proxy.h
  232. mm1_modem_simple_proxy_interface.h
  233. mm1_modem_time_proxy.cc
  234. mm1_modem_time_proxy.h
  235. mm1_modem_time_proxy_interface.h
  236. mm1_sim_proxy.cc
  237. mm1_sim_proxy.h
  238. mm1_sim_proxy_interface.h
  239. mock_activating_iccid_store.cc
  240. mock_activating_iccid_store.h
  241. mock_adaptors.cc
  242. mock_adaptors.h
  243. mock_ares.cc
  244. mock_ares.h
  245. mock_arp_client.cc
  246. mock_arp_client.h
  247. mock_async_connection.cc
  248. mock_async_connection.h
  249. mock_cellular.cc
  250. mock_cellular.h
  251. mock_cellular_operator_info.cc
  252. mock_cellular_operator_info.h
  253. mock_cellular_service.cc
  254. mock_cellular_service.h
  255. mock_certificate_file.cc
  256. mock_certificate_file.h
  257. mock_config80211.h
  258. mock_connection.cc
  259. mock_connection.h
  260. mock_connection_health_checker.cc
  261. mock_connection_health_checker.h
  262. mock_control.cc
  263. mock_control.h
  264. mock_crypto_util_proxy.h
  265. mock_dbus_manager.cc
  266. mock_dbus_manager.h
  267. mock_dbus_objectmanager_proxy.cc
  268. mock_dbus_objectmanager_proxy.h
  269. mock_dbus_properties_proxy.cc
  270. mock_dbus_properties_proxy.h
  271. mock_dbus_service_proxy.cc
  272. mock_dbus_service_proxy.h
  273. mock_device.cc
  274. mock_device.h
  275. mock_device_info.cc
  276. mock_device_info.h
  277. mock_dhcp_config.cc
  278. mock_dhcp_config.h
  279. mock_dhcp_provider.cc
  280. mock_dhcp_provider.h
  281. mock_dhcp_proxy.cc
  282. mock_dhcp_proxy.h
  283. mock_diagnostics_reporter.cc
  284. mock_diagnostics_reporter.h
  285. mock_dns_client.cc
  286. mock_dns_client.h
  287. mock_eap_listener.cc
  288. mock_eap_listener.h
  289. mock_ethernet.cc
  290. mock_ethernet.h
  291. mock_event_dispatcher.cc
  292. mock_event_dispatcher.h
  293. mock_file_io.h
  294. mock_glib.cc
  295. mock_glib.h
  296. mock_http_request.cc
  297. mock_http_request.h
  298. mock_ipconfig.cc
  299. mock_ipconfig.h
  300. mock_link_monitor.cc
  301. mock_link_monitor.h
  302. mock_log.cc
  303. mock_log.h
  304. mock_log_unittest.cc
  305. mock_manager.cc
  306. mock_manager.h
  307. mock_metrics.cc
  308. mock_metrics.h
  309. mock_minijail.cc
  310. mock_minijail.h
  311. mock_mm1_bearer_proxy.cc
  312. mock_mm1_bearer_proxy.h
  313. mock_mm1_modem_location_proxy.cc
  314. mock_mm1_modem_location_proxy.h
  315. mock_mm1_modem_modem3gpp_proxy.cc
  316. mock_mm1_modem_modem3gpp_proxy.h
  317. mock_mm1_modem_modemcdma_proxy.cc
  318. mock_mm1_modem_modemcdma_proxy.h
  319. mock_mm1_modem_proxy.cc
  320. mock_mm1_modem_proxy.h
  321. mock_mm1_modem_simple_proxy.cc
  322. mock_mm1_modem_simple_proxy.h
  323. mock_mm1_modem_time_proxy.cc
  324. mock_mm1_modem_time_proxy.h
  325. mock_mm1_sim_proxy.cc
  326. mock_mm1_sim_proxy.h
  327. mock_modem.cc
  328. mock_modem.h
  329. mock_modem_cdma_proxy.cc
  330. mock_modem_cdma_proxy.h
  331. mock_modem_gobi_proxy.cc
  332. mock_modem_gobi_proxy.h
  333. mock_modem_gsm_card_proxy.cc
  334. mock_modem_gsm_card_proxy.h
  335. mock_modem_gsm_network_proxy.cc
  336. mock_modem_gsm_network_proxy.h
  337. mock_modem_info.cc
  338. mock_modem_info.h
  339. mock_modem_manager_proxy.cc
  340. mock_modem_manager_proxy.h
  341. mock_modem_proxy.cc
  342. mock_modem_proxy.h
  343. mock_modem_simple_proxy.cc
  344. mock_modem_simple_proxy.h
  345. mock_netlink_socket.h
  346. mock_nss.cc
  347. mock_nss.h
  348. mock_openvpn_driver.cc
  349. mock_openvpn_driver.h
  350. mock_openvpn_management_server.cc
  351. mock_openvpn_management_server.h
  352. mock_portal_detector.cc
  353. mock_portal_detector.h
  354. mock_power_manager.cc
  355. mock_power_manager.h
  356. mock_power_manager_proxy.cc
  357. mock_power_manager_proxy.h
  358. mock_process_killer.cc
  359. mock_process_killer.h
  360. mock_profile.cc
  361. mock_profile.h
  362. mock_property_store.cc
  363. mock_property_store.h
  364. mock_proxy_factory.cc
  365. mock_proxy_factory.h
  366. mock_resolver.cc
  367. mock_resolver.h
  368. mock_routing_table.cc
  369. mock_routing_table.h
  370. mock_rtnl_handler.cc
  371. mock_rtnl_handler.h
  372. mock_service.cc
  373. mock_service.h
  374. mock_socket_info_reader.cc
  375. mock_socket_info_reader.h
  376. mock_sockets.cc
  377. mock_sockets.h
  378. mock_store.cc
  379. mock_store.h
  380. mock_supplicant_bss_proxy.cc
  381. mock_supplicant_bss_proxy.h
  382. mock_supplicant_eap_state_handler.cc
  383. mock_supplicant_eap_state_handler.h
  384. mock_supplicant_interface_proxy.cc
  385. mock_supplicant_interface_proxy.h
  386. mock_supplicant_network_proxy.cc
  387. mock_supplicant_network_proxy.h
  388. mock_supplicant_process_proxy.cc
  389. mock_supplicant_process_proxy.h
  390. mock_time.cc
  391. mock_time.h
  392. mock_traffic_monitor.cc
  393. mock_traffic_monitor.h
  394. mock_vpn.cc
  395. mock_vpn.h
  396. mock_vpn_driver.cc
  397. mock_vpn_driver.h
  398. mock_vpn_provider.cc
  399. mock_vpn_provider.h
  400. mock_vpn_service.cc
  401. mock_vpn_service.h
  402. mock_wifi.cc
  403. mock_wifi.h
  404. mock_wifi_provider.cc
  405. mock_wifi_provider.h
  406. mock_wifi_service.cc
  407. mock_wifi_service.h
  408. mock_wimax.cc
  409. mock_wimax.h
  410. mock_wimax_device_proxy.cc
  411. mock_wimax_device_proxy.h
  412. mock_wimax_manager_proxy.cc
  413. mock_wimax_manager_proxy.h
  414. mock_wimax_network_proxy.cc
  415. mock_wimax_network_proxy.h
  416. mock_wimax_provider.cc
  417. mock_wimax_provider.h
  418. mock_wimax_service.cc
  419. mock_wimax_service.h
  420. modem.cc
  421. modem.h
  422. modem_1.cc
  423. modem_1_unittest.cc
  424. modem_cdma_proxy.cc
  425. modem_cdma_proxy.h
  426. modem_cdma_proxy_interface.h
  427. modem_classic.cc
  428. modem_gobi_proxy.cc
  429. modem_gobi_proxy.h
  430. modem_gobi_proxy_interface.h
  431. modem_gsm_card_proxy.cc
  432. modem_gsm_card_proxy.h
  433. modem_gsm_card_proxy_interface.h
  434. modem_gsm_network_proxy.cc
  435. modem_gsm_network_proxy.h
  436. modem_gsm_network_proxy_interface.h
  437. modem_info.cc
  438. modem_info.h
  439. modem_info_unittest.cc
  440. modem_manager.cc
  441. modem_manager.h
  442. modem_manager_1.cc
  443. modem_manager_proxy.cc
  444. modem_manager_proxy.h
  445. modem_manager_proxy_interface.h
  446. modem_manager_unittest.cc
  447. modem_proxy.cc
  448. modem_proxy.h
  449. modem_proxy_interface.h
  450. modem_simple_proxy.cc
  451. modem_simple_proxy.h
  452. modem_simple_proxy_interface.h
  453. modem_unittest.cc
  454. netlink_attribute.cc
  455. netlink_attribute.h
  456. netlink_message_unittest.cc
  457. netlink_socket.cc
  458. netlink_socket.h
  459. netlink_socket_unittest.cc
  460. nice_mock_control.cc
  461. nice_mock_control.h
  462. nl80211_attribute.cc
  463. nl80211_attribute.h
  464. nl80211_message.cc
  465. nl80211_message.h
  466. nss.cc
  467. nss.h
  468. nss_unittest.cc
  469. openvpn_driver.cc
  470. openvpn_driver.h
  471. openvpn_driver_unittest.cc
  472. openvpn_management_server.cc
  473. openvpn_management_server.h
  474. openvpn_management_server_unittest.cc
  475. portal_detector.cc
  476. portal_detector.h
  477. portal_detector_unittest.cc
  478. power_manager.cc
  479. power_manager.h
  480. power_manager_proxy.cc
  481. power_manager_proxy.h
  482. power_manager_proxy_interface.h
  483. power_manager_unittest.cc
  484. process_killer.cc
  485. process_killer.h
  486. process_killer_unittest.cc
  487. profile.cc
  488. profile.h
  489. profile_dbus_adaptor.cc
  490. profile_dbus_adaptor.h
  491. profile_dbus_property_exporter.cc
  492. profile_dbus_property_exporter.h
  493. profile_dbus_property_exporter_unittest.cc
  494. profile_unittest.cc
  495. property_accessor.h
  496. property_accessor_unittest.cc
  497. property_iterator.h
  498. property_store.cc
  499. property_store.h
  500. property_store_unittest.cc
  501. property_store_unittest.h
  502. provider_db_unittest.bfd
  503. proxy_factory.cc
  504. proxy_factory.h
  505. refptr_types.h
  506. resolver.cc
  507. resolver.h
  508. resolver_unittest.cc
  509. routing_table.cc
  510. routing_table.h
  511. routing_table_entry.h
  512. routing_table_unittest.cc
  513. rpc_task.cc
  514. rpc_task.h
  515. rpc_task_dbus_adaptor.cc
  516. rpc_task_dbus_adaptor.h
  517. rpc_task_unittest.cc
  518. rtnl_handler.cc
  519. rtnl_handler.h
  520. rtnl_handler_unittest.cc
  521. rtnl_listener.cc
  522. rtnl_listener.h
  523. rtnl_listener_unittest.cc
  524. rtnl_message.cc
  525. rtnl_message.h
  526. rtnl_message_unittest.cc
  527. scope_logger.cc
  528. scope_logger.h
  529. scope_logger_unittest.cc
  530. service.cc
  531. service.h
  532. service_dbus_adaptor.cc
  533. service_dbus_adaptor.h
  534. service_sorter.h
  535. service_under_test.cc
  536. service_under_test.h
  537. service_unittest.cc
  538. shill_ares.cc
  539. shill_ares.h
  540. shill_config.cc
  541. shill_config.h
  542. shill_daemon.cc
  543. shill_daemon.h
  544. shill_main.cc
  545. shill_test_config.cc
  546. shill_test_config.h
  547. shill_time.cc
  548. shill_time.h
  549. shill_unittest.cc
  550. socket_info.cc
  551. socket_info.h
  552. socket_info_reader.cc
  553. socket_info_reader.h
  554. socket_info_reader_unittest.cc
  555. socket_info_unittest.cc
  556. sockets.cc
  557. sockets.h
  558. static_ip_parameters.cc
  559. static_ip_parameters.h
  560. static_ip_parameters_unittest.cc
  561. store_interface.h
  562. supplicant_bss_proxy.cc
  563. supplicant_bss_proxy.h
  564. supplicant_bss_proxy_interface.h
  565. supplicant_eap_state_handler.cc
  566. supplicant_eap_state_handler.h
  567. supplicant_eap_state_handler_unittest.cc
  568. supplicant_event_delegate_interface.h
  569. supplicant_interface_proxy.cc
  570. supplicant_interface_proxy.h
  571. supplicant_interface_proxy_interface.h
  572. supplicant_network_proxy.cc
  573. supplicant_network_proxy.h
  574. supplicant_network_proxy_interface.h
  575. supplicant_process_proxy.cc
  576. supplicant_process_proxy.h
  577. supplicant_process_proxy_interface.h
  578. technology.cc
  579. technology.h
  580. technology_unittest.cc
  581. TESTING
  582. testrunner.cc
  583. traffic_monitor.cc
  584. traffic_monitor.h
  585. traffic_monitor_unittest.cc
  586. virtio_ethernet.cc
  587. virtio_ethernet.h
  588. vpn.cc
  589. vpn.h
  590. vpn_driver.cc
  591. vpn_driver.h
  592. vpn_driver_unittest.cc
  593. vpn_provider.cc
  594. vpn_provider.h
  595. vpn_provider_unittest.cc
  596. vpn_service.cc
  597. vpn_service.h
  598. vpn_service_unittest.cc
  599. vpn_unittest.cc
  600. wifi.cc
  601. wifi.h
  602. wifi_endpoint.cc
  603. wifi_endpoint.h
  604. wifi_endpoint_unittest.cc
  605. wifi_provider.cc
  606. wifi_provider.h
  607. wifi_provider_unittest.cc
  608. wifi_service.cc
  609. wifi_service.h
  610. wifi_service_unittest.cc
  611. wifi_unittest.cc
  612. wimax.cc
  613. wimax.h
  614. wimax_device_proxy.cc
  615. wimax_device_proxy.h
  616. wimax_device_proxy_interface.h
  617. wimax_manager_proxy.cc
  618. wimax_manager_proxy.h
  619. wimax_manager_proxy_interface.h
  620. wimax_network_proxy.cc
  621. wimax_network_proxy.h
  622. wimax_network_proxy_interface.h
  623. wimax_provider.cc
  624. wimax_provider.h
  625. wimax_provider_unittest.cc
  626. wimax_service.cc
  627. wimax_service.h
  628. wimax_service_unittest.cc
  629. wimax_unittest.cc
  630. wpa_supplicant.cc
  631. wpa_supplicant.h
  632. wpa_supplicant_unittest.cc