Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 81705f17 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "surfacecontrol: mark mCalls Nullable & fix missing null checks" into main

parents 4057dd1b ad4ff82c
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -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,10 +4899,12 @@ public final class SurfaceControl implements Parcelable {
                SurfaceControlRegistry.getProcessInstance().checkCallStackDebugging(
                        "merge", this, null, "otherTx=" + other.getId());
                if (mCalls != null) {
                    if (other.mCalls != null) {
                        mCalls.addAll(other.mCalls);
                        other.mCalls.clear();
                    }
                }
            }
            mResizedSurfaces.putAll(other.mResizedSurfaces);
            other.mResizedSurfaces.clear();
            mReparentedSurfaces.putAll(other.mReparentedSurfaces);
+7 −3
Original line number Diff line number Diff line
@@ -334,14 +334,18 @@ public class SurfaceControlRegistry {
            if (call == APPLY) {
                // Log the apply and dump the calls on that transaction
                Log.e(TAG, msg, new Throwable());
                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());
                if (tx.mCalls != null) {
                    tx.mCalls.add(msg);
                }
            }
        } else {
            // Log this call if it matches the tracked calls
            if (!matchesForCallStackDebugging(sc != null ? sc.getName() : null, call)) {