From a6b5344bd3705d03b71002f3f5926b81c6ae6d70 Mon Sep 17 00:00:00 2001 From: Robin Lee Date: Mon, 11 Jun 2018 11:18:55 +0200 Subject: [PATCH] Do not treat EXTRA_SMALL_ICON as Parcelable It isn't one, and I should have read the documentation on it properly before treating it the same as EXTRA_LARGE_ICON (which is indeed a Parcelable). This fixes a chronic outpouring of technically-probably-harmless warning stack traces of the following nature which can be verified by running the framework tests and grepping logcat for this scary-looking string: java.lang.ClassCastException: java.lang.Integer cannot be cast to android.os.Parcelable at android.os.Bundle.getParcelable(Bundle.java:***) at android.app.Notification.fixDuplicateExtra at android.app.Notification.fixDuplicateExtras at android.app.Notification.readFromParcelImpl Duplicate Integer objects are harmless compared to the Bitmap so there is zero sense in recombining the objects after an RPC. We just drop the line which tries to do that. Test: make FrameworksCoreTests -j30 && \ Test: adb install -r ${ANDROID_PRODUCT_OUT}/data/app/*/FrameworksCoreTests.apk && \ Test: adb shell am instrument \ Test: -e class android.app.NotificationTest \ Test: -w com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner Change-Id: I2c88ab4e9d5322c05e2e7f68df85ed5b2f296f84 Fix: 79404137 (cherry picked from commit 62eea67846e3817e090031257bae7c42a8407548) --- core/java/android/app/Notification.java | 1 - 1 file changed, 1 deletion(-) diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index 1ea93a4191130..c22a43ec4af33 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -2767,7 +2767,6 @@ public class Notification implements Parcelable */ private void fixDuplicateExtras() { if (extras != null) { - fixDuplicateExtra(mSmallIcon, EXTRA_SMALL_ICON); fixDuplicateExtra(mLargeIcon, EXTRA_LARGE_ICON); } }