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

Commit f95c09e3 authored by Siim Sammul's avatar Siim Sammul
Browse files

Enable binder latency collection from system_server for dogfood.

Bug: 180584913
Test: code is unit tested
Change-Id: I68ab7f3bfc3364505ab6005933c2dc92f6eb486e
parent e5a10560
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ public class BinderCallsStats implements BinderInternal.Observer {
    public static final boolean DEFAULT_TRACK_SCREEN_INTERACTIVE = false;
    public static final boolean DEFAULT_TRACK_DIRECT_CALLING_UID = true;
    public static final boolean DEFAULT_IGNORE_BATTERY_STATUS = false;
    public static final boolean DEFAULT_COLLECT_LATENCY_DATA = false;
    public static final boolean DEFAULT_COLLECT_LATENCY_DATA = true;
    public static final int MAX_BINDER_CALL_STATS_COUNT_DEFAULT = 1500;
    private static final String DEBUG_ENTRY_PREFIX = "__DEBUG_";

+2 −10
Original line number Diff line number Diff line
@@ -938,17 +938,9 @@ public class BinderCallsStatsTest {
    }

    @Test
    public void testLatencyCollectionDisabledByDefault() {
    public void testLatencyCollectionEnabledByDefault() {
        TestBinderCallsStats bcs = new TestBinderCallsStats();
        assertEquals(false, bcs.getCollectLatencyData());

        Binder binder = new Binder();
        CallSession callSession = bcs.callStarted(binder, 1, WORKSOURCE_UID);
        bcs.time += 10;
        bcs.elapsedTime += 20;
        bcs.callEnded(callSession, REQUEST_SIZE, REPLY_SIZE, WORKSOURCE_UID);

        assertEquals(0, bcs.getLatencyObserver().getLatencyHistograms().size());
        assertEquals(true, bcs.getCollectLatencyData());
    }

    private static class TestHandler extends Handler {