Never return a reference to sDefaults.

Final static fields in Java are still mutable, so CarrierConfigManager
should not give callers the opportunity to mutate them.

Change-Id: I413597fc5f59c249997967bb0aad2d09b54fa613
This commit is contained in:
Jonathan Basseri
2015-04-23 23:34:15 -07:00
parent 3e452a9b96
commit 9892718663

View 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 */