Merge "Rename a bunch of mobile network files"
This commit is contained in:
@@ -36,7 +36,7 @@ import androidx.preference.PreferenceScreen;
|
||||
|
||||
import com.android.settings.core.FeatureFlags;
|
||||
import com.android.settings.core.PreferenceControllerMixin;
|
||||
import com.android.settings.network.telephony.MobileSettingsActivity;
|
||||
import com.android.settings.network.telephony.MobileNetworkActivity;
|
||||
import com.android.settingslib.RestrictedLockUtilsInternal;
|
||||
import com.android.settingslib.RestrictedPreference;
|
||||
import com.android.settingslib.Utils;
|
||||
@@ -147,7 +147,7 @@ public class MobileNetworkPreferenceController extends AbstractPreferenceControl
|
||||
public boolean handlePreferenceTreeClick(Preference preference) {
|
||||
if (KEY_MOBILE_NETWORK_SETTINGS.equals(preference.getKey())) {
|
||||
if (FeatureFlagUtils.isEnabled(mContext, FeatureFlags.MOBILE_NETWORK_V2)) {
|
||||
final Intent intent = new Intent(mContext, MobileSettingsActivity.class);
|
||||
final Intent intent = new Intent(mContext, MobileNetworkActivity.class);
|
||||
mContext.startActivity(intent);
|
||||
} else {
|
||||
final Intent intent = new Intent(Intent.ACTION_MAIN);
|
||||
|
@@ -48,7 +48,7 @@ import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class MobileSettingsActivity extends SettingsBaseActivity {
|
||||
public class MobileNetworkActivity extends SettingsBaseActivity {
|
||||
|
||||
private static final String TAG = "MobileSettingsActivity";
|
||||
@VisibleForTesting
|
||||
@@ -79,7 +79,8 @@ public class MobileSettingsActivity extends SettingsBaseActivity {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.mobile_settings_container);
|
||||
|
||||
setContentView(R.layout.mobile_network_settings_container);
|
||||
setActionBar(findViewById(R.id.mobile_action_bar));
|
||||
mPhoneChangeReceiver = new PhoneChangeReceiver();
|
||||
mSubscriptionManager = getSystemService(SubscriptionManager.class);
|
||||
@@ -130,7 +131,7 @@ public class MobileSettingsActivity extends SettingsBaseActivity {
|
||||
updateBottomNavigationView();
|
||||
|
||||
if (savedInstanceState == null) {
|
||||
switchFragment(new MobileNetworkFragment(), getSubscriptionId());
|
||||
switchFragment(new MobileNetworkSettings(), getSubscriptionId());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,7 +173,7 @@ public class MobileSettingsActivity extends SettingsBaseActivity {
|
||||
.setIcon(R.drawable.ic_settings_sim);
|
||||
}
|
||||
navigation.setOnNavigationItemSelectedListener(item -> {
|
||||
switchFragment(new MobileNetworkFragment(), item.getItemId());
|
||||
switchFragment(new MobileNetworkSettings(), item.getItemId());
|
||||
return true;
|
||||
});
|
||||
}
|
||||
@@ -211,7 +212,7 @@ public class MobileSettingsActivity extends SettingsBaseActivity {
|
||||
// When the radio changes (ex: CDMA->GSM), refresh the fragment.
|
||||
// This is very rare to happen.
|
||||
if (mCurSubscriptionId != SUB_ID_NULL) {
|
||||
switchFragment(new MobileNetworkFragment(), mCurSubscriptionId,
|
||||
switchFragment(new MobileNetworkSettings(), mCurSubscriptionId,
|
||||
true /* forceUpdate */);
|
||||
}
|
||||
}
|
@@ -49,7 +49,7 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC)
|
||||
public class MobileNetworkFragment extends RestrictedDashboardFragment {
|
||||
public class MobileNetworkSettings extends RestrictedDashboardFragment {
|
||||
|
||||
private static final String LOG_TAG = "NetworkSettings";
|
||||
public static final int REQUEST_CODE_EXIT_ECM = 17;
|
||||
@@ -69,7 +69,7 @@ public class MobileNetworkFragment extends RestrictedDashboardFragment {
|
||||
private UserManager mUserManager;
|
||||
private String mClickedPrefKey;
|
||||
|
||||
public MobileNetworkFragment() {
|
||||
public MobileNetworkSettings() {
|
||||
super(UserManager.DISALLOW_CONFIG_MOBILE_NETWORKS);
|
||||
}
|
||||
|
||||
@@ -107,6 +107,7 @@ public class MobileNetworkFragment extends RestrictedDashboardFragment {
|
||||
@Override
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
|
||||
mSubId = getArguments().getInt(Settings.EXTRA_SUB_ID,
|
||||
SubscriptionManager.INVALID_SUBSCRIPTION_ID);
|
||||
|
||||
@@ -162,7 +163,7 @@ public class MobileNetworkFragment extends RestrictedDashboardFragment {
|
||||
|
||||
@Override
|
||||
protected int getPreferenceScreenResId() {
|
||||
return R.xml.network_setting_fragment;
|
||||
return R.xml.mobile_network_settings;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -209,7 +210,7 @@ public class MobileNetworkFragment extends RestrictedDashboardFragment {
|
||||
final ArrayList<SearchIndexableResource> result = new ArrayList<>();
|
||||
|
||||
final SearchIndexableResource sir = new SearchIndexableResource(context);
|
||||
sir.xmlResId = R.xml.network_setting_fragment;
|
||||
sir.xmlResId = R.xml.mobile_network_settings;
|
||||
result.add(sir);
|
||||
return result;
|
||||
}
|
@@ -46,6 +46,9 @@ import java.util.List;
|
||||
public class WifiCallingPreferenceController extends BasePreferenceController implements
|
||||
LifecycleObserver, OnStart, OnStop {
|
||||
|
||||
@VisibleForTesting
|
||||
static final String KEY_PREFERENCE_CATEGORY = "calling_category";
|
||||
|
||||
private TelephonyManager mTelephonyManager;
|
||||
@VisibleForTesting
|
||||
ImsManager mImsManager;
|
||||
@@ -86,6 +89,13 @@ public class WifiCallingPreferenceController extends BasePreferenceController im
|
||||
public void displayPreference(PreferenceScreen screen) {
|
||||
super.displayPreference(screen);
|
||||
mPreference = screen.findPreference(getPreferenceKey());
|
||||
if (!isAvailable()) {
|
||||
// Set category as invisible
|
||||
final Preference preferenceCateogry = screen.findPreference(KEY_PREFERENCE_CATEGORY);
|
||||
if (preferenceCateogry != null) {
|
||||
preferenceCateogry.setVisible(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -31,7 +31,7 @@ import com.android.settings.R;
|
||||
import com.android.settings.core.SubSettingLauncher;
|
||||
import com.android.settings.core.TogglePreferenceController;
|
||||
import com.android.settings.network.telephony.MobileNetworkUtils;
|
||||
import com.android.settings.network.telephony.MobileSettingsActivity;
|
||||
import com.android.settings.network.telephony.MobileNetworkActivity;
|
||||
import com.android.settings.network.telephony.NetworkSelectSettings;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@@ -32,7 +32,7 @@ import com.android.settings.R;
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
import com.android.settings.core.SubSettingLauncher;
|
||||
import com.android.settings.network.telephony.MobileNetworkUtils;
|
||||
import com.android.settings.network.telephony.MobileSettingsActivity;
|
||||
import com.android.settings.network.telephony.MobileNetworkActivity;
|
||||
import com.android.settings.network.telephony.NetworkSelectSettings;
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user