Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/ExtQuickSettingsModel.java +29 −9 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ import android.view.View; import com.android.internal.telephony.MSimConstants; import com.android.internal.telephony.IccCardConstants; import com.android.internal.telephony.PhoneConstants; import com.android.internal.telephony.TelephonyIntents; import com.android.internal.telephony.TelephonyProperties; import com.android.internal.view.RotationPolicy; Loading Loading @@ -111,9 +112,11 @@ class ExtQuickSettingsModel extends QuickSettingsModel { // if the given next apn is null, we will use the saved next apn to switch. if (apn == null) { apn = mNextApn; } else { } // We will only set the prefer apn to the next apn, and then the data base will be // changed, so we will update the view when we receive the content changed message. if (apn != null) { if (DEBUG) Log.i(TAG, "switch to the next apn, and it's id: " + apn.id); ContentValues values = new ContentValues(); values.put(APN_ID, apn.id); Loading Loading @@ -268,18 +271,35 @@ class ExtQuickSettingsModel extends QuickSettingsModel { } } String property = TelephonyProperties.PROPERTY_APN_SIM_OPERATOR_NUMERIC; int dataSub = 0; String property = null; String mccMncFromSim = null; int activePhone = 0; if (MSimTelephonyManager.getDefault().isMultiSimEnabled()) { MSimTelephonyManager msimTM = (MSimTelephonyManager) mContext.getSystemService(Context.MSIM_TELEPHONY_SERVICE); int prefDataSub = msimTM.getPreferredDataSubscription(); mccMncFromSim = MSimTelephonyManager.getTelephonyProperty(property, prefDataSub, null); dataSub = msimTM.getPreferredDataSubscription(); activePhone = MSimTelephonyManager.getDefault().getPhoneType(dataSub); } else { dataSub = TelephonyManager.getDefaultSubscription(); activePhone = TelephonyManager.getDefault().getPhoneType(dataSub); } if (activePhone == PhoneConstants.PHONE_TYPE_CDMA) { property = TelephonyProperties.PROPERTY_APN_RUIM_OPERATOR_NUMERIC; } else { property = TelephonyProperties.PROPERTY_APN_SIM_OPERATOR_NUMERIC; } if (MSimTelephonyManager.getDefault().isMultiSimEnabled()) { mccMncFromSim = MSimTelephonyManager .getTelephonyProperty(property, dataSub, null); } else { int defaultSub = TelephonyManager.getDefaultSubscription(); mccMncFromSim = TelephonyManager.getTelephonyProperty(property, defaultSub, null); mccMncFromSim = TelephonyManager .getTelephonyProperty(property, dataSub, null); } if (mccMncFromSim != null && mccMncFromSim.length() > 0) { result.add(mccMncFromSim); } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java +4 −13 Original line number Diff line number Diff line Loading @@ -824,21 +824,12 @@ class QuickSettings { apnTile.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startSettingsActivity(android.provider.Settings.ACTION_APN_SETTINGS); } }); if (LONG_PRESS_TOGGLES) { apnTile.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { if (mModel != null && mModel.getApnState() != null) { mModel.getApnState().switchToNextApn(null); } apnTile.setPressed(false); return true; } }); } mModel.addApnTile(apnTile, new QuickSettingsModel.RefreshCallback() { @Override public void refreshView(QuickSettingsTileView view, State state) { Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/ExtQuickSettingsModel.java +29 −9 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ import android.view.View; import com.android.internal.telephony.MSimConstants; import com.android.internal.telephony.IccCardConstants; import com.android.internal.telephony.PhoneConstants; import com.android.internal.telephony.TelephonyIntents; import com.android.internal.telephony.TelephonyProperties; import com.android.internal.view.RotationPolicy; Loading Loading @@ -111,9 +112,11 @@ class ExtQuickSettingsModel extends QuickSettingsModel { // if the given next apn is null, we will use the saved next apn to switch. if (apn == null) { apn = mNextApn; } else { } // We will only set the prefer apn to the next apn, and then the data base will be // changed, so we will update the view when we receive the content changed message. if (apn != null) { if (DEBUG) Log.i(TAG, "switch to the next apn, and it's id: " + apn.id); ContentValues values = new ContentValues(); values.put(APN_ID, apn.id); Loading Loading @@ -268,18 +271,35 @@ class ExtQuickSettingsModel extends QuickSettingsModel { } } String property = TelephonyProperties.PROPERTY_APN_SIM_OPERATOR_NUMERIC; int dataSub = 0; String property = null; String mccMncFromSim = null; int activePhone = 0; if (MSimTelephonyManager.getDefault().isMultiSimEnabled()) { MSimTelephonyManager msimTM = (MSimTelephonyManager) mContext.getSystemService(Context.MSIM_TELEPHONY_SERVICE); int prefDataSub = msimTM.getPreferredDataSubscription(); mccMncFromSim = MSimTelephonyManager.getTelephonyProperty(property, prefDataSub, null); dataSub = msimTM.getPreferredDataSubscription(); activePhone = MSimTelephonyManager.getDefault().getPhoneType(dataSub); } else { dataSub = TelephonyManager.getDefaultSubscription(); activePhone = TelephonyManager.getDefault().getPhoneType(dataSub); } if (activePhone == PhoneConstants.PHONE_TYPE_CDMA) { property = TelephonyProperties.PROPERTY_APN_RUIM_OPERATOR_NUMERIC; } else { property = TelephonyProperties.PROPERTY_APN_SIM_OPERATOR_NUMERIC; } if (MSimTelephonyManager.getDefault().isMultiSimEnabled()) { mccMncFromSim = MSimTelephonyManager .getTelephonyProperty(property, dataSub, null); } else { int defaultSub = TelephonyManager.getDefaultSubscription(); mccMncFromSim = TelephonyManager.getTelephonyProperty(property, defaultSub, null); mccMncFromSim = TelephonyManager .getTelephonyProperty(property, dataSub, null); } if (mccMncFromSim != null && mccMncFromSim.length() > 0) { result.add(mccMncFromSim); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java +4 −13 Original line number Diff line number Diff line Loading @@ -824,21 +824,12 @@ class QuickSettings { apnTile.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startSettingsActivity(android.provider.Settings.ACTION_APN_SETTINGS); } }); if (LONG_PRESS_TOGGLES) { apnTile.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { if (mModel != null && mModel.getApnState() != null) { mModel.getApnState().switchToNextApn(null); } apnTile.setPressed(false); return true; } }); } mModel.addApnTile(apnTile, new QuickSettingsModel.RefreshCallback() { @Override public void refreshView(QuickSettingsTileView view, State state) { Loading