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

Commit dd0d423e authored by Siim Sammul's avatar Siim Sammul Committed by Android (Google) Code Review
Browse files

Merge "Allow logging binder latency from bluetooth. This is already active in...

Merge "Allow logging binder latency from bluetooth. This is already active in dogfood for system_server and Telephony." into sc-dev
parents 71246516 077e7a00
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 libcore.util.SneakyThrow;
@@ -289,6 +290,8 @@ public class AdapterService extends Service {
    private HearingAidService mHearingAidService;
    private SapService mSapService;

    private BinderCallsStats.SettingsObserver mBinderCallsSettingsObserver;

    private volatile boolean mTestModeEnabled = false;

    /**
@@ -505,6 +508,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);