summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/java/android/view/SurfaceControl.java7
-rw-r--r--core/java/android/view/SurfaceControlRegistry.java10
2 files changed, 12 insertions, 5 deletions
diff --git a/core/java/android/view/SurfaceControl.java b/core/java/android/view/SurfaceControl.java
index d7cf3e827695..311fbee2fc4b 100644
--- a/core/java/android/view/SurfaceControl.java
+++ b/core/java/android/view/SurfaceControl.java
@@ -3026,6 +3026,7 @@ public final class SurfaceControl implements Parcelable {
// Only non-null if the SurfaceControlRegistry is enabled. This list tracks the set of calls
// made through this transaction object, and is dumped (and cleared) when the transaction is
// later applied.
+ @Nullable
ArrayList<String> mCalls;
Runnable mFreeNativeResources;
@@ -4898,8 +4899,10 @@ public final class SurfaceControl implements Parcelable {
SurfaceControlRegistry.getProcessInstance().checkCallStackDebugging(
"merge", this, null, "otherTx=" + other.getId());
if (mCalls != null) {
- mCalls.addAll(other.mCalls);
- other.mCalls.clear();
+ if (other.mCalls != null) {
+ mCalls.addAll(other.mCalls);
+ other.mCalls.clear();
+ }
}
}
mResizedSurfaces.putAll(other.mResizedSurfaces);
diff --git a/core/java/android/view/SurfaceControlRegistry.java b/core/java/android/view/SurfaceControlRegistry.java
index 121c01be7294..0b528bffe5c5 100644
--- a/core/java/android/view/SurfaceControlRegistry.java
+++ b/core/java/android/view/SurfaceControlRegistry.java
@@ -334,13 +334,17 @@ public class SurfaceControlRegistry {
if (call == APPLY) {
// Log the apply and dump the calls on that transaction
Log.e(TAG, msg, new Throwable());
- for (int i = 0; i < tx.mCalls.size(); i++) {
- Log.d(TAG, " " + tx.mCalls.get(i));
+ if (tx.mCalls != null) {
+ for (int i = 0; i < tx.mCalls.size(); i++) {
+ Log.d(TAG, " " + tx.mCalls.get(i));
+ }
}
} else if (matchesForCallStackDebugging(sc != null ? sc.getName() : null, call)) {
// Otherwise log this call to the transaction if it matches the tracked calls
Log.e(TAG, msg, new Throwable());
- tx.mCalls.add(msg);
+ if (tx.mCalls != null) {
+ tx.mCalls.add(msg);
+ }
}
} else {
// Log this call if it matches the tracked calls