summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/ApnSettings.java
diff options
context:
space:
mode:
authorMick Lin <Mick.Lin@mediatek.com>2015-01-27 23:33:04 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-01-27 23:33:04 +0000
commit005f972b143cf9a0b023095cd6258d8ccdbbb8de (patch)
tree9b324589c5ce3a6e5033b0a54aa898b89bfc38d7 /src/com/android/settings/ApnSettings.java
parent971dd3bd97fad28a87c699f0abcecb7a5805b2a1 (diff)
parentc0570dc45529ab5fa3cbfcf33454a57b5eb16a23 (diff)
downloadpackages_apps_Settings-005f972b143cf9a0b023095cd6258d8ccdbbb8de.zip
packages_apps_Settings-005f972b143cf9a0b023095cd6258d8ccdbbb8de.tar.gz
packages_apps_Settings-005f972b143cf9a0b023095cd6258d8ccdbbb8de.tar.bz2
am c0570dc4: am 271aa608: am 09c9e5eb: [DS] Correct the access method for telephony system property
* commit 'c0570dc45529ab5fa3cbfcf33454a57b5eb16a23': [DS] Correct the access method for telephony system property
Diffstat (limited to 'src/com/android/settings/ApnSettings.java')
-rw-r--r--src/com/android/settings/ApnSettings.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/com/android/settings/ApnSettings.java b/src/com/android/settings/ApnSettings.java
index 61f741b..670924c 100644
--- a/src/com/android/settings/ApnSettings.java
+++ b/src/com/android/settings/ApnSettings.java
@@ -40,6 +40,7 @@ import android.preference.PreferenceGroup;
import android.preference.PreferenceScreen;
import android.provider.Telephony;
import android.telephony.SubscriptionInfo;
+import android.telephony.SubscriptionManager;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
@@ -132,7 +133,8 @@ public class ApnSettings extends SettingsPreferenceFragment implements
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
final Activity activity = getActivity();
- final int subId = activity.getIntent().getIntExtra("sub_id", -1);
+ final int subId = activity.getIntent().getIntExtra("sub_id",
+ SubscriptionManager.INVALID_SUBSCRIPTION_ID);
mUm = (UserManager) getSystemService(Context.USER_SERVICE);
@@ -287,7 +289,11 @@ public class ApnSettings extends SettingsPreferenceFragment implements
}
private void addNewApn() {
- startActivity(new Intent(Intent.ACTION_INSERT, Telephony.Carriers.CONTENT_URI));
+ Intent intent = new Intent(Intent.ACTION_INSERT, Telephony.Carriers.CONTENT_URI);
+ int subId = mSubscriptionInfo != null ? mSubscriptionInfo.getSubscriptionId()
+ : SubscriptionManager.INVALID_SUBSCRIPTION_ID;
+ intent.putExtra("sub_id", subId);
+ startActivity(intent);
}
@Override