Loading core/java/android/os/BaseBundle.java +19 −2 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.compat.annotation.UnsupportedAppUsage; import android.content.Intent; import android.security.Flags; import android.util.ArrayMap; import android.util.Log; import android.util.MathUtils; Loading Loading @@ -446,7 +447,16 @@ public class BaseBundle implements Parcel.ClassLoaderProvider { object = ((BiFunction<Class<?>, Class<?>[], ?>) object).apply(clazz, itemTypes); } catch (BadParcelableException e) { if (sShouldDefuse) { Log.w(TAG, "Failed to parse item " + mMap.keyAt(i) + ", returning null.", e); if (Flags.wtfBundleDefuse()) { Slog.wtf(TAG, "Failed to parse item " + mMap.keyAt(i) + ", returning null.", e); } else { Log.w(TAG, "Failed to parse item " + mMap.keyAt(i) + ", returning null.", e); } if (Flags.deprecateBundleDefuse()) { throw e; } return null; } else { throw e; Loading Loading @@ -507,7 +517,14 @@ public class BaseBundle implements Parcel.ClassLoaderProvider { /* lazy */ ownsParcel, this, numLazyValues); } catch (BadParcelableException e) { if (sShouldDefuse) { if (Flags.wtfBundleDefuse()) { Slog.wtf(TAG, "Failed to parse Bundle, but defusing quietly", e); } else { Log.w(TAG, "Failed to parse Bundle, but defusing quietly", e); } if (Flags.deprecateBundleDefuse()) { throw e; } map.erase(); } else { throw e; Loading core/java/android/security/responsible_apis_flags.aconfig +20 −0 Original line number Diff line number Diff line Loading @@ -179,3 +179,23 @@ flag { description: "Flag for failing instead of logging in case of parcel size mismatches" bug: "416031865" } flag { name: "wtf_bundle_defuse" namespace: "responsible_apis" description: "Flag for wtf logging when defuse is enabled." bug: "254848919" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "deprecate_bundle_defuse" namespace: "responsible_apis" description: "Flag for failing instead of logging when defuse is enabled." bug: "254848919" metadata { purpose: PURPOSE_BUGFIX } } Loading
core/java/android/os/BaseBundle.java +19 −2 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.compat.annotation.UnsupportedAppUsage; import android.content.Intent; import android.security.Flags; import android.util.ArrayMap; import android.util.Log; import android.util.MathUtils; Loading Loading @@ -446,7 +447,16 @@ public class BaseBundle implements Parcel.ClassLoaderProvider { object = ((BiFunction<Class<?>, Class<?>[], ?>) object).apply(clazz, itemTypes); } catch (BadParcelableException e) { if (sShouldDefuse) { Log.w(TAG, "Failed to parse item " + mMap.keyAt(i) + ", returning null.", e); if (Flags.wtfBundleDefuse()) { Slog.wtf(TAG, "Failed to parse item " + mMap.keyAt(i) + ", returning null.", e); } else { Log.w(TAG, "Failed to parse item " + mMap.keyAt(i) + ", returning null.", e); } if (Flags.deprecateBundleDefuse()) { throw e; } return null; } else { throw e; Loading Loading @@ -507,7 +517,14 @@ public class BaseBundle implements Parcel.ClassLoaderProvider { /* lazy */ ownsParcel, this, numLazyValues); } catch (BadParcelableException e) { if (sShouldDefuse) { if (Flags.wtfBundleDefuse()) { Slog.wtf(TAG, "Failed to parse Bundle, but defusing quietly", e); } else { Log.w(TAG, "Failed to parse Bundle, but defusing quietly", e); } if (Flags.deprecateBundleDefuse()) { throw e; } map.erase(); } else { throw e; Loading
core/java/android/security/responsible_apis_flags.aconfig +20 −0 Original line number Diff line number Diff line Loading @@ -179,3 +179,23 @@ flag { description: "Flag for failing instead of logging in case of parcel size mismatches" bug: "416031865" } flag { name: "wtf_bundle_defuse" namespace: "responsible_apis" description: "Flag for wtf logging when defuse is enabled." bug: "254848919" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "deprecate_bundle_defuse" namespace: "responsible_apis" description: "Flag for failing instead of logging when defuse is enabled." bug: "254848919" metadata { purpose: PURPOSE_BUGFIX } }