OSDN Git Service

Never return a reference to sDefaults.
authorJonathan Basseri <misterikkit@google.com>
Fri, 24 Apr 2015 06:34:15 +0000 (23:34 -0700)
committerJonathan Basseri <misterikkit@google.com>
Fri, 24 Apr 2015 06:34:15 +0000 (23:34 -0700)
Final static fields in Java are still mutable, so CarrierConfigManager
should not give callers the opportunity to mutate them.

Change-Id: I413597fc5f59c249997967bb0aad2d09b54fa613

telephony/java/android/telephony/CarrierConfigManager.java

index 7d1a2fa..831a194 100644 (file)
@@ -208,13 +208,13 @@ public class CarrierConfigManager {
     }
 
     /**
-     * Returns a bundle with the default value for every supported configuration variable.
+     * Returns a new bundle with the default value for every supported configuration variable.
      *
      * @hide
      */
     @SystemApi
     public static Bundle getDefaultConfig() {
-        return sDefaults;
+        return new Bundle(sDefaults);
     }
 
     /** @hide */