Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d098dccf authored by Aleksander Morgado's avatar Aleksander Morgado
Browse files

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
parent 9d14b037
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment