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

Commit 6f6010a6 authored by Fiona Campbell's avatar Fiona Campbell
Browse files

Make display manager logging conditional

- Re-introduce checks based on current extra logging package name
  to ensure that displaymanager logging isn't always-on.

Bug: 306170135
Test: logcat | grep display -i
Test: adb shell setprop persist.debug.vri_package com.android.settings
&& adb reboot && logcat | grep display -i

Change-Id: I7d1da5b8dec167b4e1b22ce610f88431b05daf76
parent 2df0ca88
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -1423,12 +1423,10 @@ public final class DisplayManagerGlobal {
            sExtraDisplayListenerLogging = !TextUtils.isEmpty(EXTRA_LOGGING_PACKAGE_NAME)
                    && EXTRA_LOGGING_PACKAGE_NAME.equals(sCurrentPackageName);
        }
        // TODO: b/306170135 - return sExtraDisplayListenerLogging instead
        return true;
        return sExtraDisplayListenerLogging;
    }

    private static boolean extraLogging() {
        // TODO: b/306170135 - return sExtraDisplayListenerLogging & package name check instead
        return true;
        return sExtraDisplayListenerLogging;
    }
}
+1 −2
Original line number Diff line number Diff line
@@ -1020,8 +1020,7 @@ public final class ViewRootImpl implements ViewParent,
        mDisplay = display;
        mBasePackageName = context.getBasePackageName();
        final String name = DisplayProperties.debug_vri_package().orElse(null);
        // TODO: b/306170135 - return to using textutils check on package name.
        mExtraDisplayListenerLogging = true;
        mExtraDisplayListenerLogging = !TextUtils.isEmpty(name) && name.equals(mBasePackageName);
        mThread = Thread.currentThread();
        mLocation = new WindowLeaked(null);
        mLocation.fillInStackTrace();
+2 −4
Original line number Diff line number Diff line
@@ -586,8 +586,7 @@ public final class DisplayManagerService extends SystemService {
        mSystemReady = false;
        mConfigParameterProvider = new DeviceConfigParameterProvider(DeviceConfigInterface.REAL);
        mExtraDisplayLoggingPackageName = DisplayProperties.debug_vri_package().orElse(null);
        // TODO: b/306170135 - return TextUtils package name check instead
        mExtraDisplayEventLogging = true;
        mExtraDisplayEventLogging = !TextUtils.isEmpty(mExtraDisplayLoggingPackageName);
    }

    public void setupSchedulerPolicies() {
@@ -3044,8 +3043,7 @@ public final class DisplayManagerService extends SystemService {
    }

    private boolean extraLogging(String packageName) {
        // TODO: b/306170135 - return mExtraDisplayLoggingPackageName & package name check instead
        return true;
        return mExtraDisplayEventLogging && mExtraDisplayLoggingPackageName.equals(packageName);
    }

    // Runs on Handler thread.