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

Commit 3b5c3e9d authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Make service methods public to access outside of package, cleanup bt code"

parents 1701d5f8 c95e11d8
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -269,7 +269,13 @@ public class A2dpService extends ProfileService {
        }
    }

    boolean disconnect(BluetoothDevice device) {
    /**
     * Disconnects A2dp for the remote bluetooth device
     *
     * @param device is the device with which we would like to disconnect a2dp
     * @return true if profile disconnected, false if device not connected over a2dp
     */
    public boolean disconnect(BluetoothDevice device) {
        enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission");
        if (DBG) {
            Log.d(TAG, "disconnect(): " + device);
+1 −1
Original line number Diff line number Diff line
@@ -127,8 +127,8 @@ public class Config {
                Log.v(TAG, "Adding " + config.mClass.getSimpleName());
                profiles.add(config.mClass);
            }
            sSupportedProfiles = profiles.toArray(new Class[profiles.size()]);
        }
        sSupportedProfiles = profiles.toArray(new Class[profiles.size()]);
    }

    static Class[] getSupportedProfiles() {
+14 −2
Original line number Diff line number Diff line
@@ -221,7 +221,13 @@ public class HearingAidService extends ProfileService {
        sHearingAidService = instance;
    }

    boolean connect(BluetoothDevice device) {
    /**
     * Connects the hearing aid profile to the passed in device
     *
     * @param device is the device with which we will connect the hearing aid profile
     * @return true if hearing aid profile successfully connected, false otherwise
     */
    public boolean connect(BluetoothDevice device) {
        enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission");
        if (DBG) {
            Log.d(TAG, "connect(): " + device);
@@ -281,7 +287,13 @@ public class HearingAidService extends ProfileService {
        return true;
    }

    boolean disconnect(BluetoothDevice device) {
    /**
     * Disconnects hearing aid profile for the passed in device
     *
     * @param device is the device with which we want to disconnected the hearing aid profile
     * @return true if hearing aid profile successfully disconnected, false otherwise
     */
    public boolean disconnect(BluetoothDevice device) {
        enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission");
        if (DBG) {
            Log.d(TAG, "disconnect(): " + device);
+7 −1
Original line number Diff line number Diff line
@@ -729,7 +729,13 @@ public class HeadsetService extends ProfileService {
        return true;
    }

    boolean disconnect(BluetoothDevice device) {
    /**
     * Disconnects hfp from the passed in device
     *
     * @param device is the device with which we will disconnect hfp
     * @return true if hfp is disconnected, false if the device is not connected
     */
    public boolean disconnect(BluetoothDevice device) {
        enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH_ADMIN permission");
        Log.i(TAG, "disconnect: device=" + device + ", " + Utils.getUidPidString());
        synchronized (mStateMachines) {
+7 −1
Original line number Diff line number Diff line
@@ -491,7 +491,13 @@ public class HeadsetClientService extends ProfileService {
        return true;
    }

    boolean disconnect(BluetoothDevice device) {
    /**
     * Disconnects hfp client for the remote bluetooth device
     *
     * @param device is the device with which we are attempting to disconnect the profile
     * @return true if hfp client profile successfully disconnected, false otherwise
     */
    public boolean disconnect(BluetoothDevice device) {
        enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission");
        HeadsetClientStateMachine sm = getStateMachine(device);
        if (sm == null) {
Loading