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

Commit 257a8f81 authored by Hansong Zhang's avatar Hansong Zhang Committed by android-build-merger
Browse files

Merge "Bluetooth: Add hidden API to get current user of HID Device (1/3)"

am: 6ff212e6

Change-Id: I919f0be242b532207d31cd32511da86ebbbc9fe3
parents 57565879 6ff212e6
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -700,6 +700,28 @@ public final class BluetoothHidDevice implements BluetoothProfile {
        return result;
    }

    /**
     * Gets the application name of the current HidDeviceService user.
     *
     * @return the current user name, or empty string if cannot get the name
     * {@hide}
     */
    public String getUserAppName() {
        final IBluetoothHidDevice service = mService;

        if (service != null) {
            try {
                return service.getUserAppName();
            } catch (RemoteException e) {
                Log.e(TAG, e.toString());
            }
        } else {
            Log.w(TAG, "Proxy not attached to service");
        }

        return "";
    }

    /**
     * Initiates connection to host which is currently paired with this device. If the application
     * is not registered, #connect(BluetoothDevice) will fail. The connection state should be