Merge "Clean up ApnSettings unused fields" into main
This commit is contained in:
@@ -1,177 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2008 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:title="@string/apn_edit">
|
||||
<EditTextPreference
|
||||
android:title="@string/apn_name"
|
||||
android:dialogTitle="@string/apn_name"
|
||||
android:key="apn_name"
|
||||
android:singleLine="true"
|
||||
android:inputType="text"
|
||||
android:persistent="false"
|
||||
/>
|
||||
<EditTextPreference
|
||||
android:title="@string/apn_apn"
|
||||
android:dialogTitle="@string/apn_apn"
|
||||
android:key="apn_apn"
|
||||
android:singleLine="true"
|
||||
android:inputType="textEmailAddress"
|
||||
android:persistent="false"
|
||||
/>
|
||||
<EditTextPreference
|
||||
android:title="@string/apn_http_proxy"
|
||||
android:dialogTitle="@string/apn_http_proxy"
|
||||
android:key="apn_http_proxy"
|
||||
android:singleLine="true"
|
||||
android:inputType="textUri"
|
||||
android:persistent="false"
|
||||
/>
|
||||
<EditTextPreference
|
||||
android:title="@string/apn_http_port"
|
||||
android:dialogTitle="@string/apn_http_port"
|
||||
android:key="apn_http_port"
|
||||
android:singleLine="true"
|
||||
android:inputType="number"
|
||||
android:persistent="false"
|
||||
/>
|
||||
<EditTextPreference
|
||||
android:title="@string/apn_user"
|
||||
android:dialogTitle="@string/apn_user"
|
||||
android:key="apn_user"
|
||||
android:singleLine="true"
|
||||
android:inputType="textEmailAddress"
|
||||
android:persistent="false"
|
||||
/>
|
||||
<EditTextPreference
|
||||
android:title="@string/apn_password"
|
||||
android:dialogTitle="@string/apn_password"
|
||||
android:key="apn_password"
|
||||
android:singleLine="true"
|
||||
android:inputType="textPassword"
|
||||
android:persistent="false"
|
||||
/>
|
||||
<EditTextPreference
|
||||
android:title="@string/apn_server"
|
||||
android:dialogTitle="@string/apn_server"
|
||||
android:key="apn_server"
|
||||
android:singleLine="true"
|
||||
android:inputType="textUri"
|
||||
android:persistent="false"
|
||||
/>
|
||||
<EditTextPreference
|
||||
android:title="@string/apn_mmsc"
|
||||
android:dialogTitle="@string/apn_mmsc"
|
||||
android:key="apn_mmsc"
|
||||
android:singleLine="true"
|
||||
android:inputType="textUri"
|
||||
android:persistent="false"
|
||||
/>
|
||||
<EditTextPreference
|
||||
android:title="@string/apn_mms_proxy"
|
||||
android:dialogTitle="@string/apn_mms_proxy"
|
||||
android:key="apn_mms_proxy"
|
||||
android:singleLine="true"
|
||||
android:inputType="textUri"
|
||||
android:persistent="false"
|
||||
/>
|
||||
<EditTextPreference
|
||||
android:title="@string/apn_mms_port"
|
||||
android:dialogTitle="@string/apn_mms_port"
|
||||
android:key="apn_mms_port"
|
||||
android:singleLine="true"
|
||||
android:inputType="number"
|
||||
android:persistent="false"
|
||||
/>
|
||||
<EditTextPreference
|
||||
android:title="@string/apn_mcc"
|
||||
android:dialogTitle="@string/apn_mcc"
|
||||
android:key="apn_mcc"
|
||||
android:singleLine="true"
|
||||
android:inputType="number"
|
||||
android:persistent="false"
|
||||
/>
|
||||
<EditTextPreference
|
||||
android:title="@string/apn_mnc"
|
||||
android:dialogTitle="@string/apn_mnc"
|
||||
android:key="apn_mnc"
|
||||
android:singleLine="true"
|
||||
android:inputType="number"
|
||||
android:persistent="false"
|
||||
/>
|
||||
<ListPreference
|
||||
android:title="@string/apn_auth_type"
|
||||
android:key="auth_type"
|
||||
android:entries="@array/apn_auth_entries"
|
||||
android:entryValues="@array/apn_auth_values"
|
||||
android:persistent="false"
|
||||
/>
|
||||
<EditTextPreference
|
||||
android:title="@string/apn_type"
|
||||
android:dialogTitle="@string/apn_type"
|
||||
android:key="apn_type"
|
||||
android:singleLine="true"
|
||||
android:inputType="textNoSuggestions"
|
||||
android:persistent="false"
|
||||
/>
|
||||
<ListPreference
|
||||
android:title="@string/apn_protocol"
|
||||
android:dialogTitle="@string/apn_protocol"
|
||||
android:key="apn_protocol"
|
||||
android:entries="@array/apn_protocol_entries"
|
||||
android:entryValues="@array/apn_protocol_values"
|
||||
android:persistent="false"
|
||||
/>
|
||||
<ListPreference
|
||||
android:title="@string/apn_roaming_protocol"
|
||||
android:dialogTitle="@string/apn_roaming_protocol"
|
||||
android:key="apn_roaming_protocol"
|
||||
android:entries="@array/apn_protocol_entries"
|
||||
android:entryValues="@array/apn_protocol_values"
|
||||
android:persistent="false"
|
||||
/>
|
||||
<SwitchPreferenceCompat
|
||||
android:title="@string/carrier_enabled"
|
||||
android:key="carrier_enabled"
|
||||
android:enabled="false"
|
||||
android:summaryOn="@string/carrier_enabled_summaryOn"
|
||||
android:summaryOff="@string/carrier_enabled_summaryOff"
|
||||
android:persistent="false"
|
||||
/>
|
||||
<MultiSelectListPreference
|
||||
android:title="@string/bearer"
|
||||
android:key="bearer_multi"
|
||||
android:entries="@array/bearer_entries"
|
||||
android:entryValues="@array/bearer_values"
|
||||
android:persistent="false"
|
||||
style="@style/SettingsMultiSelectListPreference"
|
||||
/>
|
||||
<ListPreference
|
||||
android:title="@string/mvno_type"
|
||||
android:key="mvno_type"
|
||||
android:entries="@array/mvno_type_entries"
|
||||
android:entryValues="@array/mvno_type_values"
|
||||
android:persistent="false"
|
||||
/>
|
||||
<EditTextPreference
|
||||
android:title="@string/mvno_match_data"
|
||||
android:dialogTitle="@string/mvno_match_data"
|
||||
android:key="mvno_match_data"
|
||||
android:singleLine="true"
|
||||
android:inputType="text"
|
||||
android:persistent="false"
|
||||
/>
|
||||
</PreferenceScreen>
|
@@ -23,7 +23,6 @@ import android.app.Dialog;
|
||||
import android.app.ProgressDialog;
|
||||
import android.app.settings.SettingsEnums;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
@@ -34,7 +33,6 @@ import android.provider.Telephony;
|
||||
import android.telephony.CarrierConfigManager;
|
||||
import android.telephony.SubscriptionManager;
|
||||
import android.telephony.data.ApnSetting;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
@@ -51,7 +49,6 @@ import androidx.preference.PreferenceGroup;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.RestrictedSettingsFragment;
|
||||
import com.android.settings.flags.Flags;
|
||||
import com.android.settings.network.telephony.SubscriptionRepository;
|
||||
import com.android.settings.spa.SpaActivity;
|
||||
import com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
|
||||
@@ -69,16 +66,12 @@ public class ApnSettings extends RestrictedSettingsFragment
|
||||
public static final String APN_ID = "apn_id";
|
||||
public static final String APN_LIST = "apn_list";
|
||||
public static final String SUB_ID = "sub_id";
|
||||
public static final String MVNO_TYPE = "mvno_type";
|
||||
public static final String MVNO_MATCH_DATA = "mvno_match_data";
|
||||
|
||||
private static final String[] CARRIERS_PROJECTION = new String[] {
|
||||
Telephony.Carriers._ID,
|
||||
Telephony.Carriers.NAME,
|
||||
Telephony.Carriers.APN,
|
||||
Telephony.Carriers.TYPE,
|
||||
Telephony.Carriers.MVNO_TYPE,
|
||||
Telephony.Carriers.MVNO_MATCH_DATA,
|
||||
Telephony.Carriers.EDITED_STATUS,
|
||||
};
|
||||
|
||||
@@ -86,9 +79,7 @@ public class ApnSettings extends RestrictedSettingsFragment
|
||||
private static final int NAME_INDEX = 1;
|
||||
private static final int APN_INDEX = 2;
|
||||
private static final int TYPES_INDEX = 3;
|
||||
private static final int MVNO_TYPE_INDEX = 4;
|
||||
private static final int MVNO_MATCH_DATA_INDEX = 5;
|
||||
private static final int EDITED_INDEX = 6;
|
||||
private static final int EDITED_INDEX = 4;
|
||||
|
||||
private static final int MENU_NEW = Menu.FIRST;
|
||||
private static final int MENU_RESTORE = Menu.FIRST + 1;
|
||||
@@ -102,8 +93,6 @@ public class ApnSettings extends RestrictedSettingsFragment
|
||||
private PreferredApnRepository mPreferredApnRepository;
|
||||
@Nullable
|
||||
private String mPreferredApnKey;
|
||||
private String mMvnoType;
|
||||
private String mMvnoMatchData;
|
||||
|
||||
private boolean mUnavailable;
|
||||
|
||||
@@ -242,8 +231,6 @@ public class ApnSettings extends RestrictedSettingsFragment
|
||||
final String key = cursor.getString(ID_INDEX);
|
||||
final String type = cursor.getString(TYPES_INDEX);
|
||||
final int edited = cursor.getInt(EDITED_INDEX);
|
||||
mMvnoType = cursor.getString(MVNO_TYPE_INDEX);
|
||||
mMvnoMatchData = cursor.getString(MVNO_MATCH_DATA_INDEX);
|
||||
|
||||
final ApnPreference pref = new ApnPreference(getPrefContext());
|
||||
|
||||
@@ -311,20 +298,9 @@ public class ApnSettings extends RestrictedSettingsFragment
|
||||
}
|
||||
|
||||
private void addNewApn() {
|
||||
if (Flags.newApnPageEnabled()) {
|
||||
String route = ApnEditPageProvider.INSTANCE.getRoute(
|
||||
INSERT_URL, Telephony.Carriers.CONTENT_URI, mSubId);
|
||||
SpaActivity.startSpaActivity(getContext(), route);
|
||||
} else {
|
||||
final Intent intent = new Intent(Intent.ACTION_INSERT, Telephony.Carriers.CONTENT_URI);
|
||||
intent.putExtra(SUB_ID, mSubId);
|
||||
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||
if (!TextUtils.isEmpty(mMvnoType) && !TextUtils.isEmpty(mMvnoMatchData)) {
|
||||
intent.putExtra(MVNO_TYPE, mMvnoType);
|
||||
intent.putExtra(MVNO_MATCH_DATA, mMvnoMatchData);
|
||||
}
|
||||
startActivity(intent);
|
||||
}
|
||||
String route = ApnEditPageProvider.INSTANCE.getRoute(
|
||||
INSERT_URL, Telephony.Carriers.CONTENT_URI, mSubId);
|
||||
SpaActivity.startSpaActivity(getContext(), route);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user