diff options
author | Bryce Lee <brycelee@google.com> | 2015-10-29 05:06:17 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2015-10-29 05:06:17 +0000 |
commit | 4af80a65ffe6570bdd9d86dd5b3a6e7e66211ff1 (patch) | |
tree | d031398d2d40dd607532fb3f35447fbd7584576d | |
parent | 13a0edb5e7661b2553b5ffe0a330c1eebad268d4 (diff) | |
parent | 84d1aab871b03d94dddce4ad2d17f3c2acb892b5 (diff) | |
download | android_packages_apps_Bluetooth-4af80a65ffe6570bdd9d86dd5b3a6e7e66211ff1.tar.gz android_packages_apps_Bluetooth-4af80a65ffe6570bdd9d86dd5b3a6e7e66211ff1.tar.bz2 android_packages_apps_Bluetooth-4af80a65ffe6570bdd9d86dd5b3a6e7e66211ff1.zip |
Revert "Allow HFP HF implementations to specify a client controller."
am: 84d1aab871
* commit '84d1aab871b03d94dddce4ad2d17f3c2acb892b5':
Revert "Allow HFP HF implementations to specify a client controller."
-rw-r--r-- | res/values/config.xml | 3 | ||||
-rw-r--r-- | src/com/android/bluetooth/hfpclient/HeadsetClientService.java | 33 | ||||
-rw-r--r-- | src/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java | 16 |
3 files changed, 0 insertions, 52 deletions
diff --git a/res/values/config.xml b/res/values/config.xml index 877352be9..79fe9ce62 100644 --- a/res/values/config.xml +++ b/res/values/config.xml @@ -41,7 +41,4 @@ <integer name="gatt_high_priority_max_interval">12</integer> <integer name="gatt_low_power_min_interval">80</integer> <integer name="gatt_low_power_max_interval">100</integer> - - <!-- Specifies the component name of the service to be bound to for controlling HF --> - <string name="headset_client_controller_service"></string> </resources> diff --git a/src/com/android/bluetooth/hfpclient/HeadsetClientService.java b/src/com/android/bluetooth/hfpclient/HeadsetClientService.java index eeb7dd12f..d7eb12d91 100644 --- a/src/com/android/bluetooth/hfpclient/HeadsetClientService.java +++ b/src/com/android/bluetooth/hfpclient/HeadsetClientService.java @@ -22,27 +22,20 @@ import android.bluetooth.BluetoothProfile; import android.bluetooth.BluetoothHeadsetClient; import android.bluetooth.BluetoothHeadsetClientCall; import android.bluetooth.IBluetoothHeadsetClient; -import android.bluetooth.IBluetoothHeadsetClientController; import android.content.BroadcastReceiver; -import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; -import android.content.ServiceConnection; import android.media.AudioManager; import android.os.Bundle; -import android.os.IBinder; import android.os.Message; import android.provider.Settings; -import android.text.TextUtils; import android.util.Log; import com.android.bluetooth.btservice.ProfileService; import com.android.bluetooth.Utils; import java.util.ArrayList; import java.util.List; -import com.android.bluetooth.R; - /** * Provides Bluetooth Headset Client (HF Role) profile, as a service in the * Bluetooth application. @@ -54,22 +47,8 @@ public class HeadsetClientService extends ProfileService { private static final String TAG = "HeadsetClientService"; private HeadsetClientStateMachine mStateMachine; - private static HeadsetClientService sHeadsetClientService; - private ServiceConnection mControllerConnection = new ServiceConnection() { - @Override - public void onServiceConnected(ComponentName componentName, IBinder service) { - mStateMachine.setClientController( - IBluetoothHeadsetClientController.Stub.asInterface(service)); - } - - @Override - public void onServiceDisconnected(ComponentName componentName) { - mStateMachine.setClientController(null); - } - }; - @Override protected String getName() { return TAG; @@ -90,18 +69,7 @@ public class HeadsetClientService extends ProfileService { } catch (Exception e) { Log.w(TAG, "Unable to register broadcat receiver", e); } - - final String controllerComponent = - getResources().getString(R.string.headset_client_controller_service); - - if (!TextUtils.isEmpty(controllerComponent)) { - Intent intent = new Intent(); - intent.setComponent(ComponentName.unflattenFromString(controllerComponent)); - bindService(intent, mControllerConnection, Context.BIND_AUTO_CREATE); - } - setHeadsetClientService(this); - return true; } @@ -583,7 +551,6 @@ public class HeadsetClientService extends ProfileService { if (mStateMachine.isAudioOn()) { return false; } - mStateMachine.sendMessage(HeadsetClientStateMachine.CONNECT_AUDIO); return true; } diff --git a/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java b/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java index ab0af9933..f9cadabe9 100644 --- a/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java +++ b/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java @@ -40,11 +40,9 @@ import android.bluetooth.BluetoothHeadsetClient; import android.bluetooth.BluetoothHeadsetClientCall; import android.bluetooth.BluetoothProfile; import android.bluetooth.BluetoothUuid; -import android.bluetooth.IBluetoothHeadsetClientController; import android.os.Bundle; import android.os.Message; import android.os.ParcelUuid; -import android.os.RemoteException; import android.util.Log; import android.util.Pair; import android.content.Context; @@ -142,7 +140,6 @@ final class HeadsetClientStateMachine extends StateMachine { // indicator private Pair<Integer, Object> mPendingAction; - private IBluetoothHeadsetClientController mClientController; private final AudioManager mAudioManager; private int mAudioState; private boolean mAudioWbs; @@ -160,10 +157,6 @@ final class HeadsetClientStateMachine extends StateMachine { classInitNative(); } - public void setClientController(IBluetoothHeadsetClientController clientController) { - mClientController = clientController; - } - public void dump(StringBuilder sb) { ProfileService.println(sb, "mCurrentDevice: " + mCurrentDevice); ProfileService.println(sb, "mAudioOn: " + mAudioOn); @@ -2023,15 +2016,6 @@ final class HeadsetClientStateMachine extends StateMachine { mAudioWbs = true; // fall through case HeadsetClientHalConstants.AUDIO_STATE_CONNECTED: - try { - if (mClientController != null && !mClientController.allowAudioConnect()) { - sendMessage(HeadsetClientStateMachine.DISCONNECT_AUDIO); - break; - } - } catch (RemoteException remoteException) { - Log.e(TAG, "ERROR: couldn't communicate with client controller"); - } - mAudioState = BluetoothHeadsetClient.STATE_AUDIO_CONNECTED; // request audio focus for call int newAudioMode = AudioManager.MODE_IN_CALL; |