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

Commit 0e0eb14d authored by Rupesh Bansal's avatar Rupesh Bansal
Browse files

Removing the DEBUG flag check while logging traces

This CL has 2 changes
1. Not checking the DEBUG flag when logging the traces
2. Changing the utility used to log the trace to Trace.traceBegin(...)
   method. This is to log the traces in the SystemServer context, aginst
   the old method which logged the traces in the app context

Bug: 249306380
Test: Manual
Change-Id: Id32799cd9a11d984ae4bf9d69f59167b1636068b
parent b326bba8
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -167,7 +167,8 @@ class DisplayDeviceRepository implements DisplayAdapter.Listener {
                return;
            }
            if (DEBUG) {
                Trace.beginSection("handleDisplayDeviceChanged");
                Trace.traceBegin(Trace.TRACE_TAG_POWER,
                        "handleDisplayDeviceChanged");
            }
            int diff = device.mDebugLastLoggedDeviceInfo.diff(info);
            if (diff == DisplayDeviceInfo.DIFF_STATE) {
@@ -189,7 +190,7 @@ class DisplayDeviceRepository implements DisplayAdapter.Listener {
            device.applyPendingDisplayDeviceInfoChangesLocked();
            sendEventLocked(device, DISPLAY_DEVICE_EVENT_CHANGED);
            if (DEBUG) {
                Trace.endSection();
                Trace.traceEnd(Trace.TRACE_TAG_POWER);
            }
        }
    }
+3 −6
Original line number Diff line number Diff line
@@ -1172,13 +1172,10 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
    }

    private void updatePowerState() {
        if (DEBUG) {
            Trace.beginSection("DisplayPowerController#updatePowerState");
        }
        Trace.traceBegin(Trace.TRACE_TAG_POWER,
                "DisplayPowerController#updatePowerState");
        updatePowerStateInternal();
        if (DEBUG) {
            Trace.endSection();
        }
        Trace.traceEnd(Trace.TRACE_TAG_POWER);
    }

    private void updatePowerStateInternal() {
+3 −6
Original line number Diff line number Diff line
@@ -1172,13 +1172,10 @@ final class DisplayPowerController2 implements AutomaticBrightnessController.Cal
    }

    private void updatePowerState() {
        if (DEBUG) {
            Trace.beginSection("DisplayPowerController#updatePowerState");
        }
        Trace.traceBegin(Trace.TRACE_TAG_POWER,
                "DisplayPowerController#updatePowerState");
        updatePowerStateInternal();
        if (DEBUG) {
            Trace.endSection();
        }
        Trace.traceEnd(Trace.TRACE_TAG_POWER);
    }

    private void updatePowerStateInternal() {