Merge "Switching to PersistableBundle in carrier config API." into mnc-dev
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 @@
   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.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 @@
   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.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 @@
 
 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 @@
      * </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 @@
     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 @@
 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 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 @@
     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 @@
      * 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 @@
      *
      * @see #getConfigForSubId
      */
-    public Bundle getConfig() {
+    public PersistableBundle getConfig() {
         return getConfigForSubId(SubscriptionManager.getDefaultSubId());
     }
 
@@ -349,8 +349,8 @@
      * @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 b5cdd9a2..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);