Check for FEATURE_TELEPHONY instead of CM
The ConnectivityManager#isNetworkSupported has been deprecated a long time ago and can no longer be called from the system server as it's moving to a mainline module. Instead of checking for support of a MOBILE network, ask for FEATURE_TELEPHONY. Note that this might not be 100% behavior-neutral, as the old ConnectivityManager#isNetworkSupported would return based on an OEM-configured resource, while the new one is based on whether the device supports the feature ; in particular, devices with phone call support but without data support have the feature, but may not have had the resource configuration. The contention is that the new behavior is better, because Airplane mode should depend on whether there is a telephony radio on the device, not on whether that radio supports data transfers. Bug: 172183305 Test: FrameworksServicesTests Change-Id: Ifb5ba537cb029b3aeebf74407002d873ec614f8d
Loading
Please register or sign in to comment