summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Basseri <misterikkit@google.com>2015-03-18 11:22:19 -0700
committerJonathan Basseri <misterikkit@google.com>2015-04-14 11:45:16 -0700
commit1d226a1b431d158c65acbce1bf2b4ffa4331aef9 (patch)
tree3196f8e465517c939602b5ec04ffbf4d6322ca14
parent890b794d6a2c5012dfea6e0241b6e8fa8676a658 (diff)
downloadandroid_packages_apps_CarrierConfig-1d226a1b431d158c65acbce1bf2b4ffa4331aef9.tar.gz
android_packages_apps_CarrierConfig-1d226a1b431d158c65acbce1bf2b4ffa4331aef9.tar.bz2
android_packages_apps_CarrierConfig-1d226a1b431d158c65acbce1bf2b4ffa4331aef9.zip
Initial commit for the new Default Carrier Config app.
This app will eventually own carrier/telephony configuration that is currently stored in config.xml overlays. For now it only has a few of the variables that will be migrated. Bug: b/19483786 Change-Id: I66a25f232a5e1ff6b8f988a3497d70ee8dd32e82
-rw-r--r--Android.mk15
-rw-r--r--AndroidManifest.xml15
-rw-r--r--proguard.flags1
-rw-r--r--src/com/android/carrierconfig/DefaultCarrierConfigService.java169
4 files changed, 200 insertions, 0 deletions
diff --git a/Android.mk b/Android.mk
new file mode 100644
index 0000000..40744ed
--- /dev/null
+++ b/Android.mk
@@ -0,0 +1,15 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(call all-subdir-java-files)
+
+LOCAL_JAVA_LIBRARIES := telephony-common
+
+LOCAL_PACKAGE_NAME := CarrierConfig
+LOCAL_CERTIFICATE := platform
+LOCAL_PRIVILEGED_MODULE := true
+
+LOCAL_PROGUARD_FLAG_FILES := proguard.flags
+
+include $(BUILD_PACKAGE)
+
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
new file mode 100644
index 0000000..ebbb429
--- /dev/null
+++ b/AndroidManifest.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ android:versionCode="1"
+ android:versionName="1.0.0"
+ package="com.android.carrierconfig">
+
+ <application android:allowBackup="false">
+ <service android:name=".DefaultCarrierConfigService"
+ android:permission="android.permission.BIND_CARRIER_CONFIG_SERVICE">
+ <intent-filter>
+ <action android:name="android.service.carrier.CarrierConfigService" />
+ </intent-filter>
+ </service>
+ </application>
+</manifest>
diff --git a/proguard.flags b/proguard.flags
new file mode 100644
index 0000000..59c7e67
--- /dev/null
+++ b/proguard.flags
@@ -0,0 +1 @@
+-keep class com.android.carrierconfig.DefaultCarrierConfigService
diff --git a/src/com/android/carrierconfig/DefaultCarrierConfigService.java b/src/com/android/carrierconfig/DefaultCarrierConfigService.java
new file mode 100644
index 0000000..2182a1b
--- /dev/null
+++ b/src/com/android/carrierconfig/DefaultCarrierConfigService.java
@@ -0,0 +1,169 @@
+package com.android.carrierconfig;
+
+import android.os.Bundle;
+import android.service.carrier.CarrierConfigService;
+import android.service.carrier.CarrierIdentifier;
+import android.telephony.CarrierConfigManager;
+import android.util.Log;
+
+import java.util.HashMap;
+
+public class DefaultCarrierConfigService extends CarrierConfigService {
+
+ private static final String TAG = "DefaultCarrierConfigService";
+
+ private static final HashMap<String, Bundle> sCarrierOverlays;
+
+ static {
+ sCarrierOverlays = new HashMap<>();
+
+ Bundle config00101 = new Bundle();
+ Bundle config001001 = new Bundle();
+ Bundle config001010 = new Bundle();
+ Bundle config246081 = new Bundle();
+ Bundle config310004 = new Bundle();
+ Bundle config310028 = new Bundle();
+ Bundle config310120 = new Bundle();
+ Bundle config310160 = new Bundle();
+ Bundle config310200 = new Bundle();
+ Bundle config310210 = new Bundle();
+ Bundle config310220 = new Bundle();
+ Bundle config310230 = new Bundle();
+ Bundle config310240 = new Bundle();
+ Bundle config310250 = new Bundle();
+ Bundle config310260 = new Bundle();
+ Bundle config310270 = new Bundle();
+ Bundle config310300 = new Bundle();
+ Bundle config310310 = new Bundle();
+ Bundle config310410 = new Bundle();
+ Bundle config310490 = new Bundle();
+ Bundle config310530 = new Bundle();
+ Bundle config310580 = new Bundle();
+ Bundle config310590 = new Bundle();
+ Bundle config310640 = new Bundle();
+ Bundle config310660 = new Bundle();
+ Bundle config310800 = new Bundle();
+ Bundle config311390 = new Bundle();
+ Bundle config311480 = new Bundle();
+
+ config00101.putBoolean(CarrierConfigManager.BOOL_SHOW_APN_SETTING_CDMA, true);
+ config001001.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
+ config001010.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
+
+ config246081.putBoolean(CarrierConfigManager.BOOL_SHOW_APN_SETTING_CDMA, true);
+
+ config310004.putInt(CarrierConfigManager.INT_VOLTE_REPLACEMENT_RAT, 6);
+
+ config310028.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
+ config310028.putBoolean(CarrierConfigManager.BOOL_SHOW_APN_SETTING_CDMA, true);
+ config310028.putInt(CarrierConfigManager.INT_VOLTE_REPLACEMENT_RAT, 6);
+
+ config310120.putInt(CarrierConfigManager.INT_VOLTE_REPLACEMENT_RAT, 6);
+
+ config310160.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
+ config310160.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_TTY_SUPPORTED, false);
+
+ config310200.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
+ config310200.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_TTY_SUPPORTED, false);
+
+ config310210.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
+ config310210.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_TTY_SUPPORTED, false);
+
+ config310220.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
+ config310220.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_TTY_SUPPORTED, false);
+
+ config310230.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
+ config310230.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_TTY_SUPPORTED, false);
+
+ config310240.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
+ config310240.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_TTY_SUPPORTED, false);
+
+ config310250.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
+ config310250.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_TTY_SUPPORTED, false);
+
+ config310260.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
+ config310260.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_TTY_SUPPORTED, false);
+ config310260.putInt(CarrierConfigManager.INT_VOLTE_REPLACEMENT_RAT, 3);
+
+ config310270.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
+ config310270.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_TTY_SUPPORTED, false);
+
+ config310300.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
+ config310300.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_TTY_SUPPORTED, false);
+
+ config310310.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
+ config310310.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_TTY_SUPPORTED, false);
+
+ config310410.putInt(CarrierConfigManager.INT_VOLTE_REPLACEMENT_RAT, 3);
+
+ config310490.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
+ config310490.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_TTY_SUPPORTED, false);
+
+ config310530.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
+ config310530.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_TTY_SUPPORTED, false);
+
+ config310580.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
+ config310580.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_TTY_SUPPORTED, false);
+
+ config310590.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
+ config310590.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_TTY_SUPPORTED, false);
+
+ config310640.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
+ config310640.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_TTY_SUPPORTED, false);
+
+ config310660.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
+ config310660.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_TTY_SUPPORTED, false);
+
+ config310800.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
+ config310800.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_TTY_SUPPORTED, false);
+
+ config311390.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
+ config311390.putBoolean(CarrierConfigManager.BOOL_SHOW_APN_SETTING_CDMA, true);
+ config311390.putInt(CarrierConfigManager.INT_VOLTE_REPLACEMENT_RAT, 6);
+
+ config311480.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
+ config311480.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_PROVISIONED, true);
+ config311480.putInt(CarrierConfigManager.INT_VOLTE_REPLACEMENT_RAT, 6);
+
+ sCarrierOverlays.put("00101", config00101);
+ sCarrierOverlays.put("001001", config001001);
+ sCarrierOverlays.put("001010", config001010);
+ sCarrierOverlays.put("246081", config246081);
+ sCarrierOverlays.put("310004", config310004);
+ sCarrierOverlays.put("310028", config310028);
+ sCarrierOverlays.put("310120", config310120);
+ sCarrierOverlays.put("310160", config310160);
+ sCarrierOverlays.put("310200", config310200);
+ sCarrierOverlays.put("310210", config310210);
+ sCarrierOverlays.put("310220", config310220);
+ sCarrierOverlays.put("310230", config310230);
+ sCarrierOverlays.put("310240", config310240);
+ sCarrierOverlays.put("310250", config310250);
+ sCarrierOverlays.put("310260", config310260);
+ sCarrierOverlays.put("310270", config310270);
+ sCarrierOverlays.put("310300", config310300);
+ sCarrierOverlays.put("310310", config310310);
+ sCarrierOverlays.put("310410", config310410);
+ sCarrierOverlays.put("310490", config310490);
+ sCarrierOverlays.put("310530", config310530);
+ sCarrierOverlays.put("310580", config310580);
+ sCarrierOverlays.put("310590", config310590);
+ sCarrierOverlays.put("310640", config310640);
+ sCarrierOverlays.put("310660", config310660);
+ sCarrierOverlays.put("310800", config310800);
+ sCarrierOverlays.put("311390", config311390);
+ sCarrierOverlays.put("311480", config311480);
+ }
+
+
+ public DefaultCarrierConfigService() {
+ Log.d(TAG, "Service created");
+ }
+
+ @Override
+ public Bundle onLoadConfig(CarrierIdentifier id) {
+ Log.d(TAG, "Config being fetched");
+ // Return null for unknown networks - they should use the defaults.
+ return sCarrierOverlays.get(id.getMcc() + id.getMnc());
+ }
+}