diff options
author | Jonathan Basseri <misterikkit@google.com> | 2015-05-12 10:06:32 -0700 |
---|---|---|
committer | Jonathan Basseri <misterikkit@google.com> | 2015-05-13 10:45:29 -0700 |
commit | 4f9ad1678eca240afb5a2174dc35e4f0559312c3 (patch) | |
tree | cfdc66832427af719ea926117473d1749a9f152d | |
parent | 21623faa449496d68bd102ddda5874f572b9c55a (diff) | |
download | frameworks_base-4f9ad1678eca240afb5a2174dc35e4f0559312c3.zip frameworks_base-4f9ad1678eca240afb5a2174dc35e4f0559312c3.tar.gz frameworks_base-4f9ad1678eca240afb5a2174dc35e4f0559312c3.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: I17989ce840014c2a0ed3679c1bca5a8498082c7f
-rw-r--r-- | api/current.txt | 6 | ||||
-rw-r--r-- | api/system-current.txt | 8 | ||||
-rw-r--r-- | core/java/android/service/carrier/CarrierConfigService.java | 14 | ||||
-rw-r--r-- | core/java/android/service/carrier/ICarrierConfigService.aidl | 6 | ||||
-rw-r--r-- | telephony/java/android/telephony/CarrierConfigManager.java | 18 | ||||
-rw-r--r-- | telephony/java/com/android/internal/telephony/ICarrierConfigLoader.aidl | 4 |
6 files changed, 28 insertions, 28 deletions
diff --git a/api/current.txt b/api/current.txt index 57d1c6d..d7b5982 100644 --- a/api/current.txt +++ b/api/current.txt @@ -28562,7 +28562,7 @@ package android.service.carrier { public abstract class CarrierConfigService extends android.app.Service { ctor public CarrierConfigService(); method public final android.os.IBinder onBind(android.content.Intent); - method public abstract android.os.Bundle onLoadConfig(android.service.carrier.CarrierIdentifier); + method public abstract android.os.PersistableBundle onLoadConfig(android.service.carrier.CarrierIdentifier); field public static final java.lang.String SERVICE_INTERFACE = "android.service.carrier.CarrierConfigService"; } @@ -30550,8 +30550,8 @@ package android.telecom { package android.telephony { public class CarrierConfigManager { - method public android.os.Bundle getConfig(); - method public android.os.Bundle getConfigForSubId(int); + method public android.os.PersistableBundle getConfig(); + method public android.os.PersistableBundle getConfigForSubId(int); method public void reloadCarrierConfigForSubId(int); field public static final java.lang.String ACTION_CARRIER_CONFIG_CHANGED = "android.telephony.action.CARRIER_CONFIG_CHANGED"; field public static final java.lang.String BOOL_ADDITIONAL_CALL_SETTING = "bool_additional_call_setting"; diff --git a/api/system-current.txt b/api/system-current.txt index 204a0b4..832895c 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -30587,7 +30587,7 @@ package android.service.carrier { public abstract class CarrierConfigService extends android.app.Service { ctor public CarrierConfigService(); method public final android.os.IBinder onBind(android.content.Intent); - method public abstract android.os.Bundle onLoadConfig(android.service.carrier.CarrierIdentifier); + method public abstract android.os.PersistableBundle onLoadConfig(android.service.carrier.CarrierIdentifier); field public static final java.lang.String SERVICE_INTERFACE = "android.service.carrier.CarrierConfigService"; } @@ -32727,9 +32727,9 @@ package android.telecom { package android.telephony { public class CarrierConfigManager { - method public android.os.Bundle getConfig(); - method public android.os.Bundle getConfigForSubId(int); - method public static android.os.Bundle getDefaultConfig(); + method public android.os.PersistableBundle getConfig(); + method public android.os.PersistableBundle getConfigForSubId(int); + method public static android.os.PersistableBundle getDefaultConfig(); method public void reloadCarrierConfigForSubId(int); method public void updateConfigForPhoneId(int, java.lang.String); field public static final java.lang.String ACTION_CARRIER_CONFIG_CHANGED = "android.telephony.action.CARRIER_CONFIG_CHANGED"; diff --git a/core/java/android/service/carrier/CarrierConfigService.java b/core/java/android/service/carrier/CarrierConfigService.java index 1880d16..bc42b6b 100644 --- a/core/java/android/service/carrier/CarrierConfigService.java +++ b/core/java/android/service/carrier/CarrierConfigService.java @@ -16,8 +16,8 @@ package android.service.carrier; import android.app.Service; import android.content.Intent; -import android.os.Bundle; import android.os.IBinder; +import android.os.PersistableBundle; /** * A service that sets carrier configuration for telephony services. @@ -68,16 +68,16 @@ public abstract class CarrierConfigService extends Service { * </p> * <p> * Implementations should use the keys defined in {@link android.telephony.CarrierConfigManager - * CarrierConfigManager}. Any configuration values not set in the returned {@link Bundle} may be - * overridden by the system's default configuration service. + * CarrierConfigManager}. Any configuration values not set in the returned {@link + * PersistableBundle} may be overridden by the system's default configuration service. * </p> * * @param id contains details about the current carrier that can be used do decide what * configuration values to return. - * @return a {@link Bundle} object containing the configuration or null if default values should - * be used. + * @return a {@link PersistableBundle} object containing the configuration or null if default + * values should be used. */ - public abstract Bundle onLoadConfig(CarrierIdentifier id); + public abstract PersistableBundle onLoadConfig(CarrierIdentifier id); /** @hide */ @Override @@ -97,7 +97,7 @@ public abstract class CarrierConfigService extends Service { private class ICarrierConfigServiceWrapper extends ICarrierConfigService.Stub { @Override - public Bundle getCarrierConfig(CarrierIdentifier id) { + public PersistableBundle getCarrierConfig(CarrierIdentifier id) { return CarrierConfigService.this.onLoadConfig(id); } } diff --git a/core/java/android/service/carrier/ICarrierConfigService.aidl b/core/java/android/service/carrier/ICarrierConfigService.aidl index d8390b6..abbc000 100644 --- a/core/java/android/service/carrier/ICarrierConfigService.aidl +++ b/core/java/android/service/carrier/ICarrierConfigService.aidl @@ -16,7 +16,7 @@ package android.service.carrier; -import android.os.Bundle; +import android.os.PersistableBundle; import android.service.carrier.CarrierIdentifier; /** @@ -28,5 +28,5 @@ import android.service.carrier.CarrierIdentifier; interface ICarrierConfigService { /** @see android.service.carrier.CarrierConfigService#onLoadConfig */ - Bundle getCarrierConfig(in CarrierIdentifier id); -}
\ No newline at end of file + PersistableBundle getCarrierConfig(in CarrierIdentifier id); +} diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java index 299c7c4..2caa83c 100644 --- a/telephony/java/android/telephony/CarrierConfigManager.java +++ b/telephony/java/android/telephony/CarrierConfigManager.java @@ -20,7 +20,7 @@ import com.android.internal.telephony.ICarrierConfigLoader; import android.annotation.SystemApi; import android.content.Context; -import android.os.Bundle; +import android.os.PersistableBundle; import android.os.RemoteException; import android.os.ServiceManager; @@ -232,10 +232,10 @@ public class CarrierConfigManager { private final static String TAG = "CarrierConfigManager"; /** The default value for every variable. */ - private final static Bundle sDefaults; + private final static PersistableBundle sDefaults; static { - sDefaults = new Bundle(); + sDefaults = new PersistableBundle(); sDefaults.putBoolean(BOOL_ADDITIONAL_CALL_SETTING, true); sDefaults.putBoolean(BOOL_ALLOW_EMERGENCY_NUMBERS_IN_CALL_LOG, false); sDefaults.putBoolean(BOOL_ALLOW_LOCAL_DTMF_TONES, true); @@ -276,10 +276,10 @@ public class CarrierConfigManager { * values. * * @param subId the subscription ID, normally obtained from {@link SubscriptionManager}. - * @return A {@link Bundle} containing the config for the given subId, or default values for an - * invalid subId. + * @return A {@link PersistableBundle} containing the config for the given subId, or default + * values for an invalid subId. */ - public Bundle getConfigForSubId(int subId) { + public PersistableBundle getConfigForSubId(int subId) { try { return getICarrierConfigLoader().getConfigForSubId(subId); } catch (RemoteException ex) { @@ -297,7 +297,7 @@ public class CarrierConfigManager { * * @see #getConfigForSubId */ - public Bundle getConfig() { + public PersistableBundle getConfig() { return getConfigForSubId(SubscriptionManager.getDefaultSubId()); } @@ -349,8 +349,8 @@ public class CarrierConfigManager { * @hide */ @SystemApi - public static Bundle getDefaultConfig() { - return new Bundle(sDefaults); + public static PersistableBundle getDefaultConfig() { + return new PersistableBundle(sDefaults); } /** @hide */ diff --git a/telephony/java/com/android/internal/telephony/ICarrierConfigLoader.aidl b/telephony/java/com/android/internal/telephony/ICarrierConfigLoader.aidl index b5cdd9a..cb53f51 100644 --- a/telephony/java/com/android/internal/telephony/ICarrierConfigLoader.aidl +++ b/telephony/java/com/android/internal/telephony/ICarrierConfigLoader.aidl @@ -16,14 +16,14 @@ package com.android.internal.telephony; -import android.os.Bundle; +import android.os.PersistableBundle; /** * Interface used to interact with the CarrierConfigLoader */ interface ICarrierConfigLoader { - Bundle getConfigForSubId(int subId); + PersistableBundle getConfigForSubId(int subId); void reloadCarrierConfigForSubId(int subId); |