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

Commit 6e9db8b9 authored by Siim Sammul's avatar Siim Sammul Committed by Automerger Merge Worker
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 am: 55ca56c8

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Bluetooth/+/15108694

Change-Id: I65e816c04145e1e5cab501932d8b2739076b7cd0
parents 4020644c 55ca56c8
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -121,6 +121,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;
@@ -291,6 +292,8 @@ public class AdapterService extends Service {
    private SapService mSapService;
    private VolumeControlService mVolumeControlService;

    private BinderCallsStats.SettingsObserver mBinderCallsSettingsObserver;

    private volatile boolean mTestModeEnabled = false;

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