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

Commit ef549343 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "AccessibilityWindowsPopulator:fix CWE problem by add mLock in dump method." into main

parents 48a3126d c6feab91
Loading
Loading
Loading
Loading
+27 −24
Original line number Diff line number Diff line
@@ -561,6 +561,7 @@ public final class AccessibilityWindowsPopulator extends WindowInfosListener {
    }

    void dump(PrintWriter pw, String prefix) {
        synchronized (mLock) {
            pw.print(prefix); pw.println("AccessibilityWindowsPopulator");
            String prefix2 = prefix + "  ";

@@ -578,15 +579,17 @@ public final class AccessibilityWindowsPopulator extends WindowInfosListener {
            // Ideally magnificationSpecDumper should use spec.dump(pw), but there is no such method
            ValueDumper<MagnificationSpec> magnificationSpecDumper = spec -> pw.print(spec);

        dumpSparseArray(pw, prefix2, mDisplayInfos, "display info", noKeyDumper, d -> pw.print(d));
        dumpSparseArray(pw, prefix2, mInputWindowHandlesOnDisplays, "window handles on display",
                displayDumper, list -> pw.print(list));
        dumpSparseArray(pw, prefix2, mMagnificationSpecInverseMatrix, "magnification spec matrix",
                noKeyDumper, matrix -> matrix.dump(pw));
        dumpSparseArray(pw, prefix2, mCurrentMagnificationSpec, "current magnification spec",
                noKeyDumper, magnificationSpecDumper);
        dumpSparseArray(pw, prefix2, mPreviousMagnificationSpec, "previous magnification spec",
                noKeyDumper, magnificationSpecDumper);
            dumpSparseArray(pw, prefix2, mDisplayInfos,
                    "display info", noKeyDumper, d -> pw.print(d));
            dumpSparseArray(pw, prefix2, mInputWindowHandlesOnDisplays,
                    "window handles on display", displayDumper, list -> pw.print(list));
            dumpSparseArray(pw, prefix2, mMagnificationSpecInverseMatrix,
                    "magnification spec matrix", noKeyDumper, matrix -> matrix.dump(pw));
            dumpSparseArray(pw, prefix2, mCurrentMagnificationSpec,
                    "current magnification spec", noKeyDumper, magnificationSpecDumper);
            dumpSparseArray(pw, prefix2, mPreviousMagnificationSpec,
                    "previous magnification spec", noKeyDumper, magnificationSpecDumper);
        }
    }

    @GuardedBy("mLock")