Merge "Support PersistableBundle type config values in getConfigByComponentForSubId" am: 4797e99e5f am: 5d15fd1097

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2045704

Change-Id: I60e6bd5462b600f6bdd8bb7baa0d93efa637964c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Allen Xu
2022-03-29 19:03:14 +00:00
committed by Automerger Merge Worker

View File

@@ -6836,42 +6836,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);
} }
} }
} }