From af7df9712b565e22ef07c113355912d4b0d4cec8 Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Mon, 25 Mar 2024 20:20:36 +0000 Subject: Parcel: log invalid Parcel when obtaining Log, not error, in case an error causes more issues. This is unexpected though. This provides us an earlier error so we are sure that the issue comes from the pool and not from the code that is using the pool. Bug: 330965161 Test: boot Change-Id: If4bf1ac17307d7aea8ba746d16108e8cf542a6e0 --- core/java/android/os/Parcel.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/java/android/os/Parcel.java b/core/java/android/os/Parcel.java index 352c9d2ba81f..430093b60121 100644 --- a/core/java/android/os/Parcel.java +++ b/core/java/android/os/Parcel.java @@ -554,6 +554,11 @@ public final class Parcel { } res.mReadWriteHelper = ReadWriteHelper.DEFAULT; } + + if (res.mNativePtr == 0) { + Log.e(TAG, "Obtained Parcel object has null native pointer. Invalid state."); + } + return res; } -- cgit v1.2.3-59-g8ed1b