summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJing Zhao <zhaojing@motorola.com>2014-08-26 14:44:02 -0500
committerVineeta Srivastava <vsrivastava@google.com>2014-08-28 16:22:19 +0000
commitf04d69a1d405f88b2bebacd63c77e91789e81616 (patch)
treeefeb3d3a5f51965134a76557155387eb74387375
parentddc9b2ce2377edd7ce914813be374c91be150569 (diff)
downloadpackages_apps_Settings-f04d69a1d405f88b2bebacd63c77e91789e81616.zip
packages_apps_Settings-f04d69a1d405f88b2bebacd63c77e91789e81616.tar.gz
packages_apps_Settings-f04d69a1d405f88b2bebacd63c77e91789e81616.tar.bz2
Test APNs
Add test APNs to carriers table. Enable APN Setting editing for testing PLMNs. Allow user to toggle carrier_enabled for test APNs. Bug: 17136661 Change-Id: Ieabfac5ea02a5b9971c7050d8278ad0095863e3a
-rwxr-xr-xres/values-mcc001-mnc01/config.xml21
-rwxr-xr-xres/values-mcc001-mnc010/config.xml21
-rwxr-xr-xres/values-mcc246-mnc081/config.xml21
-rwxr-xr-xres/values-mcc310-mnc028/config.xml21
-rwxr-xr-xres/values-mcc311-mnc390/config.xml21
-rwxr-xr-xres/values/config.xml2
-rw-r--r--src/com/android/settings/ApnEditor.java10
7 files changed, 117 insertions, 0 deletions
diff --git a/res/values-mcc001-mnc01/config.xml b/res/values-mcc001-mnc01/config.xml
new file mode 100755
index 0000000..76127d4
--- /dev/null
+++ b/res/values-mcc001-mnc01/config.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2007 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.
+-->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+ <!-- Carrier_enabled editable -->
+ <bool name="config_allow_edit_carrier_enabled" translatable="false">true</bool>
+</resources>
diff --git a/res/values-mcc001-mnc010/config.xml b/res/values-mcc001-mnc010/config.xml
new file mode 100755
index 0000000..76127d4
--- /dev/null
+++ b/res/values-mcc001-mnc010/config.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2007 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.
+-->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+ <!-- Carrier_enabled editable -->
+ <bool name="config_allow_edit_carrier_enabled" translatable="false">true</bool>
+</resources>
diff --git a/res/values-mcc246-mnc081/config.xml b/res/values-mcc246-mnc081/config.xml
new file mode 100755
index 0000000..76127d4
--- /dev/null
+++ b/res/values-mcc246-mnc081/config.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2007 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.
+-->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+ <!-- Carrier_enabled editable -->
+ <bool name="config_allow_edit_carrier_enabled" translatable="false">true</bool>
+</resources>
diff --git a/res/values-mcc310-mnc028/config.xml b/res/values-mcc310-mnc028/config.xml
new file mode 100755
index 0000000..76127d4
--- /dev/null
+++ b/res/values-mcc310-mnc028/config.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2007 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.
+-->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+ <!-- Carrier_enabled editable -->
+ <bool name="config_allow_edit_carrier_enabled" translatable="false">true</bool>
+</resources>
diff --git a/res/values-mcc311-mnc390/config.xml b/res/values-mcc311-mnc390/config.xml
new file mode 100755
index 0000000..76127d4
--- /dev/null
+++ b/res/values-mcc311-mnc390/config.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2007 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.
+-->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+ <!-- Carrier_enabled editable -->
+ <bool name="config_allow_edit_carrier_enabled" translatable="false">true</bool>
+</resources>
diff --git a/res/values/config.xml b/res/values/config.xml
index 86d47fe..a6fd34e 100755
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -32,4 +32,6 @@
<!-- Dashboard number of columns -->
<integer name="dashboard_num_columns">1</integer>
+ <!-- Carrier_enabled editable -->
+ <bool name="config_allow_edit_carrier_enabled" translatable="false">false</bool>
</resources>
diff --git a/src/com/android/settings/ApnEditor.java b/src/com/android/settings/ApnEditor.java
index 738d433..8cfee92 100644
--- a/src/com/android/settings/ApnEditor.java
+++ b/src/com/android/settings/ApnEditor.java
@@ -327,6 +327,13 @@ public class ApnEditor extends PreferenceActivity
mMvnoType.setSummary(
checkNull(mvnoDescription(mMvnoType.getValue())));
mMvnoMatchData.setSummary(checkNull(mMvnoMatchData.getText()));
+ // allow user to edit carrier_enabled for some APN
+ boolean ceEditable = getResources().getBoolean(R.bool.config_allow_edit_carrier_enabled);
+ if (ceEditable) {
+ mCarrierEnabled.setEnabled(true);
+ } else {
+ mCarrierEnabled.setEnabled(false);
+ }
}
/**
@@ -571,6 +578,7 @@ public class ApnEditor extends PreferenceActivity
values.put(Telephony.Carriers.MVNO_TYPE, checkNotSet(mMvnoType.getValue()));
values.put(Telephony.Carriers.MVNO_MATCH_DATA, checkNotSet(mMvnoMatchData.getText()));
+ values.put(Telephony.Carriers.CARRIER_ENABLED, mCarrierEnabled.isChecked() ? 1 : 0);
getContentResolver().update(mUri, values, null, null);
return true;
@@ -664,6 +672,8 @@ public class ApnEditor extends PreferenceActivity
if (pref != null) {
if (pref.equals(mPassword)){
pref.setSummary(starify(sharedPreferences.getString(key, "")));
+ } else if (pref.equals(mCarrierEnabled)) {
+ // do nothing
} else {
pref.setSummary(checkNull(sharedPreferences.getString(key, "")));
}