Enable binder latency collection from system_server for dogfood.

Bug: 180584913
Test: code is unit tested
Change-Id: I68ab7f3bfc3364505ab6005933c2dc92f6eb486e
This commit is contained in:
Siim Sammul
2021-04-23 13:34:41 +01:00
parent e5a10560c8
commit f95c09e3f4
2 changed files with 3 additions and 11 deletions

View File

@@ -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_";

View File

@@ -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 {