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:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user