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

Commit f770fcce authored by Vishnu Nair's avatar Vishnu Nair
Browse files

Winscope: Prevent layers trace from capturing entries once its disabled

Bug: 110052395
Test: manually capture Layers trace and check results
Test: run atest FlickerTest:CloseImeWindowToHomeTest
(some test runs were failing due to this issue)

Change-Id: Iadbc1894721e72f951ebdf127691010df4eb2bb9
parent 8231c940
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -58,7 +58,9 @@ bool SurfaceTracing::isEnabled() {

void SurfaceTracing::traceLayers(const char* where, LayersProto layers) {
    std::lock_guard<std::mutex> protoGuard(mTraceMutex);

    if (!mEnabled) {
        return;
    }
    LayersTraceProto* entry = mTrace.add_entry();
    entry->set_elapsed_realtime_nanos(elapsedRealtimeNano());
    entry->set_where(where);