Merge "BT: Remove dead code in BluetoothHeadset"
am: ea7363402c
Change-Id: I5ee5d55d3c47fc82698d80610a2bd70cdee794f8
This commit is contained in:
@@ -669,33 +669,6 @@ public final class BluetoothHeadset implements BluetoothProfile {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get battery usage hint for Bluetooth Headset service.
|
|
||||||
* This is a monotonically increasing integer. Wraps to 0 at
|
|
||||||
* Integer.MAX_INT, and at boot.
|
|
||||||
* Current implementation returns the number of AT commands handled since
|
|
||||||
* boot. This is a good indicator for spammy headset/handsfree units that
|
|
||||||
* can keep the device awake by polling for cellular status updates. As a
|
|
||||||
* rule of thumb, each AT command prevents the CPU from sleeping for 500 ms
|
|
||||||
*
|
|
||||||
* @param device the bluetooth headset.
|
|
||||||
* @return monotonically increasing battery usage hint, or a negative error code on error
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
public int getBatteryUsageHint(BluetoothDevice device) {
|
|
||||||
if (VDBG) log("getBatteryUsageHint()");
|
|
||||||
final IBluetoothHeadset service = mService;
|
|
||||||
if (service != null && isEnabled() && isValidDevice(device)) {
|
|
||||||
try {
|
|
||||||
return service.getBatteryUsageHint(device);
|
|
||||||
} catch (RemoteException e) {
|
|
||||||
Log.e(TAG, Log.getStackTraceString(new Throwable()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (service == null) Log.w(TAG, "Proxy not attached to service");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates if current platform supports voice dialing over bluetooth SCO.
|
* Indicates if current platform supports voice dialing over bluetooth SCO.
|
||||||
*
|
*
|
||||||
@@ -707,49 +680,6 @@ public final class BluetoothHeadset implements BluetoothProfile {
|
|||||||
com.android.internal.R.bool.config_bluetooth_sco_off_call);
|
com.android.internal.R.bool.config_bluetooth_sco_off_call);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Accept the incoming connection.
|
|
||||||
* Note: This is an internal function and shouldn't be exposed
|
|
||||||
*
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
public boolean acceptIncomingConnect(BluetoothDevice device) {
|
|
||||||
if (DBG) log("acceptIncomingConnect");
|
|
||||||
final IBluetoothHeadset service = mService;
|
|
||||||
if (service != null && isEnabled()) {
|
|
||||||
try {
|
|
||||||
return service.acceptIncomingConnect(device);
|
|
||||||
} catch (RemoteException e) {
|
|
||||||
Log.e(TAG, e.toString());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Log.w(TAG, "Proxy not attached to service");
|
|
||||||
if (DBG) Log.d(TAG, Log.getStackTraceString(new Throwable()));
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reject the incoming connection.
|
|
||||||
*
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
public boolean rejectIncomingConnect(BluetoothDevice device) {
|
|
||||||
if (DBG) log("rejectIncomingConnect");
|
|
||||||
final IBluetoothHeadset service = mService;
|
|
||||||
if (service != null) {
|
|
||||||
try {
|
|
||||||
return service.rejectIncomingConnect(device);
|
|
||||||
} catch (RemoteException e) {
|
|
||||||
Log.e(TAG, e.toString());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Log.w(TAG, "Proxy not attached to service");
|
|
||||||
if (DBG) Log.d(TAG, Log.getStackTraceString(new Throwable()));
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the current audio state of the Headset.
|
* Get the current audio state of the Headset.
|
||||||
* Note: This is an internal function and shouldn't be exposed
|
* Note: This is an internal function and shouldn't be exposed
|
||||||
@@ -1044,50 +974,6 @@ public final class BluetoothHeadset implements BluetoothProfile {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* enable WBS codec setting.
|
|
||||||
*
|
|
||||||
* @return true if successful false if there was some error such as there is no connected
|
|
||||||
* headset
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
public boolean enableWBS() {
|
|
||||||
final IBluetoothHeadset service = mService;
|
|
||||||
if (service != null && isEnabled()) {
|
|
||||||
try {
|
|
||||||
return service.enableWBS();
|
|
||||||
} catch (RemoteException e) {
|
|
||||||
Log.e(TAG, e.toString());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Log.w(TAG, "Proxy not attached to service");
|
|
||||||
if (DBG) Log.d(TAG, Log.getStackTraceString(new Throwable()));
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* disable WBS codec settting. It set NBS codec.
|
|
||||||
*
|
|
||||||
* @return true if successful false if there was some error such as there is no connected
|
|
||||||
* headset
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
public boolean disableWBS() {
|
|
||||||
final IBluetoothHeadset service = mService;
|
|
||||||
if (service != null && isEnabled()) {
|
|
||||||
try {
|
|
||||||
return service.disableWBS();
|
|
||||||
} catch (RemoteException e) {
|
|
||||||
Log.e(TAG, e.toString());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Log.w(TAG, "Proxy not attached to service");
|
|
||||||
if (DBG) Log.d(TAG, Log.getStackTraceString(new Throwable()));
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* check if in-band ringing is supported for this platform.
|
* check if in-band ringing is supported for this platform.
|
||||||
*
|
*
|
||||||
@@ -1099,30 +985,6 @@ public final class BluetoothHeadset implements BluetoothProfile {
|
|||||||
com.android.internal.R.bool.config_bluetooth_hfp_inband_ringing_support);
|
com.android.internal.R.bool.config_bluetooth_hfp_inband_ringing_support);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Send Headset the BIND response from AG to report change in the status of the
|
|
||||||
* HF indicators to the headset
|
|
||||||
*
|
|
||||||
* @param indId Assigned Number of the indicator (defined by SIG)
|
|
||||||
* @param indStatus possible values- false-Indicator is disabled, no value changes shall be
|
|
||||||
* sent for this indicator true-Indicator is enabled, value changes may be sent for this
|
|
||||||
* indicator
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
public void bindResponse(int indId, boolean indStatus) {
|
|
||||||
final IBluetoothHeadset service = mService;
|
|
||||||
if (service != null && isEnabled()) {
|
|
||||||
try {
|
|
||||||
service.bindResponse(indId, indStatus);
|
|
||||||
} catch (RemoteException e) {
|
|
||||||
Log.e(TAG, e.toString());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Log.w(TAG, "Proxy not attached to service");
|
|
||||||
if (DBG) Log.d(TAG, Log.getStackTraceString(new Throwable()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private final IBluetoothProfileServiceConnection mConnection =
|
private final IBluetoothProfileServiceConnection mConnection =
|
||||||
new IBluetoothProfileServiceConnection.Stub() {
|
new IBluetoothProfileServiceConnection.Stub() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user