summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJonathan Basseri <misterikkit@google.com>2015-05-12 13:53:12 -0700
committerJonathan Basseri <misterikkit@google.com>2015-05-12 13:53:12 -0700
commit202b0f4b6573d116a753332a7b1ad996d8eece20 (patch)
treec6d5b710e969fea2ba10471765a14e79ca4e0871 /src
parentdd08afd1f0c62bca2f43250092f6f63747deb9bd (diff)
downloadandroid_packages_apps_CarrierConfig-202b0f4b6573d116a753332a7b1ad996d8eece20.zip
android_packages_apps_CarrierConfig-202b0f4b6573d116a753332a7b1ad996d8eece20.tar.gz
android_packages_apps_CarrierConfig-202b0f4b6573d116a753332a7b1ad996d8eece20.tar.bz2
Switching to PersistableBundle in carrier config API.
Part of this API involves persisting config bundles to avoid binding to apps at critical moments (like boot). Regular bundles should not be written to disk because they support object types that can lose their meaning while the data is at rest. In order to use PersistableBundle, we must either start with one or filter unwanted types out of Bundle objects. Since the carrier config API has no use for unsupported types, we chose to use PersistableBundle everywhere. Bug: 20268926 Change-Id: Ife947f5ec8cb640c0fa3fdf53c7976f055605777
Diffstat (limited to 'src')
-rw-r--r--src/com/android/carrierconfig/DefaultCarrierConfigService.java158
1 files changed, 79 insertions, 79 deletions
diff --git a/src/com/android/carrierconfig/DefaultCarrierConfigService.java b/src/com/android/carrierconfig/DefaultCarrierConfigService.java
index 1a95a97..c39d953 100644
--- a/src/com/android/carrierconfig/DefaultCarrierConfigService.java
+++ b/src/com/android/carrierconfig/DefaultCarrierConfigService.java
@@ -1,6 +1,6 @@
package com.android.carrierconfig;
-import android.os.Bundle;
+import android.os.PersistableBundle;
import android.service.carrier.CarrierConfigService;
import android.service.carrier.CarrierIdentifier;
import android.telephony.CarrierConfigManager;
@@ -12,87 +12,87 @@ public class DefaultCarrierConfigService extends CarrierConfigService {
private static final String TAG = "DefaultCarrierConfigService";
- private static final HashMap<String, Bundle> sCarrierOverlays;
+ private static final HashMap<String, PersistableBundle> sCarrierOverlays;
static {
sCarrierOverlays = new HashMap<>();
- Bundle config001001 = new Bundle();
- Bundle config00101 = new Bundle();
- Bundle config001010 = new Bundle();
- Bundle config20404 = new Bundle();
- Bundle config20801 = new Bundle();
- Bundle config20802 = new Bundle();
- Bundle config23402 = new Bundle();
- Bundle config23410 = new Bundle();
- Bundle config23411 = new Bundle();
- Bundle config246081 = new Bundle();
- Bundle config310004 = new Bundle();
- Bundle config310005 = new Bundle();
- Bundle config310012 = new Bundle();
- Bundle config310028 = new Bundle();
- Bundle config310070 = new Bundle();
- Bundle config310090 = new Bundle();
- Bundle config310120 = new Bundle();
- Bundle config310150 = new Bundle();
- Bundle config310160 = new Bundle();
- Bundle config310170 = new Bundle();
- Bundle config310180 = 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 config310304 = new Bundle();
- Bundle config310310 = new Bundle();
- Bundle config310380 = new Bundle();
- Bundle config310410 = new Bundle();
- Bundle config310490 = new Bundle();
- Bundle config310530 = new Bundle();
- Bundle config310560 = new Bundle();
- Bundle config310580 = new Bundle();
- Bundle config310590 = new Bundle();
- Bundle config310640 = new Bundle();
- Bundle config310660 = new Bundle();
- Bundle config310680 = new Bundle();
- Bundle config310800 = new Bundle();
- Bundle config310980 = new Bundle();
- Bundle config311220 = new Bundle();
- Bundle config311221 = new Bundle();
- Bundle config311222 = new Bundle();
- Bundle config311223 = new Bundle();
- Bundle config311224 = new Bundle();
- Bundle config311225 = new Bundle();
- Bundle config311226 = new Bundle();
- Bundle config311227 = new Bundle();
- Bundle config311228 = new Bundle();
- Bundle config311229 = new Bundle();
- Bundle config311390 = new Bundle();
- Bundle config311480 = new Bundle();
- Bundle config311481 = new Bundle();
- Bundle config311482 = new Bundle();
- Bundle config311483 = new Bundle();
- Bundle config311484 = new Bundle();
- Bundle config311485 = new Bundle();
- Bundle config311486 = new Bundle();
- Bundle config311487 = new Bundle();
- Bundle config311488 = new Bundle();
- Bundle config311489 = new Bundle();
- Bundle config311490 = new Bundle();
- Bundle config311580 = new Bundle();
- Bundle config311581 = new Bundle();
- Bundle config311582 = new Bundle();
- Bundle config311583 = new Bundle();
- Bundle config311584 = new Bundle();
- Bundle config311585 = new Bundle();
- Bundle config311586 = new Bundle();
- Bundle config311587 = new Bundle();
- Bundle config311588 = new Bundle();
- Bundle config311589 = new Bundle();
+ PersistableBundle config001001 = new PersistableBundle();
+ PersistableBundle config00101 = new PersistableBundle();
+ PersistableBundle config001010 = new PersistableBundle();
+ PersistableBundle config20404 = new PersistableBundle();
+ PersistableBundle config20801 = new PersistableBundle();
+ PersistableBundle config20802 = new PersistableBundle();
+ PersistableBundle config23402 = new PersistableBundle();
+ PersistableBundle config23410 = new PersistableBundle();
+ PersistableBundle config23411 = new PersistableBundle();
+ PersistableBundle config246081 = new PersistableBundle();
+ PersistableBundle config310004 = new PersistableBundle();
+ PersistableBundle config310005 = new PersistableBundle();
+ PersistableBundle config310012 = new PersistableBundle();
+ PersistableBundle config310028 = new PersistableBundle();
+ PersistableBundle config310070 = new PersistableBundle();
+ PersistableBundle config310090 = new PersistableBundle();
+ PersistableBundle config310120 = new PersistableBundle();
+ PersistableBundle config310150 = new PersistableBundle();
+ PersistableBundle config310160 = new PersistableBundle();
+ PersistableBundle config310170 = new PersistableBundle();
+ PersistableBundle config310180 = new PersistableBundle();
+ PersistableBundle config310200 = new PersistableBundle();
+ PersistableBundle config310210 = new PersistableBundle();
+ PersistableBundle config310220 = new PersistableBundle();
+ PersistableBundle config310230 = new PersistableBundle();
+ PersistableBundle config310240 = new PersistableBundle();
+ PersistableBundle config310250 = new PersistableBundle();
+ PersistableBundle config310260 = new PersistableBundle();
+ PersistableBundle config310270 = new PersistableBundle();
+ PersistableBundle config310300 = new PersistableBundle();
+ PersistableBundle config310304 = new PersistableBundle();
+ PersistableBundle config310310 = new PersistableBundle();
+ PersistableBundle config310380 = new PersistableBundle();
+ PersistableBundle config310410 = new PersistableBundle();
+ PersistableBundle config310490 = new PersistableBundle();
+ PersistableBundle config310530 = new PersistableBundle();
+ PersistableBundle config310560 = new PersistableBundle();
+ PersistableBundle config310580 = new PersistableBundle();
+ PersistableBundle config310590 = new PersistableBundle();
+ PersistableBundle config310640 = new PersistableBundle();
+ PersistableBundle config310660 = new PersistableBundle();
+ PersistableBundle config310680 = new PersistableBundle();
+ PersistableBundle config310800 = new PersistableBundle();
+ PersistableBundle config310980 = new PersistableBundle();
+ PersistableBundle config311220 = new PersistableBundle();
+ PersistableBundle config311221 = new PersistableBundle();
+ PersistableBundle config311222 = new PersistableBundle();
+ PersistableBundle config311223 = new PersistableBundle();
+ PersistableBundle config311224 = new PersistableBundle();
+ PersistableBundle config311225 = new PersistableBundle();
+ PersistableBundle config311226 = new PersistableBundle();
+ PersistableBundle config311227 = new PersistableBundle();
+ PersistableBundle config311228 = new PersistableBundle();
+ PersistableBundle config311229 = new PersistableBundle();
+ PersistableBundle config311390 = new PersistableBundle();
+ PersistableBundle config311480 = new PersistableBundle();
+ PersistableBundle config311481 = new PersistableBundle();
+ PersistableBundle config311482 = new PersistableBundle();
+ PersistableBundle config311483 = new PersistableBundle();
+ PersistableBundle config311484 = new PersistableBundle();
+ PersistableBundle config311485 = new PersistableBundle();
+ PersistableBundle config311486 = new PersistableBundle();
+ PersistableBundle config311487 = new PersistableBundle();
+ PersistableBundle config311488 = new PersistableBundle();
+ PersistableBundle config311489 = new PersistableBundle();
+ PersistableBundle config311490 = new PersistableBundle();
+ PersistableBundle config311580 = new PersistableBundle();
+ PersistableBundle config311581 = new PersistableBundle();
+ PersistableBundle config311582 = new PersistableBundle();
+ PersistableBundle config311583 = new PersistableBundle();
+ PersistableBundle config311584 = new PersistableBundle();
+ PersistableBundle config311585 = new PersistableBundle();
+ PersistableBundle config311586 = new PersistableBundle();
+ PersistableBundle config311587 = new PersistableBundle();
+ PersistableBundle config311588 = new PersistableBundle();
+ PersistableBundle config311589 = new PersistableBundle();
config001001.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
config00101.putBoolean(CarrierConfigManager.BOOL_SHOW_APN_SETTING_CDMA, true);
@@ -325,7 +325,7 @@ public class DefaultCarrierConfigService extends CarrierConfigService {
}
@Override
- public Bundle onLoadConfig(CarrierIdentifier id) {
+ public PersistableBundle 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());