Use isMobileDataCapable helper in network/datausage components
Disabling telephony support may be done either with the config_show_sim_info config option, or based on whether TelephonyManager reports data capabilities. The isMobileDataCapable() helper method ensures both ways are supported. Most of the logic in the data usage components rely on a DataUsageUtils.hasMobileData(), which is already equivalent to !Utils.isWifiOnly(), i.e. looking at the TelephonyManager mobile data support. Instead of removing all uses of hasMobileData(), the method itself has been updated to rely on the new isMobileDataCapable() helper, so that all the unit tests that mocked hasMobileData() don't need to be updated. The relevant unit tests are also updated to mock TelephonyManager directly. Bug: 395714454 Test: atest tests/robotests/src/com/android/settings/datausage/ Test: atest tests/spa_unit/src/com/android/settings/datausage/ Flag: EXEMPT bugfix Change-Id: I722e25ea7b0b078d006ff027e721dd1bc95da17a
Loading
Please register or sign in to comment