From 4f9ad1678eca240afb5a2174dc35e4f0559312c3 Mon Sep 17 00:00:00 2001
From: Jonathan Basseri
* 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. *
* * @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 d8390b66a04b4..abbc000298f6e 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 299c7c446b765..2caa83c4ec334 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 b5cdd9a250d1f..cb53f51d735b2 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);