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

Commit 6f5a5c48 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Remove invocation of closeTransaction while using a11y service

The operation applies to a local transaction, so it should not
touch the global transaction.

Bug: 143734779
Test atest AccessibilityWindowManagerTest#
           setAccessibilityWindowIdToSurfaceMetadata
Test: Enable accessibility service (e.g. TalkBack) and check logcat
      shouldn't have "Call to SurfaceControl.closeTransaction without
      matching openTransaction".

Change-Id: I5a2879656471c85f91931e385e4873b4499ed977
parent e9d2790c
Loading
Loading
Loading
Loading
+2 −9
Original line number Diff line number Diff line
@@ -7658,15 +7658,8 @@ public class WindowManagerService extends IWindowManager.Stub
                    Slog.w(TAG, "Cannot find window which accessibility connection is added to");
                    return;
                }
                try (SurfaceControl.Transaction t = new SurfaceControl.Transaction()) {
                    t.setMetadata(
                            state.mSurfaceControl,
                            SurfaceControl.METADATA_ACCESSIBILITY_ID,
                            accessibilityWindowId);
                    t.apply();
                } finally {
                    SurfaceControl.closeTransaction();
                }
                mTransaction.setMetadata(state.mSurfaceControl,
                        SurfaceControl.METADATA_ACCESSIBILITY_ID, accessibilityWindowId).apply();
            }
        }