Use the new isNetworkSupported api for wifi-only
Didn't have an API for this before so people used a hacked system property (ro.carrier) to determine if the device supported mobile data. Added new API and switching callsites. bug:5087537 Change-Id: Ibd799559be102a9e2fd552d1a23d1afbcf8f4614
This commit is contained in:
@@ -194,7 +194,7 @@ public class Status extends PreferenceActivity {
|
||||
mSignalStrength = findPreference(KEY_SIGNAL_STRENGTH);
|
||||
mUptime = findPreference("up_time");
|
||||
|
||||
if (Utils.isWifiOnly()) {
|
||||
if (Utils.isWifiOnly(getApplicationContext())) {
|
||||
for (String key : PHONE_RELATED_ENTRIES) {
|
||||
removePreferenceFromScreen(key);
|
||||
}
|
||||
@@ -263,7 +263,7 @@ public class Status extends PreferenceActivity {
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
if (!Utils.isWifiOnly()) {
|
||||
if (!Utils.isWifiOnly(getApplicationContext())) {
|
||||
mPhoneStateReceiver.registerIntent();
|
||||
|
||||
updateSignalStrength();
|
||||
@@ -281,7 +281,7 @@ public class Status extends PreferenceActivity {
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
|
||||
if (!Utils.isWifiOnly()) {
|
||||
if (!Utils.isWifiOnly(getApplicationContext())) {
|
||||
mPhoneStateReceiver.unregisterIntent();
|
||||
mTelephonyManager.listen(mPhoneStateListener, PhoneStateListener.LISTEN_NONE);
|
||||
}
|
||||
|
Reference in New Issue
Block a user