Loading core/java/android/bluetooth/BluetoothA2dp.java +91 −76 Original line number Diff line number Diff line Loading @@ -139,42 +139,55 @@ public final class BluetoothA2dp implements BluetoothProfile { /** * We don't have a stored preference for whether or not the given A2DP sink device supports * optional codecs. * @hide */ * * @hide */ public static final int OPTIONAL_CODECS_SUPPORT_UNKNOWN = -1; /** * The given A2DP sink device does not support optional codecs. * @hide */ * * @hide */ public static final int OPTIONAL_CODECS_NOT_SUPPORTED = 0; /** * The given A2DP sink device does support optional codecs. * @hide */ * * @hide */ public static final int OPTIONAL_CODECS_SUPPORTED = 1; /** * We don't have a stored preference for whether optional codecs should be enabled or disabled * for the given A2DP device. * @hide */ * * @hide */ public static final int OPTIONAL_CODECS_PREF_UNKNOWN = -1; /** * Optional codecs should be disabled for the given A2DP device. * @hide */ * * @hide */ public static final int OPTIONAL_CODECS_PREF_DISABLED = 0; /** * Optional codecs should be enabled for the given A2DP device. * @hide */ * * @hide */ public static final int OPTIONAL_CODECS_PREF_ENABLED = 1; private Context mContext; private ServiceListener mServiceListener; private final ReentrantReadWriteLock mServiceLock = new ReentrantReadWriteLock(); @GuardedBy("mServiceLock") private IBluetoothA2dp mService; @GuardedBy("mServiceLock") private IBluetoothA2dp mService; private BluetoothAdapter mAdapter; final private IBluetoothStateChangeCallback mBluetoothStateChangeCallback = private final IBluetoothStateChangeCallback mBluetoothStateChangeCallback = new IBluetoothStateChangeCallback.Stub() { public void onBluetoothStateChange(boolean up) { if (DBG) Log.d(TAG, "onBluetoothStateChange: up=" + up); Loading Loading @@ -204,10 +217,10 @@ public final class BluetoothA2dp implements BluetoothProfile { } } }; /** * Create a BluetoothA2dp proxy object for interacting with the local * Bluetooth A2DP service. * */ /*package*/ BluetoothA2dp(Context context, ServiceListener l) { mContext = context; Loading Loading @@ -261,10 +274,12 @@ public final class BluetoothA2dp implements BluetoothProfile { } } @Override public void finalize() { // The empty finalize needs to be kept or the // cts signature tests would fail. } /** * Initiate connection to a profile of the remote bluetooth device. * Loading @@ -283,16 +298,14 @@ public final class BluetoothA2dp implements BluetoothProfile { * permission. * * @param device Remote Bluetooth Device * @return false on immediate error, * true otherwise * @return false on immediate error, true otherwise * @hide */ public boolean connect(BluetoothDevice device) { if (DBG) log("connect(" + device + ")"); try { mServiceLock.readLock().lock(); if (mService != null && isEnabled() && isValidDevice(device)) { if (mService != null && isEnabled() && isValidDevice(device)) { return mService.connect(device); } if (mService == null) Log.w(TAG, "Proxy not attached to service"); Loading Loading @@ -327,16 +340,14 @@ public final class BluetoothA2dp implements BluetoothProfile { * permission. * * @param device Remote Bluetooth Device * @return false on immediate error, * true otherwise * @return false on immediate error, true otherwise * @hide */ public boolean disconnect(BluetoothDevice device) { if (DBG) log("disconnect(" + device + ")"); try { mServiceLock.readLock().lock(); if (mService != null && isEnabled() && isValidDevice(device)) { if (mService != null && isEnabled() && isValidDevice(device)) { return mService.disconnect(device); } if (mService == null) Log.w(TAG, "Proxy not attached to service"); Loading @@ -352,6 +363,7 @@ public final class BluetoothA2dp implements BluetoothProfile { /** * {@inheritDoc} */ @Override public List<BluetoothDevice> getConnectedDevices() { if (VDBG) log("getConnectedDevices()"); try { Loading @@ -372,6 +384,7 @@ public final class BluetoothA2dp implements BluetoothProfile { /** * {@inheritDoc} */ @Override public List<BluetoothDevice> getDevicesMatchingConnectionStates(int[] states) { if (VDBG) log("getDevicesMatchingStates()"); try { Loading @@ -392,6 +405,7 @@ public final class BluetoothA2dp implements BluetoothProfile { /** * {@inheritDoc} */ @Override public int getConnectionState(BluetoothDevice device) { if (VDBG) log("getState(" + device + ")"); try { Loading Loading @@ -431,8 +445,8 @@ public final class BluetoothA2dp implements BluetoothProfile { mServiceLock.readLock().lock(); if (mService != null && isEnabled() && isValidDevice(device)) { if (priority != BluetoothProfile.PRIORITY_OFF && priority != BluetoothProfile.PRIORITY_ON) { if (priority != BluetoothProfile.PRIORITY_OFF && priority != BluetoothProfile.PRIORITY_ON) { return false; } return mService.setPriority(device, priority); Loading Loading @@ -577,6 +591,7 @@ public final class BluetoothA2dp implements BluetoothProfile { * This function checks if the remote device is an AVCRP * target and thus whether we should send volume keys * changes or not. * * @hide */ public boolean shouldSendVolumeKeys(BluetoothDevice device) { Loading Loading @@ -692,7 +707,6 @@ public final class BluetoothA2dp implements BluetoothProfile { * @param device The device to check * @return one of OPTIONAL_CODECS_SUPPORT_UNKNOWN, OPTIONAL_CODECS_NOT_SUPPORTED, or * OPTIONAL_CODECS_SUPPORTED. * * @hide */ public int supportsOptionalCodecs(BluetoothDevice device) { Loading @@ -717,7 +731,6 @@ public final class BluetoothA2dp implements BluetoothProfile { * @param device The device in question. * @return one of OPTIONAL_CODECS_PREF_UNKNOWN, OPTIONAL_CODECS_PREF_ENABLED, or * OPTIONAL_CODECS_PREF_DISABLED. * * @hide */ public int getOptionalCodecsEnabled(BluetoothDevice device) { Loading Loading @@ -747,9 +760,9 @@ public final class BluetoothA2dp implements BluetoothProfile { */ public void setOptionalCodecsEnabled(BluetoothDevice device, int value) { try { if (value != BluetoothA2dp.OPTIONAL_CODECS_PREF_UNKNOWN && value != BluetoothA2dp.OPTIONAL_CODECS_PREF_DISABLED && value != BluetoothA2dp.OPTIONAL_CODECS_PREF_ENABLED) { if (value != BluetoothA2dp.OPTIONAL_CODECS_PREF_UNKNOWN && value != BluetoothA2dp.OPTIONAL_CODECS_PREF_DISABLED && value != BluetoothA2dp.OPTIONAL_CODECS_PREF_ENABLED) { Log.e(TAG, "Invalid value passed to setOptionalCodecsEnabled: " + value); return; } Loading @@ -772,6 +785,7 @@ public final class BluetoothA2dp implements BluetoothProfile { * Helper for converting a state to a string. * * For debug use only - strings are not internationalized. * * @hide */ public static String stateToString(int state) { Loading Loading @@ -807,6 +821,7 @@ public final class BluetoothA2dp implements BluetoothProfile { mServiceListener.onServiceConnected(BluetoothProfile.A2DP, BluetoothA2dp.this); } } public void onServiceDisconnected(ComponentName className) { if (DBG) Log.d(TAG, "Proxy object disconnected"); try { Loading core/java/android/bluetooth/BluetoothA2dpSink.java +69 −66 Original line number Diff line number Diff line Loading @@ -120,15 +120,15 @@ public final class BluetoothA2dpSink implements BluetoothProfile { * This extra represents the current audio configuration of the A2DP source device. * {@see BluetoothAudioConfig} */ public static final String EXTRA_AUDIO_CONFIG = "android.bluetooth.a2dp-sink.profile.extra.AUDIO_CONFIG"; public static final String EXTRA_AUDIO_CONFIG = "android.bluetooth.a2dp-sink.profile.extra.AUDIO_CONFIG"; private Context mContext; private ServiceListener mServiceListener; private IBluetoothA2dpSink mService; private BluetoothAdapter mAdapter; final private IBluetoothStateChangeCallback mBluetoothStateChangeCallback = private final IBluetoothStateChangeCallback mBluetoothStateChangeCallback = new IBluetoothStateChangeCallback.Stub() { public void onBluetoothStateChange(boolean up) { if (DBG) Log.d(TAG, "onBluetoothStateChange: up=" + up); Loading Loading @@ -156,10 +156,10 @@ public final class BluetoothA2dpSink implements BluetoothProfile { } } }; /** * Create a BluetoothA2dp proxy object for interacting with the local * Bluetooth A2DP service. * */ /*package*/ BluetoothA2dpSink(Context context, ServiceListener l) { mContext = context; Loading Loading @@ -212,9 +212,11 @@ public final class BluetoothA2dpSink implements BluetoothProfile { } } @Override public void finalize() { close(); } /** * Initiate connection to a profile of the remote bluetooth device. * Loading @@ -233,14 +235,12 @@ public final class BluetoothA2dpSink implements BluetoothProfile { * permission. * * @param device Remote Bluetooth Device * @return false on immediate error, * true otherwise * @return false on immediate error, true otherwise * @hide */ public boolean connect(BluetoothDevice device) { if (DBG) log("connect(" + device + ")"); if (mService != null && isEnabled() && isValidDevice(device)) { if (mService != null && isEnabled() && isValidDevice(device)) { try { return mService.connect(device); } catch (RemoteException e) { Loading Loading @@ -274,14 +274,12 @@ public final class BluetoothA2dpSink implements BluetoothProfile { * permission. * * @param device Remote Bluetooth Device * @return false on immediate error, * true otherwise * @return false on immediate error, true otherwise * @hide */ public boolean disconnect(BluetoothDevice device) { if (DBG) log("disconnect(" + device + ")"); if (mService != null && isEnabled() && isValidDevice(device)) { if (mService != null && isEnabled() && isValidDevice(device)) { try { return mService.disconnect(device); } catch (RemoteException e) { Loading @@ -296,6 +294,7 @@ public final class BluetoothA2dpSink implements BluetoothProfile { /** * {@inheritDoc} */ @Override public List<BluetoothDevice> getConnectedDevices() { if (VDBG) log("getConnectedDevices()"); if (mService != null && isEnabled()) { Loading @@ -313,6 +312,7 @@ public final class BluetoothA2dpSink implements BluetoothProfile { /** * {@inheritDoc} */ @Override public List<BluetoothDevice> getDevicesMatchingConnectionStates(int[] states) { if (VDBG) log("getDevicesMatchingStates()"); if (mService != null && isEnabled()) { Loading @@ -330,6 +330,7 @@ public final class BluetoothA2dpSink implements BluetoothProfile { /** * {@inheritDoc} */ @Override public int getConnectionState(BluetoothDevice device) { if (VDBG) log("getState(" + device + ")"); if (mService != null && isEnabled() Loading Loading @@ -390,8 +391,8 @@ public final class BluetoothA2dpSink implements BluetoothProfile { if (DBG) log("setPriority(" + device + ", " + priority + ")"); if (mService != null && isEnabled() && isValidDevice(device)) { if (priority != BluetoothProfile.PRIORITY_OFF && priority != BluetoothProfile.PRIORITY_ON){ if (priority != BluetoothProfile.PRIORITY_OFF && priority != BluetoothProfile.PRIORITY_ON) { return false; } try { Loading Loading @@ -458,6 +459,7 @@ public final class BluetoothA2dpSink implements BluetoothProfile { * Helper for converting a state to a string. * * For debug use only - strings are not internationalized. * * @hide */ public static String stateToString(int state) { Loading Loading @@ -489,6 +491,7 @@ public final class BluetoothA2dpSink implements BluetoothProfile { BluetoothA2dpSink.this); } } public void onServiceDisconnected(ComponentName className) { if (DBG) Log.d(TAG, "Proxy object disconnected"); mService = null; Loading core/java/android/bluetooth/BluetoothActivityEnergyInfo.java +23 −19 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import java.util.Arrays; * Record of energy and activity information from controller and * underlying bt stack state.Timestamp the record with system * time * * @hide */ public final class BluetoothActivityEnergyInfo implements Parcelable { Loading Loading @@ -86,6 +87,8 @@ public final class BluetoothActivityEnergyInfo implements Parcelable { } }; @Override @SuppressWarnings("unchecked") public void writeToParcel(Parcel out, int flags) { out.writeLong(mTimestamp); Loading @@ -97,6 +100,7 @@ public final class BluetoothActivityEnergyInfo implements Parcelable { out.writeTypedArray(mUidTraffic, flags); } @Override public int describeContents() { return 0; } Loading Loading @@ -131,6 +135,7 @@ public final class BluetoothActivityEnergyInfo implements Parcelable { /** * product of current(mA), voltage(V) and time(ms) * * @return energy used */ public long getControllerEnergyUsed() { Loading @@ -156,8 +161,7 @@ public final class BluetoothActivityEnergyInfo implements Parcelable { * @return if the record is valid */ public boolean isValid() { return ((mControllerTxTimeMs >=0) && (mControllerRxTimeMs >=0) && (mControllerIdleTimeMs >=0)); return ((mControllerTxTimeMs >= 0) && (mControllerRxTimeMs >= 0) && (mControllerIdleTimeMs >= 0)); } } core/java/android/bluetooth/BluetoothAdapter.java +273 −223 File changed.Preview size limit exceeded, changes collapsed. Show changes core/java/android/bluetooth/BluetoothAssignedNumbers.java +2 −2 Original line number Diff line number Diff line Loading @@ -20,9 +20,9 @@ package android.bluetooth; * Bluetooth Assigned Numbers. * <p> * For now we only include Company ID values. * @see <a href="https://www.bluetooth.org/technical/assignednumbers/identifiers.htm"> * The Official Bluetooth SIG Member Website | Company Identifiers</a> * * @see <a href="https://www.bluetooth.org/technical/assignednumbers/identifiers.htm"> The Official * Bluetooth SIG Member Website | Company Identifiers</a> */ public class BluetoothAssignedNumbers { Loading Loading
core/java/android/bluetooth/BluetoothA2dp.java +91 −76 Original line number Diff line number Diff line Loading @@ -139,42 +139,55 @@ public final class BluetoothA2dp implements BluetoothProfile { /** * We don't have a stored preference for whether or not the given A2DP sink device supports * optional codecs. * @hide */ * * @hide */ public static final int OPTIONAL_CODECS_SUPPORT_UNKNOWN = -1; /** * The given A2DP sink device does not support optional codecs. * @hide */ * * @hide */ public static final int OPTIONAL_CODECS_NOT_SUPPORTED = 0; /** * The given A2DP sink device does support optional codecs. * @hide */ * * @hide */ public static final int OPTIONAL_CODECS_SUPPORTED = 1; /** * We don't have a stored preference for whether optional codecs should be enabled or disabled * for the given A2DP device. * @hide */ * * @hide */ public static final int OPTIONAL_CODECS_PREF_UNKNOWN = -1; /** * Optional codecs should be disabled for the given A2DP device. * @hide */ * * @hide */ public static final int OPTIONAL_CODECS_PREF_DISABLED = 0; /** * Optional codecs should be enabled for the given A2DP device. * @hide */ * * @hide */ public static final int OPTIONAL_CODECS_PREF_ENABLED = 1; private Context mContext; private ServiceListener mServiceListener; private final ReentrantReadWriteLock mServiceLock = new ReentrantReadWriteLock(); @GuardedBy("mServiceLock") private IBluetoothA2dp mService; @GuardedBy("mServiceLock") private IBluetoothA2dp mService; private BluetoothAdapter mAdapter; final private IBluetoothStateChangeCallback mBluetoothStateChangeCallback = private final IBluetoothStateChangeCallback mBluetoothStateChangeCallback = new IBluetoothStateChangeCallback.Stub() { public void onBluetoothStateChange(boolean up) { if (DBG) Log.d(TAG, "onBluetoothStateChange: up=" + up); Loading Loading @@ -204,10 +217,10 @@ public final class BluetoothA2dp implements BluetoothProfile { } } }; /** * Create a BluetoothA2dp proxy object for interacting with the local * Bluetooth A2DP service. * */ /*package*/ BluetoothA2dp(Context context, ServiceListener l) { mContext = context; Loading Loading @@ -261,10 +274,12 @@ public final class BluetoothA2dp implements BluetoothProfile { } } @Override public void finalize() { // The empty finalize needs to be kept or the // cts signature tests would fail. } /** * Initiate connection to a profile of the remote bluetooth device. * Loading @@ -283,16 +298,14 @@ public final class BluetoothA2dp implements BluetoothProfile { * permission. * * @param device Remote Bluetooth Device * @return false on immediate error, * true otherwise * @return false on immediate error, true otherwise * @hide */ public boolean connect(BluetoothDevice device) { if (DBG) log("connect(" + device + ")"); try { mServiceLock.readLock().lock(); if (mService != null && isEnabled() && isValidDevice(device)) { if (mService != null && isEnabled() && isValidDevice(device)) { return mService.connect(device); } if (mService == null) Log.w(TAG, "Proxy not attached to service"); Loading Loading @@ -327,16 +340,14 @@ public final class BluetoothA2dp implements BluetoothProfile { * permission. * * @param device Remote Bluetooth Device * @return false on immediate error, * true otherwise * @return false on immediate error, true otherwise * @hide */ public boolean disconnect(BluetoothDevice device) { if (DBG) log("disconnect(" + device + ")"); try { mServiceLock.readLock().lock(); if (mService != null && isEnabled() && isValidDevice(device)) { if (mService != null && isEnabled() && isValidDevice(device)) { return mService.disconnect(device); } if (mService == null) Log.w(TAG, "Proxy not attached to service"); Loading @@ -352,6 +363,7 @@ public final class BluetoothA2dp implements BluetoothProfile { /** * {@inheritDoc} */ @Override public List<BluetoothDevice> getConnectedDevices() { if (VDBG) log("getConnectedDevices()"); try { Loading @@ -372,6 +384,7 @@ public final class BluetoothA2dp implements BluetoothProfile { /** * {@inheritDoc} */ @Override public List<BluetoothDevice> getDevicesMatchingConnectionStates(int[] states) { if (VDBG) log("getDevicesMatchingStates()"); try { Loading @@ -392,6 +405,7 @@ public final class BluetoothA2dp implements BluetoothProfile { /** * {@inheritDoc} */ @Override public int getConnectionState(BluetoothDevice device) { if (VDBG) log("getState(" + device + ")"); try { Loading Loading @@ -431,8 +445,8 @@ public final class BluetoothA2dp implements BluetoothProfile { mServiceLock.readLock().lock(); if (mService != null && isEnabled() && isValidDevice(device)) { if (priority != BluetoothProfile.PRIORITY_OFF && priority != BluetoothProfile.PRIORITY_ON) { if (priority != BluetoothProfile.PRIORITY_OFF && priority != BluetoothProfile.PRIORITY_ON) { return false; } return mService.setPriority(device, priority); Loading Loading @@ -577,6 +591,7 @@ public final class BluetoothA2dp implements BluetoothProfile { * This function checks if the remote device is an AVCRP * target and thus whether we should send volume keys * changes or not. * * @hide */ public boolean shouldSendVolumeKeys(BluetoothDevice device) { Loading Loading @@ -692,7 +707,6 @@ public final class BluetoothA2dp implements BluetoothProfile { * @param device The device to check * @return one of OPTIONAL_CODECS_SUPPORT_UNKNOWN, OPTIONAL_CODECS_NOT_SUPPORTED, or * OPTIONAL_CODECS_SUPPORTED. * * @hide */ public int supportsOptionalCodecs(BluetoothDevice device) { Loading @@ -717,7 +731,6 @@ public final class BluetoothA2dp implements BluetoothProfile { * @param device The device in question. * @return one of OPTIONAL_CODECS_PREF_UNKNOWN, OPTIONAL_CODECS_PREF_ENABLED, or * OPTIONAL_CODECS_PREF_DISABLED. * * @hide */ public int getOptionalCodecsEnabled(BluetoothDevice device) { Loading Loading @@ -747,9 +760,9 @@ public final class BluetoothA2dp implements BluetoothProfile { */ public void setOptionalCodecsEnabled(BluetoothDevice device, int value) { try { if (value != BluetoothA2dp.OPTIONAL_CODECS_PREF_UNKNOWN && value != BluetoothA2dp.OPTIONAL_CODECS_PREF_DISABLED && value != BluetoothA2dp.OPTIONAL_CODECS_PREF_ENABLED) { if (value != BluetoothA2dp.OPTIONAL_CODECS_PREF_UNKNOWN && value != BluetoothA2dp.OPTIONAL_CODECS_PREF_DISABLED && value != BluetoothA2dp.OPTIONAL_CODECS_PREF_ENABLED) { Log.e(TAG, "Invalid value passed to setOptionalCodecsEnabled: " + value); return; } Loading @@ -772,6 +785,7 @@ public final class BluetoothA2dp implements BluetoothProfile { * Helper for converting a state to a string. * * For debug use only - strings are not internationalized. * * @hide */ public static String stateToString(int state) { Loading Loading @@ -807,6 +821,7 @@ public final class BluetoothA2dp implements BluetoothProfile { mServiceListener.onServiceConnected(BluetoothProfile.A2DP, BluetoothA2dp.this); } } public void onServiceDisconnected(ComponentName className) { if (DBG) Log.d(TAG, "Proxy object disconnected"); try { Loading
core/java/android/bluetooth/BluetoothA2dpSink.java +69 −66 Original line number Diff line number Diff line Loading @@ -120,15 +120,15 @@ public final class BluetoothA2dpSink implements BluetoothProfile { * This extra represents the current audio configuration of the A2DP source device. * {@see BluetoothAudioConfig} */ public static final String EXTRA_AUDIO_CONFIG = "android.bluetooth.a2dp-sink.profile.extra.AUDIO_CONFIG"; public static final String EXTRA_AUDIO_CONFIG = "android.bluetooth.a2dp-sink.profile.extra.AUDIO_CONFIG"; private Context mContext; private ServiceListener mServiceListener; private IBluetoothA2dpSink mService; private BluetoothAdapter mAdapter; final private IBluetoothStateChangeCallback mBluetoothStateChangeCallback = private final IBluetoothStateChangeCallback mBluetoothStateChangeCallback = new IBluetoothStateChangeCallback.Stub() { public void onBluetoothStateChange(boolean up) { if (DBG) Log.d(TAG, "onBluetoothStateChange: up=" + up); Loading Loading @@ -156,10 +156,10 @@ public final class BluetoothA2dpSink implements BluetoothProfile { } } }; /** * Create a BluetoothA2dp proxy object for interacting with the local * Bluetooth A2DP service. * */ /*package*/ BluetoothA2dpSink(Context context, ServiceListener l) { mContext = context; Loading Loading @@ -212,9 +212,11 @@ public final class BluetoothA2dpSink implements BluetoothProfile { } } @Override public void finalize() { close(); } /** * Initiate connection to a profile of the remote bluetooth device. * Loading @@ -233,14 +235,12 @@ public final class BluetoothA2dpSink implements BluetoothProfile { * permission. * * @param device Remote Bluetooth Device * @return false on immediate error, * true otherwise * @return false on immediate error, true otherwise * @hide */ public boolean connect(BluetoothDevice device) { if (DBG) log("connect(" + device + ")"); if (mService != null && isEnabled() && isValidDevice(device)) { if (mService != null && isEnabled() && isValidDevice(device)) { try { return mService.connect(device); } catch (RemoteException e) { Loading Loading @@ -274,14 +274,12 @@ public final class BluetoothA2dpSink implements BluetoothProfile { * permission. * * @param device Remote Bluetooth Device * @return false on immediate error, * true otherwise * @return false on immediate error, true otherwise * @hide */ public boolean disconnect(BluetoothDevice device) { if (DBG) log("disconnect(" + device + ")"); if (mService != null && isEnabled() && isValidDevice(device)) { if (mService != null && isEnabled() && isValidDevice(device)) { try { return mService.disconnect(device); } catch (RemoteException e) { Loading @@ -296,6 +294,7 @@ public final class BluetoothA2dpSink implements BluetoothProfile { /** * {@inheritDoc} */ @Override public List<BluetoothDevice> getConnectedDevices() { if (VDBG) log("getConnectedDevices()"); if (mService != null && isEnabled()) { Loading @@ -313,6 +312,7 @@ public final class BluetoothA2dpSink implements BluetoothProfile { /** * {@inheritDoc} */ @Override public List<BluetoothDevice> getDevicesMatchingConnectionStates(int[] states) { if (VDBG) log("getDevicesMatchingStates()"); if (mService != null && isEnabled()) { Loading @@ -330,6 +330,7 @@ public final class BluetoothA2dpSink implements BluetoothProfile { /** * {@inheritDoc} */ @Override public int getConnectionState(BluetoothDevice device) { if (VDBG) log("getState(" + device + ")"); if (mService != null && isEnabled() Loading Loading @@ -390,8 +391,8 @@ public final class BluetoothA2dpSink implements BluetoothProfile { if (DBG) log("setPriority(" + device + ", " + priority + ")"); if (mService != null && isEnabled() && isValidDevice(device)) { if (priority != BluetoothProfile.PRIORITY_OFF && priority != BluetoothProfile.PRIORITY_ON){ if (priority != BluetoothProfile.PRIORITY_OFF && priority != BluetoothProfile.PRIORITY_ON) { return false; } try { Loading Loading @@ -458,6 +459,7 @@ public final class BluetoothA2dpSink implements BluetoothProfile { * Helper for converting a state to a string. * * For debug use only - strings are not internationalized. * * @hide */ public static String stateToString(int state) { Loading Loading @@ -489,6 +491,7 @@ public final class BluetoothA2dpSink implements BluetoothProfile { BluetoothA2dpSink.this); } } public void onServiceDisconnected(ComponentName className) { if (DBG) Log.d(TAG, "Proxy object disconnected"); mService = null; Loading
core/java/android/bluetooth/BluetoothActivityEnergyInfo.java +23 −19 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import java.util.Arrays; * Record of energy and activity information from controller and * underlying bt stack state.Timestamp the record with system * time * * @hide */ public final class BluetoothActivityEnergyInfo implements Parcelable { Loading Loading @@ -86,6 +87,8 @@ public final class BluetoothActivityEnergyInfo implements Parcelable { } }; @Override @SuppressWarnings("unchecked") public void writeToParcel(Parcel out, int flags) { out.writeLong(mTimestamp); Loading @@ -97,6 +100,7 @@ public final class BluetoothActivityEnergyInfo implements Parcelable { out.writeTypedArray(mUidTraffic, flags); } @Override public int describeContents() { return 0; } Loading Loading @@ -131,6 +135,7 @@ public final class BluetoothActivityEnergyInfo implements Parcelable { /** * product of current(mA), voltage(V) and time(ms) * * @return energy used */ public long getControllerEnergyUsed() { Loading @@ -156,8 +161,7 @@ public final class BluetoothActivityEnergyInfo implements Parcelable { * @return if the record is valid */ public boolean isValid() { return ((mControllerTxTimeMs >=0) && (mControllerRxTimeMs >=0) && (mControllerIdleTimeMs >=0)); return ((mControllerTxTimeMs >= 0) && (mControllerRxTimeMs >= 0) && (mControllerIdleTimeMs >= 0)); } }
core/java/android/bluetooth/BluetoothAdapter.java +273 −223 File changed.Preview size limit exceeded, changes collapsed. Show changes
core/java/android/bluetooth/BluetoothAssignedNumbers.java +2 −2 Original line number Diff line number Diff line Loading @@ -20,9 +20,9 @@ package android.bluetooth; * Bluetooth Assigned Numbers. * <p> * For now we only include Company ID values. * @see <a href="https://www.bluetooth.org/technical/assignednumbers/identifiers.htm"> * The Official Bluetooth SIG Member Website | Company Identifiers</a> * * @see <a href="https://www.bluetooth.org/technical/assignednumbers/identifiers.htm"> The Official * Bluetooth SIG Member Website | Company Identifiers</a> */ public class BluetoothAssignedNumbers { Loading