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

Commit d5466138 authored by Hyundo Moon's avatar Hyundo Moon Committed by Android (Google) Code Review
Browse files

Merge changes from topics...

Merge changes from topics "cherrypicker-L60000000957790553:N63900001320988662", "cherrypicker-L78900000957813236:N55000001321779106" into tm-qpr-dev

* changes:
  Add two tests for com.android.server.bluetooth
  Add BluetoothShellCommandTest
parents a088c772 2c1f236c
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.os.Process;
import android.os.RemoteException;
import android.util.Log;

import com.android.internal.annotations.VisibleForTesting;
import com.android.modules.utils.BasicShellCommandHandler;

import java.io.PrintWriter;
@@ -33,12 +34,14 @@ class BluetoothShellCommand extends BasicShellCommandHandler {
    private final BluetoothManagerService mManagerService;
    private final Context mContext;

    private final BluetoothCommand[] mBluetoothCommands = {
    @VisibleForTesting
    final BluetoothCommand[] mBluetoothCommands = {
        new Enable(),
        new Disable(),
    };

    private abstract class BluetoothCommand {
    @VisibleForTesting
    abstract class BluetoothCommand {
        abstract String getName();
        // require root permission by default, can be override in command implementation
        boolean isPrivileged() {
@@ -47,7 +50,8 @@ class BluetoothShellCommand extends BasicShellCommandHandler {
        abstract int exec(PrintWriter pw) throws RemoteException;
    }

    private class Enable extends BluetoothCommand {
    @VisibleForTesting
    class Enable extends BluetoothCommand {
        @Override
        String getName() {
            return "enable";
@@ -63,7 +67,8 @@ class BluetoothShellCommand extends BasicShellCommandHandler {
        }
    }

    private class Disable extends BluetoothCommand {
    @VisibleForTesting
    class Disable extends BluetoothCommand {
        @Override
        String getName() {
            return "disable";
+4 −1
Original line number Diff line number Diff line
@@ -35,7 +35,10 @@
         android:targetPackage="com.android.server.bluetooth.test"
         android:label="Service Bluetooth Tests"/>

    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
    <uses-permission android:name="android.permission.BLUETOOTH_CONNECT"/>
    <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
    <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"/>

</manifest>
+3 −0
Original line number Diff line number Diff line
@@ -17,6 +17,9 @@
    <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
        <option name="test-file-name" value="ServiceBluetoothTests.apk" />
    </target_preparer>
    <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer">
        <option name="force-root" value="true" />
    </target_preparer>

    <option name="test-suite-tag" value="apct" />
    <option name="test-tag" value="ServiceBluetoothTests" />
+0 −0

File moved.

+0 −0

File moved.

Loading