Loading telephony/java/android/telephony/ims/ImsCallProfile.java +2 −1 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.util.Log; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.telephony.PhoneConstants; import com.android.internal.telephony.util.TelephonyUtils; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; Loading Loading @@ -833,7 +834,7 @@ public final class ImsCallProfile implements Parcelable { } int startSize = extras.size(); Bundle filtered = extras.filterValues(); Bundle filtered = TelephonyUtils.filterValues(extras); int endSize = filtered.size(); if (startSize != endSize) { Log.i(TAG, "maybeCleanseExtras: " + (startSize - endSize) + " extra values were " Loading telephony/java/com/android/internal/telephony/util/TelephonyUtils.java +29 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,8 @@ import android.content.pm.ComponentInfo; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.os.Binder; import android.os.Bundle; import android.os.PersistableBundle; import android.os.RemoteException; import android.os.SystemProperties; Loading Loading @@ -71,4 +73,31 @@ public final class TelephonyUtils { if (resolveInfo.providerInfo != null) return resolveInfo.providerInfo; throw new IllegalStateException("Missing ComponentInfo!"); } /** * Filter values in bundle to only basic types. */ public static Bundle filterValues(Bundle bundle) { Bundle ret = new Bundle(bundle); for (String key : bundle.keySet()) { Object value = bundle.get(key); if ((value instanceof Integer) || (value instanceof Long) || (value instanceof Double) || (value instanceof String) || (value instanceof int[]) || (value instanceof long[]) || (value instanceof double[]) || (value instanceof String[]) || (value instanceof PersistableBundle) || (value == null) || (value instanceof Boolean) || (value instanceof boolean[])) { continue; } if (value instanceof Bundle) { ret.putBundle(key, filterValues((Bundle) value)); continue; } if (value.getClass().getName().startsWith("android.")) { continue; } ret.remove(key); } return ret; } } Loading
telephony/java/android/telephony/ims/ImsCallProfile.java +2 −1 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.util.Log; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.telephony.PhoneConstants; import com.android.internal.telephony.util.TelephonyUtils; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; Loading Loading @@ -833,7 +834,7 @@ public final class ImsCallProfile implements Parcelable { } int startSize = extras.size(); Bundle filtered = extras.filterValues(); Bundle filtered = TelephonyUtils.filterValues(extras); int endSize = filtered.size(); if (startSize != endSize) { Log.i(TAG, "maybeCleanseExtras: " + (startSize - endSize) + " extra values were " Loading
telephony/java/com/android/internal/telephony/util/TelephonyUtils.java +29 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,8 @@ import android.content.pm.ComponentInfo; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.os.Binder; import android.os.Bundle; import android.os.PersistableBundle; import android.os.RemoteException; import android.os.SystemProperties; Loading Loading @@ -71,4 +73,31 @@ public final class TelephonyUtils { if (resolveInfo.providerInfo != null) return resolveInfo.providerInfo; throw new IllegalStateException("Missing ComponentInfo!"); } /** * Filter values in bundle to only basic types. */ public static Bundle filterValues(Bundle bundle) { Bundle ret = new Bundle(bundle); for (String key : bundle.keySet()) { Object value = bundle.get(key); if ((value instanceof Integer) || (value instanceof Long) || (value instanceof Double) || (value instanceof String) || (value instanceof int[]) || (value instanceof long[]) || (value instanceof double[]) || (value instanceof String[]) || (value instanceof PersistableBundle) || (value == null) || (value instanceof Boolean) || (value instanceof boolean[])) { continue; } if (value instanceof Bundle) { ret.putBundle(key, filterValues((Bundle) value)); continue; } if (value.getClass().getName().startsWith("android.")) { continue; } ret.remove(key); } return ret; } }