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

Commit 9848aa3c authored by Rahul Sabnis's avatar Rahul Sabnis Committed by android-build-merger
Browse files

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

Merge "Make service methods public to access outside of package, cleanup bt code" am: 3b5c3e9d am: 34879f51
am: b69a5f17

Change-Id: I7a8d2eef1846239f39892075e1385b0330b7ee3a
parents 009b03bd b69a5f17
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line 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");
        enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission");
        if (DBG) {
        if (DBG) {
            Log.d(TAG, "disconnect(): " + device);
            Log.d(TAG, "disconnect(): " + device);
+1 −1
Original line number Original line Diff line number Diff line
@@ -141,8 +141,8 @@ public class Config {
                Log.v(TAG, "Adding " + config.mClass.getSimpleName());
                Log.v(TAG, "Adding " + config.mClass.getSimpleName());
                profiles.add(config.mClass);
                profiles.add(config.mClass);
            }
            }
            sSupportedProfiles = profiles.toArray(new Class[profiles.size()]);
        }
        }
        sSupportedProfiles = profiles.toArray(new Class[profiles.size()]);
    }
    }


    static Class[] getSupportedProfiles() {
    static Class[] getSupportedProfiles() {
+14 −2
Original line number Original line Diff line number Diff line
@@ -221,7 +221,13 @@ public class HearingAidService extends ProfileService {
        sHearingAidService = instance;
        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");
        enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission");
        if (DBG) {
        if (DBG) {
            Log.d(TAG, "connect(): " + device);
            Log.d(TAG, "connect(): " + device);
@@ -281,7 +287,13 @@ public class HearingAidService extends ProfileService {
        return true;
        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");
        enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission");
        if (DBG) {
        if (DBG) {
            Log.d(TAG, "disconnect(): " + device);
            Log.d(TAG, "disconnect(): " + device);
+7 −1
Original line number Original line Diff line number Diff line
@@ -729,7 +729,13 @@ public class HeadsetService extends ProfileService {
        return true;
        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");
        enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH_ADMIN permission");
        Log.i(TAG, "disconnect: device=" + device + ", " + Utils.getUidPidString());
        Log.i(TAG, "disconnect: device=" + device + ", " + Utils.getUidPidString());
        synchronized (mStateMachines) {
        synchronized (mStateMachines) {
+7 −1
Original line number Original line Diff line number Diff line
@@ -491,7 +491,13 @@ public class HeadsetClientService extends ProfileService {
        return true;
        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");
        enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission");
        HeadsetClientStateMachine sm = getStateMachine(device);
        HeadsetClientStateMachine sm = getStateMachine(device);
        if (sm == null) {
        if (sm == null) {
Loading