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

Commit d9123e25 authored by Chavi Weingarten's avatar Chavi Weingarten
Browse files

Allow multiple calls and names to filter in SurfaceControlRegistry

The call and names are matched via string contains so the different calls can be
comma separated, whitespace, or purely concatenated.

Example:
adb shell setprop persist.wm.debug.sc.tx.log_match_call setWindowCrop,setAlpha
adb shell setprop persist.wm.debug.sc.tx.log_match_name launcher,sysui

Test: add multiple call in property
Bug: 308093559
Change-Id: I90c3cf3a86ee7cddc21f6f6b8233f636116d1058
parent b32b61b8
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -337,13 +337,13 @@ public class SurfaceControlRegistry {
    @VisibleForTesting
    @VisibleForTesting
    public final boolean matchesForCallStackDebugging(@Nullable String name, @NonNull String call) {
    public final boolean matchesForCallStackDebugging(@Nullable String name, @NonNull String call) {
        final boolean matchCall = !sCallStackDebuggingMatchCall.isEmpty();
        final boolean matchCall = !sCallStackDebuggingMatchCall.isEmpty();
        if (matchCall && !call.toLowerCase().contains(sCallStackDebuggingMatchCall)) {
        if (matchCall && !sCallStackDebuggingMatchCall.contains(call.toLowerCase())) {
            // Skip if target call doesn't match requested caller
            // Skip if target call doesn't match requested caller
            return false;
            return false;
        }
        }
        final boolean matchName = !sCallStackDebuggingMatchName.isEmpty();
        final boolean matchName = !sCallStackDebuggingMatchName.isEmpty();
        if (matchName && (name == null
        if (matchName && (name == null
                || !name.toLowerCase().contains(sCallStackDebuggingMatchName))) {
                || !sCallStackDebuggingMatchName.contains(name.toLowerCase()))) {
            // Skip if target surface doesn't match requested surface
            // Skip if target surface doesn't match requested surface
            return false;
            return false;
        }
        }