Merge "[Settings] Data roaming warning only when turn ON"

This commit is contained in:
Bonian Chen
2020-02-12 06:14:20 +00:00
committed by Android (Google) Code Review
2 changed files with 5 additions and 16 deletions

View File

@@ -22,7 +22,6 @@ import android.provider.Settings;
import android.telephony.CarrierConfigManager;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.Log;
import androidx.annotation.VisibleForTesting;
@@ -110,21 +109,11 @@ public class RoamingPreferenceController extends TelephonyTogglePreferenceContro
: AVAILABLE_UNSEARCHABLE;
}
@Override
public boolean handlePreferenceTreeClick(Preference preference) {
if (TextUtils.equals(preference.getKey(), getPreferenceKey())) {
if (isDialogNeeded()) {
showDialog();
}
return true;
}
return false;
}
@Override
public boolean setChecked(boolean isChecked) {
if (!isDialogNeeded()) {
if (isDialogNeeded()) {
showDialog();
} else {
// Update data directly if we don't need dialog
mTelephonyManager.setDataRoamingEnabled(isChecked);
return true;