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

Commit 077e7a00 authored by Siim Sammul's avatar Siim Sammul
Browse files

Allow logging binder latency from bluetooth. This is already

active in dogfood for system_server and Telephony.

Tag: #feature
Bug: 180584913
Test: Binder latency collection is unit tested in com.android.internal.os.BinderCallsStatsTest
Change-Id: I2ef7e80598bf671555e7cce1f441537526c4b578
parent 5859f851
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -120,6 +120,7 @@ import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.app.IBatteryStats;
import com.android.internal.os.BackgroundThread;
import com.android.internal.os.BinderCallsStats;
import com.android.internal.util.ArrayUtils;

import com.google.protobuf.InvalidProtocolBufferException;
@@ -287,6 +288,8 @@ public class AdapterService extends Service {
    private HearingAidService mHearingAidService;
    private SapService mSapService;

    private BinderCallsStats.SettingsObserver mBinderCallsSettingsObserver;

    private volatile boolean mTestModeEnabled = false;

    /**
@@ -503,6 +506,13 @@ public class AdapterService extends Service {
        mActivityAttributionService.start();
        int configCompareResult = mBluetoothKeystoreService.getCompareResult();

        // Start tracking Binder latency for the bluetooth process.
        mBinderCallsSettingsObserver = new BinderCallsStats.SettingsObserver(
                getApplicationContext(),
                new BinderCallsStats(
                        new BinderCallsStats.Injector(),
                        com.android.internal.os.BinderLatencyProto.Dims.BLUETOOTH));

        // Android TV doesn't show consent dialogs for just works and encryption only le pairing
        boolean isAtvDevice = getApplicationContext().getPackageManager().hasSystemFeature(
                PackageManager.FEATURE_LEANBACK_ONLY);