Support PersistableBundle type config values in getConfigByComponentForSubId
PersistableBundle support is required to enable better handling of more complex carrier configurations. Bug: 223443016 Test: make, atest CarrierConfigManagerTest Change-Id: Idb564cf44d7d321b95cccb18798992e718f30da4
This commit is contained in:
@@ -9499,42 +9499,26 @@ public class CarrierConfigManager {
|
|||||||
private void addConfig(String key, Object value, PersistableBundle configs) {
|
private void addConfig(String key, Object value, PersistableBundle configs) {
|
||||||
if (value instanceof String) {
|
if (value instanceof String) {
|
||||||
configs.putString(key, (String) value);
|
configs.putString(key, (String) value);
|
||||||
}
|
} else if (value instanceof String[]) {
|
||||||
|
|
||||||
if (value instanceof String[]) {
|
|
||||||
configs.putStringArray(key, (String[]) value);
|
configs.putStringArray(key, (String[]) value);
|
||||||
}
|
} else if (value instanceof Integer) {
|
||||||
|
|
||||||
if (value instanceof Integer) {
|
|
||||||
configs.putInt(key, (Integer) value);
|
configs.putInt(key, (Integer) value);
|
||||||
}
|
} else if (value instanceof Long) {
|
||||||
|
|
||||||
if (value instanceof Long) {
|
|
||||||
configs.putLong(key, (Long) value);
|
configs.putLong(key, (Long) value);
|
||||||
}
|
} else if (value instanceof Double) {
|
||||||
|
|
||||||
if (value instanceof Double) {
|
|
||||||
configs.putDouble(key, (Double) value);
|
configs.putDouble(key, (Double) value);
|
||||||
}
|
} else if (value instanceof Boolean) {
|
||||||
|
|
||||||
if (value instanceof Boolean) {
|
|
||||||
configs.putBoolean(key, (Boolean) value);
|
configs.putBoolean(key, (Boolean) value);
|
||||||
}
|
} else if (value instanceof int[]) {
|
||||||
|
|
||||||
if (value instanceof int[]) {
|
|
||||||
configs.putIntArray(key, (int[]) value);
|
configs.putIntArray(key, (int[]) value);
|
||||||
}
|
} else if (value instanceof double[]) {
|
||||||
|
|
||||||
if (value instanceof double[]) {
|
|
||||||
configs.putDoubleArray(key, (double[]) value);
|
configs.putDoubleArray(key, (double[]) value);
|
||||||
}
|
} else if (value instanceof boolean[]) {
|
||||||
|
|
||||||
if (value instanceof boolean[]) {
|
|
||||||
configs.putBooleanArray(key, (boolean[]) value);
|
configs.putBooleanArray(key, (boolean[]) value);
|
||||||
}
|
} else if (value instanceof long[]) {
|
||||||
|
|
||||||
if (value instanceof long[]) {
|
|
||||||
configs.putLongArray(key, (long[]) value);
|
configs.putLongArray(key, (long[]) value);
|
||||||
|
} else if (value instanceof PersistableBundle) {
|
||||||
|
configs.putPersistableBundle(key, (PersistableBundle) value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user