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

Commit a1c4e351 authored by Guang Zhu's avatar Guang Zhu
Browse files

add command to enable bt snoop log

Change-Id: I22a6482a90c2bb976a5ce44946e9f0fb8b59e6b2
parent e9c26fa0
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@ import android.app.Instrumentation;
import android.content.Context;
import android.os.Bundle;

import junit.framework.Assert;

import java.util.Set;

public class BluetoothInstrumentation extends Instrumentation {
@@ -70,6 +72,8 @@ public class BluetoothInstrumentation extends Instrumentation {
            getAddress();
        } else if ("getBondedDevices".equals(command)) {
            getBondedDevices();
        } else if ("enableBtSnoop".equals(command)) {
            enableBtSnoop();
        } else {
            finish(null);
        }
@@ -112,6 +116,12 @@ public class BluetoothInstrumentation extends Instrumentation {
        finish(mSuccessResult);
    }

    public void enableBtSnoop() {
        Assert.assertTrue("failed to enable snoop log",
                getBluetoothAdapter().configHciSnoopLog(true));
        finish(mSuccessResult);
    }

    public void finish(Bundle result) {
        if (result == null) {
            result = new Bundle();