From: snickersun Date: Sun, 14 Mar 2021 13:12:31 +0000 (+0800) Subject: 添加APN settings 相关代码初版。仅可编译,还需要继续整理 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=5dff7b8aa652c5788339d5f15b3c32d2ca1e51d9;p=protocol_srv.git 添加APN settings 相关代码初版。仅可编译,还需要继续整理 --- diff --git a/app/build.gradle b/app/build.gradle index b4dde886..8433f163 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -86,8 +86,9 @@ android { // } } dependencies { - compileOnly files ('libs/frameworks-full-debug.jar') - provided files ('libs/telephony_common-full-debug.jar') + compileOnly files ('libs/frameworks-full-debug.jar') + compileOnly files ('libs/frameworks-2-full-debug.jar') + compileOnly files ('libs/telephony-common-full-debug.jar') implementation 'com.android.support.constraint:constraint-layout:1.1.3' //compile fileTree(include: ['*.jar', '*.aar'], dir: 'libs') @@ -150,4 +151,4 @@ preBuild { println "no iml found" } } -} \ No newline at end of file +} diff --git a/app/libs/frameworks-2-full-debug.jar b/app/libs/frameworks-2-full-debug.jar new file mode 100644 index 00000000..8f0e2426 Binary files /dev/null and b/app/libs/frameworks-2-full-debug.jar differ diff --git a/app/libs/telephony_common-full-debug.jar b/app/libs/telephony-common-full-debug.jar similarity index 74% rename from app/libs/telephony_common-full-debug.jar rename to app/libs/telephony-common-full-debug.jar index e6a112c5..9aea0c67 100644 Binary files a/app/libs/telephony_common-full-debug.jar and b/app/libs/telephony-common-full-debug.jar differ diff --git a/app/src/main/java/com/enqualcomm/support/bean/ApnSetting.java b/app/src/main/java/com/enqualcomm/support/bean/ApnSetting.java new file mode 100644 index 00000000..1e594432 --- /dev/null +++ b/app/src/main/java/com/enqualcomm/support/bean/ApnSetting.java @@ -0,0 +1,188 @@ +package com.enqualcomm.support.bean; + +public class ApnSetting { + private String mNameStr; + private String mApnStr; + private String mProxyStr; + private String mPortStr; + private String mUserStr; + private String mServerStr; + private String mPasswordStr; + private String mMmscStr; + private String mMccStr; + private String mMncStr; + private String mMmsProxyStr; + private String mMmsPortStr; + private String mAuthTypeStr; + private String mApnTypeStr; + private String mProtocolStr; + private String mRoamingProtocolStr; + private String mBearerStr; + private String mMvnoTypeStr; + private String mMvnoMatchDataStr; + public ApnSetting(){} + public String getmNameStr() { + return mNameStr; + } + public void setmNameStr(String mNameStr) { + this.mNameStr = mNameStr; + } + public String getmApnStr() { + return mApnStr; + } + public void setmApnStr(String mApnStr) { + this.mApnStr = mApnStr; + } + public String getmProxyStr() { + return mProxyStr; + } + public void setmProxyStr(String mProxyStr) { + this.mProxyStr = mProxyStr; + } + public String getmPortStr() { + return mPortStr; + } + public void setmPortStr(String mPortStr) { + this.mPortStr = mPortStr; + } + public String getmUserStr() { + return mUserStr; + } + public void setmUserStr(String mUserStr) { + this.mUserStr = mUserStr; + } + public String getmServerStr() { + return mServerStr; + } + public void setmServerStr(String mServerStr) { + this.mServerStr = mServerStr; + } + public String getmPasswordStr() { + return mPasswordStr; + } + public void setmPasswordStr(String mPasswordStr) { + this.mPasswordStr = mPasswordStr; + } + public String getmMmscStr() { + return mMmscStr; + } + public void setmMmscStr(String mMmscStr) { + this.mMmscStr = mMmscStr; + } + public String getmMccStr() { + return mMccStr; + } + public void setmMccStr(String mMccStr) { + this.mMccStr = mMccStr; + } + public String getmMncStr() { + return mMncStr; + } + public void setmMncStr(String mMncStr) { + this.mMncStr = mMncStr; + } + public String getmMmsProxyStr() { + return mMmsProxyStr; + } + public void setmMmsProxyStr(String mMmsProxyStr) { + this.mMmsProxyStr = mMmsProxyStr; + } + public String getmMmsPortStr() { + return mMmsPortStr; + } + public void setmMmsPortStr(String mMmsPortStr) { + this.mMmsPortStr = mMmsPortStr; + } + public String getmAuthTypeStr() { + return mAuthTypeStr; + } + public void setmAuthTypeStr(String mAuthTypeStr) { + this.mAuthTypeStr = mAuthTypeStr; + } + public String getmApnTypeStr() { + return mApnTypeStr; + } + public void setmApnTypeStr(String mApnTypeStr) { + this.mApnTypeStr = mApnTypeStr; + } + public String getmProtocolStr() { + return mProtocolStr; + } + public void setmProtocolStr(String mProtocolStr) { + this.mProtocolStr = mProtocolStr; + } + public String getmRoamingProtocolStr() { + return mRoamingProtocolStr; + } + public void setmRoamingProtocolStr(String mRoamingProtocolStr) { + this.mRoamingProtocolStr = mRoamingProtocolStr; + } + public String getmBearerStr() { + return mBearerStr; + } + public void setmBearerStr(String mBearerStr) { + this.mBearerStr = mBearerStr; + } + public String getmMvnoTypeStr() { + return mMvnoTypeStr; + } + public void setmMvnoTypeStr(String mMvnoTypeStr) { + this.mMvnoTypeStr = mMvnoTypeStr; + } + public String getmMvnoMatchDataStr() { + return mMvnoMatchDataStr; + } + public void setmMvnoMatchDataStr(String mMvnoMatchDataStr) { + this.mMvnoMatchDataStr = mMvnoMatchDataStr; + } + @Override + public String toString() { + return "ApnSetting [mNameStr=" + mNameStr + ", mApnStr=" + mApnStr + + ", mProxyStr=" + mProxyStr + ", mPortStr=" + mPortStr + + ", mUserStr=" + mUserStr + ", mServerStr=" + mServerStr + + ", mPasswordStr=" + mPasswordStr + ", mMmscStr=" + mMmscStr + + ", mMccStr=" + mMccStr + ", mMncStr=" + mMncStr + + ", mMmsProxyStr=" + mMmsProxyStr + ", mMmsPortStr=" + + mMmsPortStr + ", mAuthTypeStr=" + mAuthTypeStr + + ", mApnTypeStr=" + mApnTypeStr + ", mProtocolStr=" + + mProtocolStr + ", mRoamingProtocolStr=" + mRoamingProtocolStr + + ", mBearerStr=" + mBearerStr + ", mMvnoTypeStr=" + + mMvnoTypeStr + ", mMvnoMatchDataStr=" + mMvnoMatchDataStr + + "]"; + } + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + }else { + if (this.getClass() == obj.getClass()) { + ApnSetting newApnSetting = (ApnSetting) obj; + if (this.getmNameStr().equals(newApnSetting.getmNameStr()) && + this.getmApnStr().equals(newApnSetting.getmApnStr()) && + this.getmProxyStr().equals(newApnSetting.getmProxyStr()) && + this.getmPortStr().equals(newApnSetting.getmPortStr()) && + this.getmUserStr().equals(newApnSetting.getmUserStr()) && + this.getmServerStr().equals(newApnSetting.getmServerStr()) && + this.getmPasswordStr().equals(newApnSetting.getmPasswordStr()) && + this.getmMmsProxyStr().equals(newApnSetting.getmMmsProxyStr()) && + this.getmMmsPortStr().equals(newApnSetting.getmMmsPortStr()) && + this.getmMmscStr().equals(newApnSetting.getmMmscStr()) && + this.getmMccStr().equals(newApnSetting.getmMccStr()) && + this.getmMncStr().equals(newApnSetting.getmMncStr()) && + this.getmAuthTypeStr().equals(newApnSetting.getmAuthTypeStr()) && + this.getmApnTypeStr().equals(newApnSetting.getmApnTypeStr()) && + this.getmProtocolStr().equals(newApnSetting.getmProtocolStr()) && + this.getmRoamingProtocolStr().equals(newApnSetting.getmRoamingProtocolStr()) && + this.getmBearerStr().equals(newApnSetting.getmBearerStr()) && + this.getmMvnoTypeStr().equals(newApnSetting.getmMvnoTypeStr()) && + this.getmMvnoMatchDataStr().equals(newApnSetting.getmMvnoMatchDataStr())) { + return true; + }else { + return false; + } + }else { + return false; + } + } + } +} diff --git a/app/src/main/java/com/enqualcomm/support/utils/ApnEditor.java b/app/src/main/java/com/enqualcomm/support/utils/ApnEditor.java new file mode 100644 index 00000000..f91a6109 --- /dev/null +++ b/app/src/main/java/com/enqualcomm/support/utils/ApnEditor.java @@ -0,0 +1,791 @@ +/* + * Copyright (C) 2006 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. + */ + +package com.enqualcomm.support.utils; + +import android.app.AlertDialog; +import android.app.Dialog; +import android.content.ContentUris; +import android.content.ContentValues; +import android.content.Context; +import android.content.DialogInterface; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.res.Resources; +import android.database.Cursor; +import android.net.Uri; +import android.os.Bundle; +import android.os.SystemProperties; +import android.preference.CheckBoxPreference; +import android.preference.EditTextPreference; +import android.preference.ListPreference; +import android.preference.Preference; +import android.preference.PreferenceActivity; +import android.preference.PreferenceScreen; +import android.provider.Settings; +import android.provider.Telephony; +import android.sim.SimManager; +import android.telephony.TelephonyManager; +import android.text.Editable; +import android.text.Selection; +import android.text.TextUtils; +import android.util.Log; +import android.view.KeyEvent; +import android.view.Menu; +import android.view.MenuItem; +import android.widget.EditText; +import android.widget.TextView; + +import com.android.internal.telephony.TelephonyProperties; +import com.enqualcomm.support.R; +import com.enqualcomm.support.bean.ApnSetting; + +import static android.content.Context.TELEPHONY_SERVICE; + + +public class ApnEditor { + + private final static String TAG = ApnEditor.class.getSimpleName(); + private Context mContext=null; + private final static String SAVED_POS = "pos"; + private final static String KEY_AUTH_TYPE = "auth_type"; + private final static String KEY_PROTOCOL = "apn_protocol"; + private final static String KEY_ROAMING_PROTOCOL = "apn_roaming_protocol"; + private final static String KEY_CARRIER_ENABLED = "carrier_enabled"; + private final static String KEY_BEARER = "bearer"; + private final static String KEY_MVNO_TYPE = "mvno_type"; + private final static String KEY_APN_TYPE = "apn_type"; + public final static String APN_EDITABLE = "editable"; + + private static final int MENU_DELETE = Menu.FIRST; + private static final int MENU_SAVE = Menu.FIRST + 1; + private static final int MENU_CANCEL = Menu.FIRST + 2; + private static final int ERROR_DIALOG_ID = 0; + private static final String APN_TYPE = "APN_TYPE"; + private static final String IS_RELOADED = "IS_PRELOADED"; + /* SPRD: add for bug717733 @{ */ + private static final String CUCC = "cucc"; + private final static String XCAP = ",xcap"; + private final static String CURRENT_CARRIER = "ro.operator"; + public final static String SPECIAL_CTCC_NUMERIC = "20404"; + public final static String CTCC_ICCID = "898603,898611"; + /* @} */ + private static String sNotSet; + private EditTextPreference mName; + private EditTextPreference mApn; + private EditTextPreference mProxy; + private EditTextPreference mPort; + private EditTextPreference mUser; + private EditTextPreference mServer; + private EditTextPreference mPassword; + private EditTextPreference mMmsc; + private EditTextPreference mMcc; + private EditTextPreference mMnc; + private EditTextPreference mMmsProxy; + private EditTextPreference mMmsPort; + private ListPreference mAuthType; + private Preference mApnType; + private ListPreference mProtocol; + private ListPreference mRoamingProtocol; + private CheckBoxPreference mCarrierEnabled; + private ListPreference mBearer; + private ListPreference mMvnoType; + private EditTextPreference mMvnoMatchData; + + private String mCurMnc; + private String mCurMcc; + private int mPhoneId = 0; // SPRD: add by spreadst + + private Uri mUri; + private Cursor mCursor; + private boolean mNewApn; + private boolean mFirstTime; + private boolean mIsPreloaded = false; // SPRD: for cmcc case, preloaded apns should not be editable or deleted. + private Resources mRes; + private TelephonyManager mTelephonyManager; + private String mRecordApnType; + // SPRD: modify for bug271734 + private String mApnTypeSummary; + private boolean mIsdelete = false; + //compare apn setting values whether change + private ApnSetting mApnSetting = new ApnSetting(); + private ApnSetting mNewApnSetting = new ApnSetting(); + + // SPRD: FEATURE_APN_CAN_BE_EMTPY + private boolean mAllowEmptyApn = SystemProperties.get(CURRENT_CARRIER, "default") + .equals("orange"); + // SPRD: FEATURE_APN_NOT_EDITABLE + /* SPRD: add for bug675438 @{ */ + private boolean mApnEditable = true; + /* @} */ + /* SPRD: Bug 628333 modify for support virtual operator @{ */ + private String mMvnoTypeStr; + private String mMvnoMatchDataStr; + /* @} */ + + // SPRD: Bug 645213 don't allow to modify mvno value + private boolean mVirtualOperator = false; + /** + * Standard projection for the interesting columns of a normal note. + */ + private static final String[] sProjection = new String[] { + Telephony.Carriers._ID, // 0 + Telephony.Carriers.NAME, // 1 + Telephony.Carriers.APN, // 2 + Telephony.Carriers.PROXY, // 3 + Telephony.Carriers.PORT, // 4 + Telephony.Carriers.USER, // 5 + Telephony.Carriers.SERVER, // 6 + Telephony.Carriers.PASSWORD, // 7 + Telephony.Carriers.MMSC, // 8 + Telephony.Carriers.MCC, // 9 + Telephony.Carriers.MNC, // 10 + Telephony.Carriers.NUMERIC, // 11 + Telephony.Carriers.MMSPROXY,// 12 + Telephony.Carriers.MMSPORT, // 13 + Telephony.Carriers.AUTH_TYPE, // 14 + Telephony.Carriers.TYPE, // 15 + Telephony.Carriers.PROTOCOL, // 16 + Telephony.Carriers.CARRIER_ENABLED, // 17 + Telephony.Carriers.BEARER, // 18 + Telephony.Carriers.ROAMING_PROTOCOL, // 19 + Telephony.Carriers.MVNO_TYPE, // 20 + Telephony.Carriers.MVNO_MATCH_DATA, // 21 + "preload", +// Telephony.Carriers.PRELOAD, // SPRD: for cmcc case, preloaded apns should not be editable or deleted. + APN_EDITABLE //23 + }; + + private static final int ID_INDEX = 0; + private static final int NAME_INDEX = 1; + private static final int APN_INDEX = 2; + private static final int PROXY_INDEX = 3; + private static final int PORT_INDEX = 4; + private static final int USER_INDEX = 5; + private static final int SERVER_INDEX = 6; + private static final int PASSWORD_INDEX = 7; + private static final int MMSC_INDEX = 8; + private static final int MCC_INDEX = 9; + private static final int MNC_INDEX = 10; + private static final int MMSPROXY_INDEX = 12; + private static final int MMSPORT_INDEX = 13; + private static final int AUTH_TYPE_INDEX = 14; + private static final int TYPE_INDEX = 15; + private static final int PROTOCOL_INDEX = 16; + private static final int CARRIER_ENABLED_INDEX = 17; + private static final int BEARER_INDEX = 18; + private static final int ROAMING_PROTOCOL_INDEX = 19; + private static final int MVNO_TYPE_INDEX = 20; + private static final int MVNO_MATCH_DATA_INDEX = 21; + private static final int PRELOAD_INDEX = 22; // SPRD: for cmcc case, preloaded apns should not be editable or deleted. + private static final int EDITABLE_INDEX = 23; + + /* SPRD: add for bug685803 @{ */ +// private FeatureBarHelper mFeatureBarHelper; +// private TextView mLeftSkView; +// private TextView mCenterSkView; +// private TextView mRightSkView; + /* @} */ + + + public ApnEditor(Context context) { + + mContext=context; +// addPreferencesFromResource(R.xml.apn_editor); + + /* SPRD: add for bug685803 @{ */ +// mFeatureBarHelper = new FeatureBarHelper(this); +// mLeftSkView = (TextView) mFeatureBarHelper.getOptionsKeyView(); +// mCenterSkView = (TextView) mFeatureBarHelper.getCenterKeyView(); +// mCenterSkView.setText(R.string.default_feature_bar_center); +// mRightSkView = (TextView) mFeatureBarHelper.getBackKeyView(); + /* @} */ + +// sNotSet = getResources().getString(R.string.apn_not_set); +// mName = (EditTextPreference) findPreference("apn_name"); +// mApn = (EditTextPreference) findPreference("apn_apn"); +// mProxy = (EditTextPreference) findPreference("apn_http_proxy"); +// mPort = (EditTextPreference) findPreference("apn_http_port"); +// mUser = (EditTextPreference) findPreference("apn_user"); +// mServer = (EditTextPreference) findPreference("apn_server"); +// mPassword = (EditTextPreference) findPreference("apn_password"); +// mMmsProxy = (EditTextPreference) findPreference("apn_mms_proxy"); +// mMmsPort = (EditTextPreference) findPreference("apn_mms_port"); +// mMmsc = (EditTextPreference) findPreference("apn_mmsc"); +// mMcc = (EditTextPreference) findPreference("apn_mcc"); +// mMnc = (EditTextPreference) findPreference("apn_mnc"); +// mApnType = (Preference) findPreference(KEY_APN_TYPE); +// +// mAuthType = (ListPreference) findPreference(KEY_AUTH_TYPE); +// +// +// mProtocol = (ListPreference) findPreference(KEY_PROTOCOL); +// +// +// mRoamingProtocol = (ListPreference) findPreference(KEY_ROAMING_PROTOCOL); +// +// mCarrierEnabled = (CheckBoxPreference) findPreference(KEY_CARRIER_ENABLED); +// +// +// mBearer = (ListPreference) findPreference(KEY_BEARER); +// mBearer.setOnPreferenceChangeListener(this); +// +// mMvnoType = (ListPreference) findPreference(KEY_MVNO_TYPE); +// mMvnoType.setOnPreferenceChangeListener(this); +// mMvnoMatchData = (EditTextPreference) findPreference("mvno_match_data"); + + mRes = context.getResources(); + +// final Intent intent = getIntent(); +// final String action = intent.getAction(); + + /* SPRD: for multi-sim @{ */ +// if (TelephonyManager.isMultiSim()) { +// // Read the mPhoneId received from Phone settings. +// mPhoneId = intent.getIntExtra(WirelessSettings.SUB_ID, 0); +// this.setTitle(mRes.getString(R.string.apn_edit_ex, mPhoneId + 1)); +// Log.d(TAG, "ApnEditor onCreate received mPhoneId: " + mPhoneId); +// } else { +// this.setTitle(R.string.apn_edit); +// } + /* @} */ + +// mFirstTime = icicle == null; +// /* SPRD: modify for bug271734 @{ */ +// if(icicle != null){ +// mApnTypeSummary = icicle.getString(APN_TYPE,""); +// // SPRD: modify for bug271736 +// mIsPreloaded = icicle.getBoolean(IS_RELOADED,false); +// } +// /* @} */ +// if (action.equals(Intent.ACTION_EDIT)) { +// mUri = intent.getData(); +// } else if (action.equals(Intent.ACTION_INSERT)) { +// if (mFirstTime || icicle.getInt(SAVED_POS) == 0) { +// mUri = context.getContentResolver().insert(intent.getData(), new ContentValues()); +// } else { +// /* SPRD: for multi-sim @{ */ +// // mUri = +// // ContentUris.withAppendedId(Telephony.Carriers.CONTENT_URI, +// // icicle.getInt(SAVED_POS)); +// mUri = ContentUris.withAppendedId( +// Telephony.Carriers.getContentUri(mPhoneId,null), icicle +// .getInt(SAVED_POS)); +// /* @} */ +// } +// mNewApn = true; +// /* SPRD: Bug 628333 modify for support virtual operator @{ */ +// mMvnoTypeStr = intent.getStringExtra(ApnSettings.MVNO_TYPE); +// mMvnoMatchDataStr = intent.getStringExtra(ApnSettings.MVNO_MATCH_DATA); +// /* @} */ +// +// // If we were unable to create a new note, then just finish +// // this activity. A RESULT_CANCELED will be sent back to the +// // original activity if they requested a result. +// if (mUri == null) { +// Log.w(TAG, "Failed to insert new telephony provider into " +// + getIntent().getData()); +//// finish(); +// return; +// } +// +// // The new entry was created, so assume all will end well and +// // set the result to be returned. +//// setResult(RESULT_OK, (new Intent()).setAction(mUri.toString())); +// +// } else { +//// finish(); +// return; +// } + + /* SPRD: for bug 297172: Use common query management Cursor @{ */ + // mCursor = managedQuery(mUri, sProjection, null, null); + mCursor = mContext.getContentResolver().query(mUri, sProjection, null, null,null); + /* @} */ + mCursor.moveToFirst(); + + mTelephonyManager = (TelephonyManager) mContext.getSystemService(TELEPHONY_SERVICE); + + fillUi(); + } + + + public void onResume() { + + + /* SPRD: for bug 297172: After hanging up the phone, can not save the new apn normally @{ */ + if(mIsdelete) { + if(mCursor != null) { + mCursor.close(); + mCursor = null; + } + // final Intent intent = getIntent(); + Log.d(TAG, "Get mUri again!"); +// mUri = mContext.getContentResolver().insert(intent.getData(), new ContentValues()); + mCursor = mContext.getContentResolver().query(mUri, sProjection, null, null,null); + mCursor.moveToFirst(); + mIsdelete = false; + } + /* @} */ + + + /* SPRD: for cucc case @{ */ +// PreferenceScreen prefSet = getPreferenceScreen(); +// if (mIsPreloaded && "cucc".equals(SystemProperties.get("ro.operator", ""))) { +// prefSet.setEnabled(false); +// } else { +// prefSet.setEnabled(true); +// } + /* @} */ + + /* SPRD: FEATURE_APN_NOT_EDITABLE @{ */ +// if (!mNewApn && !mApnEditable) { +// prefSet.setEnabled(false); +// } + /* @} */ + + /* SPRD: Bug 645213 don't allow to modify mvno value @{ */ +// if (!mNewApn && mVirtualOperator) { +// mMvnoType.setEnabled(false); +// mMvnoMatchData.setEnabled(false); +// } + /* @} */ + +// getPreferenceScreen().getSharedPreferences() +// .registerOnSharedPreferenceChangeListener(this); + } + + + public void onPause() { +// getPreferenceScreen().getSharedPreferences() +// .unregisterOnSharedPreferenceChangeListener(this); +// super.onPause(); + } + + /* SPRD: for bug 297172: Use common query management Cursor @{ */ + + protected void onDestroy() { + // TODO Auto-generated method stub +// super.onDestroy(); + if(mCursor != null) { + mCursor.close(); + mCursor = null; + } + } + /* @} */ + + private boolean getApnEditable(Cursor cursor) { + String version = SystemProperties.get(CURRENT_CARRIER, "default"); + if ("vodafone".equalsIgnoreCase(version) || + "cucc".equalsIgnoreCase(version) || + ("ctcc".equalsIgnoreCase(version) && "0".equals(cursor.getString(EDITABLE_INDEX)))) { + return false; + } else { + return true; + } + } + + private void fillUi() { + // SPRD: for bug 348288: while Cursor is null, return + if (mFirstTime && mCursor.moveToFirst()) { + mFirstTime = false; + // Fill in all the values from the db in both text editor and summary + mName.setText(mCursor.getString(NAME_INDEX)); + mApn.setText(mCursor.getString(APN_INDEX)); + mProxy.setText(mCursor.getString(PROXY_INDEX)); + mPort.setText(mCursor.getString(PORT_INDEX)); + mUser.setText(mCursor.getString(USER_INDEX)); + mServer.setText(mCursor.getString(SERVER_INDEX)); + mPassword.setText(mCursor.getString(PASSWORD_INDEX)); + mMmsProxy.setText(mCursor.getString(MMSPROXY_INDEX)); + mMmsPort.setText(mCursor.getString(MMSPORT_INDEX)); + mMmsc.setText(mCursor.getString(MMSC_INDEX)); + mMcc.setText(mCursor.getString(MCC_INDEX)); + mMnc.setText(mCursor.getString(MNC_INDEX)); + // SPRD: modify for bug271734 + /* SPRD: add for bug717733 @{ */ + String strApnType = mCursor.getString(TYPE_INDEX); + mApnEditable = getApnEditable(mCursor); + Log.i(TAG, "fillUi : mApnEditable = " + mApnEditable + + ", strApnType = " + strApnType); + + + mApnTypeSummary = checkNull(strApnType); + /* @} */ + // SPRD: for cmcc case, preloaded apns should not be editable or deleted. + mIsPreloaded = ("1".equals(mCursor.getString(PRELOAD_INDEX))); + + if (mNewApn) { + /* SPRD: for multi-sim @{ */ + // String numeric = + // SystemProperties.get(TelephonyProperties.PROPERTY_ICC_OPERATOR_NUMERIC); + String numeric; + if (TelephonyManager.isMultiSim()) { + // APNs are automatically added with MCC+MNC. + // Get the value from appropriate Telephony Property based + // on the mPhoneId. + numeric = SystemProperties + .get(TelephonyManager.getProperty(TelephonyProperties.PROPERTY_ICC_OPERATOR_NUMERIC, mPhoneId)); + + } else { + numeric = SystemProperties.get(TelephonyProperties.PROPERTY_ICC_OPERATOR_NUMERIC); + } + /* @} */ + // MCC is first 3 chars and then in 2 - 3 chars of MNC + if (numeric != null && numeric.length() > 4) { + // Country code + String mcc = numeric.substring(0, 3); + // Network code + String mnc = numeric.substring(3); + // Auto populate MNC and MCC for new entries, based on what SIM reports + mMcc.setText(mcc); + mMnc.setText(mnc); + mCurMnc = mnc; + mCurMcc = mcc; + } + } + int authVal = mCursor.getInt(AUTH_TYPE_INDEX); + if (authVal != -1) { + mAuthType.setValueIndex(authVal); + } else { + mAuthType.setValue(null); + } + + mProtocol.setValue(mCursor.getString(PROTOCOL_INDEX)); + mRoamingProtocol.setValue(mCursor.getString(ROAMING_PROTOCOL_INDEX)); + mCarrierEnabled.setChecked(mCursor.getInt(CARRIER_ENABLED_INDEX)==1); + mBearer.setValue(mCursor.getString(BEARER_INDEX)); + /* SPRD: Bug 645213 don't allow to modify mvno value @{ */ + String mvnoType = checkNull(mCursor.getString(MVNO_TYPE_INDEX)); + String mvnoMatchData = checkNull(mCursor.getString(MVNO_TYPE_INDEX)); + Log.d(TAG, "fillUi mvnoType = " + mvnoType + ",mvnoMatchData = " + mvnoMatchData); + if (mvnoType.equals(sNotSet) && mvnoMatchData.equals(sNotSet)) { + mVirtualOperator = true; + } + /* @} */ + mMvnoType.setValue(mCursor.getString(MVNO_TYPE_INDEX)); + mMvnoMatchData.setEnabled(false); + mMvnoMatchData.setText(mCursor.getString(MVNO_MATCH_DATA_INDEX)); + /* SPRD: Bug 628333 modify for support virtual operator @{ */ + if (mNewApn && mMvnoTypeStr != null && mMvnoMatchDataStr != null) { + mMvnoType.setValue(mMvnoTypeStr); + mMvnoMatchData.setText(mMvnoMatchDataStr); + } + /* @} */ + } + // SPRD: modify for bug271734 + /* SPRD: add for bug713689 @{ */ + if (mNewApn && TextUtils.isEmpty(mCursor.getString(TYPE_INDEX))) { + String[] array = mContext.getResources().getStringArray(R.array.apn_type_array); + mApnTypeSummary = array[0]; + } + /* @} */ + mApnType.setSummary(mApnTypeSummary); + mName.setSummary(checkNull(mName.getText())); + mApn.setSummary(checkNull(mApn.getText())); + mProxy.setSummary(checkNull(mProxy.getText())); + mPort.setSummary(checkNull(mPort.getText())); + mUser.setSummary(checkNull(mUser.getText())); + mServer.setSummary(checkNull(mServer.getText())); + mPassword.setSummary(starify(mPassword.getText())); + mMmsProxy.setSummary(checkNull(mMmsProxy.getText())); + mMmsPort.setSummary(checkNull(mMmsPort.getText())); + mMmsc.setSummary(checkNull(mMmsc.getText())); + mMcc.setSummary(checkNull(mMcc.getText())); + mMnc.setSummary(checkNull(mMnc.getText())); + + String authVal = mAuthType.getValue(); + if (authVal != null) { + int authValIndex = Integer.parseInt(authVal); + mAuthType.setValueIndex(authValIndex); + + String[]values = mRes.getStringArray(R.array.apn_auth_entries); + mAuthType.setSummary(values[authValIndex]); + } else { + mAuthType.setSummary(sNotSet); + } + + mProtocol.setSummary( + checkNull(protocolDescription(mProtocol.getValue(), mProtocol))); + mRoamingProtocol.setSummary( + checkNull(protocolDescription(mRoamingProtocol.getValue(), mRoamingProtocol))); + mBearer.setSummary( + checkNull(bearerDescription(mBearer.getValue()))); +// mMvnoType.setSummary( +// checkNull(mvnoDescription(mMvnoType.getValue()))); + + String mvnoMatchDataSummery = mMvnoMatchData.getText(); +// if (isSpecificApnForCdma(mvnoMatchDataSummery)) { + mvnoMatchDataSummery = sNotSet; +// } + mMvnoMatchData.setSummary(checkNull(mvnoMatchDataSummery)); + //mApnSetting + mApnSetting.setmNameStr(checkNull(mName.getText())); + mApnSetting.setmApnStr(checkNull(mApn.getText())); + mApnSetting.setmProxyStr(checkNull(mProxy.getText())); + mApnSetting.setmPortStr(checkNull(mPort.getText())); + mApnSetting.setmUserStr(checkNull(mUser.getText())); + mApnSetting.setmServerStr(checkNull(mServer.getText())); + mApnSetting.setmPasswordStr(checkNull(mPassword.getText())); + mApnSetting.setmMmsProxyStr(checkNull(mMmsProxy.getText())); + mApnSetting.setmMmsPortStr(checkNull(mMmsPort.getText())); + mApnSetting.setmMmscStr(checkNull(mMmsc.getText())); + mApnSetting.setmMccStr(checkNull(mMcc.getText())); + mApnSetting.setmMncStr(checkNull(mMnc.getText())); + mApnSetting.setmApnTypeStr(mApnTypeSummary); + mApnSetting.setmAuthTypeStr(checkNull(mAuthType.getValue())); + mApnSetting.setmProtocolStr(checkNull(mProtocol.getValue())); + mApnSetting.setmRoamingProtocolStr(checkNull(mRoamingProtocol.getValue())); + mApnSetting.setmBearerStr(checkNull(mBearer.getValue())); + mApnSetting.setmMvnoTypeStr(checkNull(mMvnoType.getValue())); + mApnSetting.setmMvnoMatchDataStr(checkNull(mMvnoMatchData.getText())); + } + + /** + * Returns the UI choice (e.g., "IPv4/IPv6") corresponding to the given + * raw value of the protocol preference (e.g., "IPV4V6"). If unknown, + * return null. + */ + private String protocolDescription(String raw, ListPreference protocol) { + int protocolIndex = protocol.findIndexOfValue(raw); + if (protocolIndex == -1) { + return null; + } else { + String[] values = mRes.getStringArray(R.array.apn_protocol_entries); + try { + return values[protocolIndex]; + } catch (ArrayIndexOutOfBoundsException e) { + return null; + } + } + } + + private String bearerDescription(String raw) { + int mBearerIndex = mBearer.findIndexOfValue(raw); + if (mBearerIndex == -1) { + return null; + } else { + String[] values = mRes.getStringArray(R.array.bearer_entries); + try { + return values[mBearerIndex]; + } catch (ArrayIndexOutOfBoundsException e) { + return null; + } + } + } + + + public boolean onKeyDown(int keyCode, KeyEvent event) { + switch (keyCode) { + case KeyEvent.KEYCODE_BACK: { + if (validateAndSave(false)) { +// finish(); + } + return true; + } + } + return false; +// return super.onKeyDown(keyCode, event); + } + + /** + * Check the key fields' validity and save if valid. + * @param force save even if the fields are not valid, if the app is + * being suspended + * @return true if the data was saved + */ + private boolean validateAndSave(boolean force) { + String name = checkNotSet(mName.getText()); + String apn = checkNotSet(mApn.getText()); + String mcc = checkNotSet(mMcc.getText()); + String mnc = checkNotSet(mMnc.getText()); + + if (getErrorMsg() != null && !force) { +// showDialog(ERROR_DIALOG_ID); + return false; + } + + if (!mCursor.moveToFirst()) { + Log.w(TAG, + "Could not go to the first row in the Cursor when saving data."); + return false; + } + + // If it's a new APN and a name or apn haven't been entered, then erase the entry + // SPRD: FEATURE_APN_CAN_BE_EMTPY + if (force && mNewApn && name.length() < 1 && apn.length() < 1 && !mAllowEmptyApn) { + mContext.getContentResolver().delete(mUri, null, null); + + /* SPRD: for bug 297172: After hanging up the phone, can not save the new apn normally @{ */ + Log.d(TAG, "The mUri has delete!"); + mIsdelete = true; + /* @} */ + return false; + } + //mNewApnSetting + mNewApnSetting.setmNameStr(checkNull(mName.getText())); + mNewApnSetting.setmApnStr(checkNull(mApn.getText())); + mNewApnSetting.setmProxyStr(checkNull(mProxy.getText())); + mNewApnSetting.setmPortStr(checkNull(mPort.getText())); + mNewApnSetting.setmUserStr(checkNull(mUser.getText())); + mNewApnSetting.setmServerStr(checkNull(mServer.getText())); + mNewApnSetting.setmPasswordStr(checkNull(mPassword.getText())); + mNewApnSetting.setmMmsProxyStr(checkNull(mMmsProxy.getText())); + mNewApnSetting.setmMmsPortStr(checkNull(mMmsPort.getText())); + mNewApnSetting.setmMmscStr(checkNull(mMmsc.getText())); + mNewApnSetting.setmMccStr(checkNull(mMcc.getText())); + mNewApnSetting.setmMncStr(checkNull(mMnc.getText())); + mNewApnSetting.setmApnTypeStr(checkNull(mApnType.getSummary().toString())); + mNewApnSetting.setmAuthTypeStr(checkNull(mAuthType.getValue())); + mNewApnSetting.setmProtocolStr(checkNull(mProtocol.getValue())); + mNewApnSetting.setmRoamingProtocolStr(checkNull(mRoamingProtocol.getValue())); + mNewApnSetting.setmBearerStr(checkNull(mBearer.getValue())); + mNewApnSetting.setmMvnoTypeStr(checkNull(mMvnoType.getValue())); + mNewApnSetting.setmMvnoMatchDataStr(checkNull(mMvnoMatchData.getText())); + boolean mIsApnChange = mApnSetting.equals(mNewApnSetting) ; + if (!mIsApnChange) { + Log.d(TAG, "mApnSetting: " + mApnSetting.toString()); + Log.d(TAG, "mNewApnSetting: " + mNewApnSetting.toString()); + ContentValues values = new ContentValues(); + + // Add a dummy name "Untitled", if the user exits the screen without adding a name but + // entered other information worth keeping. + values.put(Telephony.Carriers.NAME, + name.length() < 1 ? mContext.getResources().getString(R.string.untitled_apn) : name); + values.put(Telephony.Carriers.APN, apn); + values.put(Telephony.Carriers.PROXY, checkNotSet(mProxy.getText())); + values.put(Telephony.Carriers.PORT, checkNotSet(mPort.getText())); + values.put(Telephony.Carriers.MMSPROXY, checkNotSet(mMmsProxy.getText())); + values.put(Telephony.Carriers.MMSPORT, checkNotSet(mMmsPort.getText())); + values.put(Telephony.Carriers.USER, checkNotSet(mUser.getText())); + values.put(Telephony.Carriers.SERVER, checkNotSet(mServer.getText())); + values.put(Telephony.Carriers.PASSWORD, checkNotSet(mPassword.getText())); + values.put(Telephony.Carriers.MMSC, checkNotSet(mMmsc.getText())); + + String authVal = mAuthType.getValue(); + if (authVal != null) { + values.put(Telephony.Carriers.AUTH_TYPE, Integer.parseInt(authVal)); + } + + values.put(Telephony.Carriers.PROTOCOL, checkNotSet(mProtocol.getValue())); + values.put(Telephony.Carriers.ROAMING_PROTOCOL, checkNotSet(mRoamingProtocol.getValue())); + + if (mApnType.getSummary() != null) { + values.put(Telephony.Carriers.TYPE, checkNotSet(mApnType.getSummary().toString())); + } + + values.put(Telephony.Carriers.MCC, mcc); + values.put(Telephony.Carriers.MNC, mnc); + + values.put(Telephony.Carriers.NUMERIC, mcc + mnc); + + /* SPRD: for multi-sim @{ */ + int mDDS = 0; + try { + mDDS = Settings.System + .getInt(mContext.getContentResolver(), Settings.System.MULTI_SIM_DATA_CALL); + } catch (Exception e) { + Log.e(TAG, "Exception Reading Dual Sim Data Subscription Value.", e); + } + /* @} */ + + if (mCurMnc != null && mCurMcc != null) { + // SPRD: add by spreadst + if (mCurMnc.equals(mnc) && mCurMcc.equals(mcc) && mPhoneId == mDDS) { + // if (mCurMnc.equals(mnc) && mCurMcc.equals(mcc)) { + values.put(Telephony.Carriers.CURRENT, 1); + } + } + + String bearerVal = mBearer.getValue(); + if (bearerVal != null) { + values.put(Telephony.Carriers.BEARER, Integer.parseInt(bearerVal)); + } +// if (SPECIAL_CTCC_NUMERIC.equals(mcc+mnc) && isSpecificApnForCdma(CTCC_ICCID)) { +// values.put(Telephony.Carriers.MVNO_TYPE, "iccid"); +// values.put(Telephony.Carriers.MVNO_MATCH_DATA, CTCC_ICCID); +// } else { + values.put(Telephony.Carriers.MVNO_TYPE, checkNotSet(mMvnoType.getValue())); + values.put(Telephony.Carriers.MVNO_MATCH_DATA, checkNotSet(mMvnoMatchData.getText())); +// } + + mContext.getContentResolver().update(mUri, values, null, null); + } + return true; + } + + private String getErrorMsg() { + String errorMsg = null; + + String name = checkNotSet(mName.getText()); + String apn = checkNotSet(mApn.getText()); + String mcc = checkNotSet(mMcc.getText()); + String mnc = checkNotSet(mMnc.getText()); + String apnString = (String) mApnType.getSummary(); + String apnType = checkNotSet(apnString); + + if (name.length() < 1) { + errorMsg = mRes.getString(R.string.error_name_empty); + // SPRD: FEATURE_APN_CAN_BE_EMTPY + } else if (apn.length() < 1 && !mAllowEmptyApn) { + errorMsg = mRes.getString(R.string.error_apn_empty); + } else if (mcc.length() != 3) { + errorMsg = mRes.getString(R.string.error_mcc_not3); + } else if ((mnc.length() & 0xFFFE) != 2) { + errorMsg = mRes.getString(R.string.error_mnc_not23); + } else if (apnType.equals("")) { + errorMsg = mRes.getString(R.string.error_apn_type_message); + } + + return errorMsg; + } + + + + private void deleteApn() { + mContext.getContentResolver().delete(mUri, null, null); +// finish(); + } + + private String starify(String value) { + if (value == null || value.length() == 0) { + return sNotSet; + } else { + char[] password = new char[value.length()]; + for (int i = 0; i < password.length; i++) { + password[i] = '*'; + } + return new String(password); + } + } + + private String checkNull(String value) { + if (value == null || value.length() == 0) { + return sNotSet; + } else { + return value; + } + } + + private String checkNotSet(String value) { + if (value == null || value.equals(sNotSet)) { + return ""; + } else { + return value; + } + } + +} diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml new file mode 100644 index 00000000..562a7ce1 --- /dev/null +++ b/app/src/main/res/values/arrays.xml @@ -0,0 +1,987 @@ + + + + + + + None + PAP + CHAP + PAP or CHAP + + + + + 0 + + 1 + + 2 + + 3 + + + + + IPv4 + IPv6 + IPv4/IPv6 + + + + + IP + + IPV6 + + IPV4V6 + + + + + LTE + eHRPD + Unspecified + + + + + 14 + + 13 + + 0 + + + + + + None + + SPN + + IMSI + + GID + + PNN + + + + + + + spn + + imsi + + gid + + pnn + + + + + Internal device storage + Removable SD card + Let the system decide + + + + + Internal device storage + Mobile internal storage + Let the system decide + + + + + device + sdcard + auto + + + + + device + internal sdcard + auto + + + + + + SIM 1 + SIM 2 + Always prompt + + + + SIM 1 + SIM 2 + + + + SIM 1 + SIM 2 + Always prompt + auto + + + + + SIM 1 + SIM 2 + + + + SIM 1 + SIM 2 + Always prompt + + + + + + 0 + + 1 + + + + + 0 + + 1 + + -1 + + + + + 0 + + 1 + + + + + 0 + + 1 + + -1 + 3 + + + + + Off + Vibrate + Mute + + + + + off + vibrate + mute + + + + + + Location + Personal + Messaging + Media + Device + + + + + coarse location + fine location + GPS + vibrate + read contacts + modify contacts + read call log + modify call log + read calendar + modify calendar + wi-fi scan + notification + cell scan + call phone + read SMS + write SMS + receive SMS + receive emergency SMS + receive MMS + receive WAP push + send SMS + read ICC SMS + write ICC SMS + modify settings + draw on top + access notifications + camera + record audio + play audio + read clipboard + modify clipboard + media buttons + audio focus + master volume + voice volume + ring volume + media volume + alarm volume + notification volume + bluetooth volume + keep awake + monitor location + monitor high power location + + + + + Location + Location + Location + Vibrate + Read contacts + Modify contacts + Read call log + Modify call log + Read calendar + Modify calendar + Location + Post notification + Location + Call phone + Read SMS/MMS + Write SMS/MMS + Receive SMS/MMS + Receive SMS/MMS + Receive SMS/MMS + Receive SMS/MMS + Send SMS/MMS + Read SMS/MMS + Write SMS/MMS + Modify settings + Draw on top + Access notifications + Camera + Record audio + Play audio + Read clipboard + Modify clipboard + Media buttons + Audio focus + Master volume + Voice volume + Ring volume + Media volume + Alarm volume + Notification volume + Bluetooth volume + Keep awake + Location + Location + + + + + + Short + + Medium + + Long + + + + + 500 + 1000 + 1500 + + + + + Default + Sans-serif + Sans-serif condensed + Serif + Monospace + + + + + + sans-serif + sans-serif-condensed + serif + monospace + + + + + Very small + Small + Normal + Large + Very large + + + + + 0.25 + 0.5 + 1.0 + 1.25 + 1.5 + + + + + None + Outline + Drop shadow + + + + + 0 + 1 + 2 + + + + + + + 0xFFFFFFFF + 0xFF000000 + 0xFFFF0000 + 0xFFFFFF00 + 0xFF00FF00 + 0xFF00FFFF + 0xFF0000FF + 0xFFFF00FF + 0xFF000055 + 0xFF0000AA + 0xFF005500 + 0xFF005555 + 0xFF0055AA + 0xFF0055FF + 0xFF00AA00 + 0xFF00AA55 + 0xFF00AAAA + 0xFF00AAFF + 0xFF00FF55 + 0xFF00FFAA + 0xFF550000 + 0xFF550055 + 0xFF5500AA + 0xFF5500FF + 0xFF555500 + 0xFF555555 + 0xFF5555AA + 0xFF5555FF + 0xFF55AA00 + 0xFF55AA55 + 0xFF55AAAA + 0xFF55AAFF + 0xFF55FF00 + 0xFF55FF55 + 0xFF55FFAA + 0xFF55FFFF + 0xFFAA0000 + 0xFFAA0055 + 0xFFAA00AA + 0xFFAA00FF + 0xFFAA5500 + 0xFFAA5555 + 0xFFAA55AA + 0xFFAA55FF + 0xFFAAAA00 + 0xFFAAAA55 + 0xFFAAAAAA + 0xFFAAAAFF + 0xFFAAFF00 + 0xFFAAFF55 + 0xFFAAFFAA + 0xFFAAFFFF + 0xFFFF0055 + 0xFFFF00AA + 0xFFFF5500 + 0xFFFF5555 + 0xFFFF55AA + 0xFFFF55FF + 0xFFFFAA00 + 0xFFFFAA55 + 0xFFFFAAAA + 0xFFFFAAFF + 0xFFFFFF55 + 0xFFFFFFAA + + + + + 25% + 50% + 75% + 100% + + + + + 0x40FFFFFF + 0x80FFFFFF + 0xC0FFFFFF + 0xFFFFFFFF + + + + + White on black + Black on white + Yellow on black + Yellow on blue + Custom + + + + + 0 + 1 + 2 + 3 + -1 + + + + + Dalvik + ART + ART (debug) + + + + + libdvm.so + libart.so + libartd.so + + + + + Use Dalvik + Use ART + Use ART debug build + + + + + Never check + Check for DRM content only + Always check + + + + + never + drm-only + always + + + + + Never use HDCP checking + Use HDCP checking for DRM content only + Always use HDCP checking + + + + + Animation off + Animation scale .5x + Animation scale 1x + Animation scale 1.5x + Animation scale 2x + Animation scale 5x + Animation scale 10x + + + + + 0 + .5 + 1 + 1.5 + 2 + 5 + 10 + + + + + Animation off + Animation scale .5x + Animation scale 1x + Animation scale 1.5x + Animation scale 2x + Animation scale 5x + Animation scale 10x + + + + + 0 + .5 + 1 + 1.5 + 2 + 5 + 10 + + + + + Animation off + Animation scale .5x + Animation scale 1x + Animation scale 1.5x + Animation scale 2x + Animation scale 5x + Animation scale 10x + + + + + 0 + .5 + 1 + 1.5 + 2 + 5 + 10 + + + + + None + 720x480 mdpi + 720x480 mdpi (secure) + 1280x720 tvdpi + 1280x720 tvdpi (secure) + 1920x1080 xhdpi + 1920x1080 xhdpi (secure) + 1280x720 tvdpi and 1920x1080 xhdpi + + + + + + 720x480/160 + 720x480/160,secure + 1280x720/213 + 1280x720/213,secure + 1920x1080/320 + 1920x1080/320,secure + 1280x720/213;1920x1080/320 + + + + + None + Logcat + Systrace (Graphics) + Call stack on glGetError + + + + + 0 + 1 + systrace + error + + + + + Off + Draw non-rectangular clip region in blue + Highlight tested drawing commands in green + + + + + hide + region + highlight + + + + + Off + On screen as bars + On screen as lines + In adb shell dumpsys gfxinfo + + + + + false + visual_bars + visual_lines + true + + + + + Off + Show overdraw areas + Show areas for Deuteranomaly + Show overdraw counter + + + + + false + show + show_deuteranomaly + count + + + + + Standard limit + No background processes + At most 1 process + At most 2 processes + At most 3 processes + At most 4 processes + + + + + -1 + 0 + 1 + 2 + 3 + 4 + + + + + + PPTP + L2TP/IPSec PSK + L2TP/IPSec RSA + IPSec Xauth PSK + IPSec Xauth RSA + IPSec Hybrid RSA + + + + + + PPTP VPN + L2TP/IPSec VPN with pre-shared keys + L2TP/IPSec VPN with certificates + IPSec VPN with pre-shared keys and Xauth authentication + IPSec VPN with certificates and Xauth authentication + IPSec VPN with certificates and hybrid authentication + + + + + + + Disconnected + + Initializing\u2026 + + Connecting\u2026 + + Connected + + Timeout + + Unsuccessful + + + + + Ascended being + Human + Neanderthal + Chimp + Monkey + + + + + 5 + 4 + 3 + 2 + 1 + + + + + + Ask + + Never allow + + Always allow + + + + + + normal + + moderate + + low + + critical + + + + + This is set for less than 1 minute from now. + This is set for %1$s from now. + This is set for %2$s from now. + This is set for %1$s and %2$s from now. + This is set for %3$s from now. + This is set for %1$s and %3$s from now. + This is set for %2$s and %3$s from now. + This is set for %1$s, %2$s, and %3$s from now. + + + + + + com.iflytek.inputmethod + com.android.dialer + + + + + + com.android.providers.downloads.ui + com.android.providers.downloads + com.android.dialer + com.android.contacts + com.android.mms + + com.android.music + com.android.providers.userdictionary + com.android.providers.calendar + com.android.calendar + com.android.providers.media + com.android.providers.contacts + com.google.android.inputmethod.latin + com.android.inputmethod.latin + + + + + + + + + com.android.settings + com.android.smspush + com.android.providers.telephony + com.android.phone + com.android.defcontainer + jp.co.omronsoft.openwnn + com.android.systemui + android + com.android.providers.settings + com.android.musicfx + com.android.providers.applications + com.android.providers.contacts + com.android.providers.userdictionary + com.android.quicksearchbox + com.svox.pico + com.android.gallery3d + com.android.keychain + com.android.launcher + com.android.browser + com.android.deskclock + com.android.providers.calendar + com.android.calendar + com.android.email + com.android.exchange + com.android.providers.drm + com.android.providers.downloads + com.android.providers.media + com.android.contacts + com.google.android.apps.maps + com.android.inputmethod.latin + + com.sprd.audioprofile + com.sprd.ramoptimizer + com.android.launcher3 + com.android.sprdlauncher2 + + + + com.sprd.ramoptimizer + + 1 + + + + + 1 + 0 + + + + + + 0 + 1 + 2 + + + Auto Connect + Manual Connect + Always Ask + + + + + + 1 + 2 + 3 + 4 + + + + + default + mms + supl + dun + hipri + + + + * + default + mms + supl + dun + hipri + fota + ims + cbs + wap + dm + stk + xcap + + + + + MONTERNET + GOOGLE + NOKIA + + + 0 + 1 + 2 + + + msb + msa + + + 1 + 2 + + + open + close + + + 1 + 2 + + + + + Use network-provided time + Use GPS-provided time + Off + + + Use network-provided time + Off + + + + + Teal + Blue + Indigo + Purple + Pink + Red + + + + + Always + Turn off when idle for 5 mins + Turn off when idle for 10 mins + + + 0 + 1 + 2 + + + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d4303234..54a0de9c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -150,5 +150,31 @@ 法语 德语 + + Untitled + + + + The Name field can\'t be empty. + + The APN can\'t be empty. + + MCC field must be 3 digits. + + MNC field must be 2 or 3 digits. + + Restoring default APN settings. + + Reset to default + + Reset default APN settings completed. + "Setting apn type" + "User could input apn type" + "Could not input the same apn type" + "There does not contain a default type in your new APN, will not be able to select the APN." + "APN type cannot be empty" + "Apn type you entered is not supported, please re-enter!" + "You have entered the same type of APN, please re-enter!" + "You did not entered or select any type of APN, please re-enter!" diff --git a/build.gradle b/build.gradle index f9afab39..3ee80266 100644 --- a/build.gradle +++ b/build.gradle @@ -3,10 +3,12 @@ buildscript { repositories { jcenter() - maven { - url 'https://maven.google.com/' - name 'Google' - } + maven { + url 'https://maven.aliyun.com/repository/public/' + name 'Google' + } + mavenLocal() + mavenCentral() google() } dependencies { @@ -23,13 +25,18 @@ allprojects { jcenter() maven { url 'https://jitpack.io' } maven { - url 'https://maven.google.com/' + url 'https://maven.aliyun.com/repository/public/' name 'Google' } + mavenLocal() + mavenCentral() + google() } + gradle.projectsEvaluated { tasks.withType(JavaCompile) { options.compilerArgs.add('-Xbootclasspath/p:app\\libs\\frameworks-full-debug.jar') +// options.compilerArgs.add('-Xbootclasspath/p:app\\libs\\frameworks-2-full-debug.jar') } } } diff --git a/core/core.iml b/core/core.iml deleted file mode 100644 index 8f38a0d3..00000000 --- a/core/core.iml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file