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

Commit 87efb143 authored by Matthew Xie's avatar Matthew Xie Committed by Android Git Automerger
Browse files

am e8d27539: am ccf9ef60: Merge "Reduce android.bluetooth package debug messages" into jb-mr1-dev

* commit 'e8d27539':
  Reduce android.bluetooth package debug messages
parents 859dbd89 e8d27539
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ import java.util.List;
public final class BluetoothA2dp implements BluetoothProfile {
    private static final String TAG = "BluetoothA2dp";
    private static final boolean DBG = true;
    private static final boolean VDBG = false;

    /**
     * Intent used to broadcast the change in connection state of the A2DP
@@ -113,7 +114,7 @@ public final class BluetoothA2dp implements BluetoothProfile {
                public void onBluetoothStateChange(boolean up) {
                    if (DBG) Log.d(TAG, "onBluetoothStateChange: up=" + up);
                    if (!up) {
                        if (DBG) Log.d(TAG,"Unbinding service...");
                        if (VDBG) Log.d(TAG,"Unbinding service...");
                        synchronized (mConnection) {
                            try {
                                mService = null;
@@ -126,7 +127,7 @@ public final class BluetoothA2dp implements BluetoothProfile {
                        synchronized (mConnection) {
                            try {
                                if (mService == null) {
                                    if (DBG) Log.d(TAG,"Binding service...");
                                    if (VDBG) Log.d(TAG,"Binding service...");
                                    if (!mContext.bindService(new Intent(IBluetoothA2dp.class.getName()), mConnection, 0)) {
                                        Log.e(TAG, "Could not bind to Bluetooth A2DP Service");
                                    }
@@ -269,7 +270,7 @@ public final class BluetoothA2dp implements BluetoothProfile {
     * {@inheritDoc}
     */
    public List<BluetoothDevice> getConnectedDevices() {
        if (DBG) log("getConnectedDevices()");
        if (VDBG) log("getConnectedDevices()");
        if (mService != null && isEnabled()) {
            try {
                return mService.getConnectedDevices();
@@ -286,7 +287,7 @@ public final class BluetoothA2dp implements BluetoothProfile {
     * {@inheritDoc}
     */
    public List<BluetoothDevice> getDevicesMatchingConnectionStates(int[] states) {
        if (DBG) log("getDevicesMatchingStates()");
        if (VDBG) log("getDevicesMatchingStates()");
        if (mService != null && isEnabled()) {
            try {
                return mService.getDevicesMatchingConnectionStates(states);
@@ -303,7 +304,7 @@ public final class BluetoothA2dp implements BluetoothProfile {
     * {@inheritDoc}
     */
    public int getConnectionState(BluetoothDevice device) {
        if (DBG) log("getState(" + device + ")");
        if (VDBG) log("getState(" + device + ")");
        if (mService != null && isEnabled()
            && isValidDevice(device)) {
            try {
@@ -365,7 +366,7 @@ public final class BluetoothA2dp implements BluetoothProfile {
     * @hide
     */
    public int getPriority(BluetoothDevice device) {
        if (DBG) log("getPriority(" + device + ")");
        if (VDBG) log("getPriority(" + device + ")");
        if (mService != null && isEnabled()
            && isValidDevice(device)) {
            try {
+12 −11
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ import java.util.List;
public final class BluetoothHeadset implements BluetoothProfile {
    private static final String TAG = "BluetoothHeadset";
    private static final boolean DBG = true;
    private static final boolean VDBG = false;

    /**
     * Intent used to broadcast the change in connection state of the Headset
@@ -226,7 +227,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
                public void onBluetoothStateChange(boolean up) {
                    if (DBG) Log.d(TAG, "onBluetoothStateChange: up=" + up);
                    if (!up) {
                        if (DBG) Log.d(TAG,"Unbinding service...");
                        if (VDBG) Log.d(TAG,"Unbinding service...");
                        synchronized (mConnection) {
                            try {
                                mService = null;
@@ -239,7 +240,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
                        synchronized (mConnection) {
                            try {
                                if (mService == null) {
                                    if (DBG) Log.d(TAG,"Binding service...");
                                    if (VDBG) Log.d(TAG,"Binding service...");
                                    if (!mContext.bindService(new Intent(IBluetoothHeadset.class.getName()), mConnection, 0)) {
                                        Log.e(TAG, "Could not bind to Bluetooth Headset Service");
                                    }
@@ -281,7 +282,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
     * are ok.
     */
    /*package*/ void close() {
        if (DBG) log("close()");
        if (VDBG) log("close()");

        IBluetoothManager mgr = mAdapter.getBluetoothManager();
        if (mgr != null) {
@@ -387,7 +388,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
     * {@inheritDoc}
     */
    public List<BluetoothDevice> getConnectedDevices() {
        if (DBG) log("getConnectedDevices()");
        if (VDBG) log("getConnectedDevices()");
        if (mService != null && isEnabled()) {
            try {
                return mService.getConnectedDevices();
@@ -404,7 +405,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
     * {@inheritDoc}
     */
    public List<BluetoothDevice> getDevicesMatchingConnectionStates(int[] states) {
        if (DBG) log("getDevicesMatchingStates()");
        if (VDBG) log("getDevicesMatchingStates()");
        if (mService != null && isEnabled()) {
            try {
                return mService.getDevicesMatchingConnectionStates(states);
@@ -421,7 +422,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
     * {@inheritDoc}
     */
    public int getConnectionState(BluetoothDevice device) {
        if (DBG) log("getConnectionState(" + device + ")");
        if (VDBG) log("getConnectionState(" + device + ")");
        if (mService != null && isEnabled() &&
            isValidDevice(device)) {
            try {
@@ -483,7 +484,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
     * @hide
     */
    public int getPriority(BluetoothDevice device) {
        if (DBG) log("getPriority(" + device + ")");
        if (VDBG) log("getPriority(" + device + ")");
        if (mService != null && isEnabled() &&
            isValidDevice(device)) {
            try {
@@ -566,7 +567,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
     *         false otherwise or on error
     */
    public boolean isAudioConnected(BluetoothDevice device) {
        if (DBG) log("isAudioConnected()");
        if (VDBG) log("isAudioConnected()");
        if (mService != null && isEnabled() &&
            isValidDevice(device)) {
            try {
@@ -594,7 +595,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
     * @hide
     */
    public int getBatteryUsageHint(BluetoothDevice device) {
        if (DBG) log("getBatteryUsageHint()");
        if (VDBG) log("getBatteryUsageHint()");
        if (mService != null && isEnabled() &&
            isValidDevice(device)) {
            try {
@@ -661,7 +662,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
     * @hide
     */
    public int getAudioState(BluetoothDevice device) {
        if (DBG) log("getAudioState");
        if (VDBG) log("getAudioState");
        if (mService != null && !isDisabled()) {
            try {
                return mService.getAudioState(device);
@@ -683,7 +684,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
     * @hide
     */
    public boolean isAudioOn() {
        if (DBG) log("isAudioOn()");
        if (VDBG) log("isAudioOn()");
        if (mService != null && isEnabled()) {
            try {
              return mService.isAudioOn();
+6 −5
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ import java.util.List;
public final class BluetoothHealth implements BluetoothProfile {
    private static final String TAG = "BluetoothHealth";
    private static final boolean DBG = true;
    private static final boolean VDBG = false;

    /**
     * Health Profile Source Role - the health device.
@@ -102,7 +103,7 @@ public final class BluetoothHealth implements BluetoothProfile {
                public void onBluetoothStateChange(boolean up) {
                    if (DBG) Log.d(TAG, "onBluetoothStateChange: up=" + up);
                    if (!up) {
                        if (DBG) Log.d(TAG,"Unbinding service...");
                        if (VDBG) Log.d(TAG,"Unbinding service...");
                        synchronized (mConnection) {
                            try {
                                mService = null;
@@ -115,7 +116,7 @@ public final class BluetoothHealth implements BluetoothProfile {
                        synchronized (mConnection) {
                            try {
                                if (mService == null) {
                                    if (DBG) Log.d(TAG,"Binding service...");
                                    if (VDBG) Log.d(TAG,"Binding service...");
                                    if (!mContext.bindService(new Intent(IBluetoothHealth.class.getName()), mConnection, 0)) {
                                        Log.e(TAG, "Could not bind to Bluetooth Health Service");
                                    }
@@ -148,7 +149,7 @@ public final class BluetoothHealth implements BluetoothProfile {
            BluetoothHealthCallback callback) {
        if (!isEnabled() || name == null) return false;

        if (DBG) log("registerSinkApplication(" + name + ":" + dataType + ")");
        if (VDBG) log("registerSinkApplication(" + name + ":" + dataType + ")");
        return registerAppConfiguration(name, dataType, SINK_ROLE,
                CHANNEL_TYPE_ANY, callback);
    }
@@ -174,7 +175,7 @@ public final class BluetoothHealth implements BluetoothProfile {
        boolean result = false;
        if (!isEnabled() || !checkAppParam(name, role, channelType, callback)) return result;

        if (DBG) log("registerApplication(" + name + ":" + dataType + ")");
        if (VDBG) log("registerApplication(" + name + ":" + dataType + ")");
        BluetoothHealthCallbackWrapper wrapper = new BluetoothHealthCallbackWrapper(callback);
        BluetoothHealthAppConfiguration config =
                new BluetoothHealthAppConfiguration(name, dataType, role, channelType);
@@ -488,7 +489,7 @@ public final class BluetoothHealth implements BluetoothProfile {
    }

    /*package*/ void close() {
        if (DBG) log("close()");
        if (VDBG) log("close()");
        IBluetoothManager mgr = mAdapter.getBluetoothManager();
        if (mgr != null) {
            try {
+10 −9
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ import java.util.List;
public final class BluetoothInputDevice implements BluetoothProfile {
    private static final String TAG = "BluetoothInputDevice";
    private static final boolean DBG = true;
    private static final boolean VDBG = false;

    /**
     * Intent used to broadcast the change in connection state of the Input
@@ -191,7 +192,7 @@ public final class BluetoothInputDevice implements BluetoothProfile {
                public void onBluetoothStateChange(boolean up) {
                    if (DBG) Log.d(TAG, "onBluetoothStateChange: up=" + up);
                    if (!up) {
                        if (DBG) Log.d(TAG,"Unbinding service...");
                        if (VDBG) Log.d(TAG,"Unbinding service...");
                        synchronized (mConnection) {
                            try {
                                mService = null;
@@ -204,7 +205,7 @@ public final class BluetoothInputDevice implements BluetoothProfile {
                        synchronized (mConnection) {
                            try {
                                if (mService == null) {
                                    if (DBG) Log.d(TAG,"Binding service...");
                                    if (VDBG) Log.d(TAG,"Binding service...");
                                    if (!mContext.bindService(new Intent(IBluetoothInputDevice.class.getName()), mConnection, 0)) {
                                        Log.e(TAG, "Could not bind to Bluetooth HID Service");
                                    }
@@ -243,7 +244,7 @@ public final class BluetoothInputDevice implements BluetoothProfile {
    }

    /*package*/ void close() {
        if (DBG) log("close()");
        if (VDBG) log("close()");
        IBluetoothManager mgr = mAdapter.getBluetoothManager();
        if (mgr != null) {
            try {
@@ -344,7 +345,7 @@ public final class BluetoothInputDevice implements BluetoothProfile {
     * {@inheritDoc}
     */
    public List<BluetoothDevice> getConnectedDevices() {
        if (DBG) log("getConnectedDevices()");
        if (VDBG) log("getConnectedDevices()");
        if (mService != null && isEnabled()) {
            try {
                return mService.getConnectedDevices();
@@ -361,7 +362,7 @@ public final class BluetoothInputDevice implements BluetoothProfile {
     * {@inheritDoc}
     */
    public List<BluetoothDevice> getDevicesMatchingConnectionStates(int[] states) {
        if (DBG) log("getDevicesMatchingStates()");
        if (VDBG) log("getDevicesMatchingStates()");
        if (mService != null && isEnabled()) {
            try {
                return mService.getDevicesMatchingConnectionStates(states);
@@ -378,7 +379,7 @@ public final class BluetoothInputDevice implements BluetoothProfile {
     * {@inheritDoc}
     */
    public int getConnectionState(BluetoothDevice device) {
        if (DBG) log("getState(" + device + ")");
        if (VDBG) log("getState(" + device + ")");
        if (mService != null && isEnabled() && isValidDevice(device)) {
            try {
                return mService.getConnectionState(device);
@@ -438,7 +439,7 @@ public final class BluetoothInputDevice implements BluetoothProfile {
     * @hide
     */
    public int getPriority(BluetoothDevice device) {
        if (DBG) log("getPriority(" + device + ")");
        if (VDBG) log("getPriority(" + device + ")");
        if (mService != null && isEnabled() && isValidDevice(device)) {
            try {
                return mService.getPriority(device);
@@ -519,7 +520,7 @@ public final class BluetoothInputDevice implements BluetoothProfile {
    * @hide
    */
    public boolean getProtocolMode(BluetoothDevice device) {
        if (DBG) log("getProtocolMode(" + device + ")");
        if (VDBG) log("getProtocolMode(" + device + ")");
        if (mService != null && isEnabled() && isValidDevice(device)) {
            try {
                return mService.getProtocolMode(device);
@@ -570,7 +571,7 @@ public final class BluetoothInputDevice implements BluetoothProfile {
     * @hide
     */
    public boolean getReport(BluetoothDevice device, byte reportType, byte reportId, int bufferSize) {
        if (DBG) log("getReport(" + device + "), reportType=" + reportType + " reportId=" + reportId + "bufferSize=" + bufferSize);
        if (VDBG) log("getReport(" + device + "), reportType=" + reportType + " reportId=" + reportId + "bufferSize=" + bufferSize);
        if (mService != null && isEnabled() && isValidDevice(device)) {
            try {
                return mService.getReport(device, reportType, reportId, bufferSize);
+7 −6
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ import java.util.List;
public final class BluetoothPan implements BluetoothProfile {
    private static final String TAG = "BluetoothPan";
    private static final boolean DBG = true;
    private static final boolean VDBG = false;

    /**
     * Intent used to broadcast the change in connection state of the Pan
@@ -145,7 +146,7 @@ public final class BluetoothPan implements BluetoothProfile {
    }

    /*package*/ void close() {
        if (DBG) log("close()");
        if (VDBG) log("close()");
        if (mConnection != null) {
            mContext.unbindService(mConnection);
            mConnection = null;
@@ -175,7 +176,7 @@ public final class BluetoothPan implements BluetoothProfile {
                }
                Log.d(TAG, "BluetoothPan(), bindService called");
            } else {
                if (DBG) Log.d(TAG,"Unbinding service...");
                if (VDBG) Log.d(TAG,"Unbinding service...");
                synchronized (mConnection) {
                    try {
                        mPanService = null;
@@ -266,7 +267,7 @@ public final class BluetoothPan implements BluetoothProfile {
     * {@inheritDoc}
     */
    public List<BluetoothDevice> getConnectedDevices() {
        if (DBG) log("getConnectedDevices()");
        if (VDBG) log("getConnectedDevices()");
        if (mPanService != null && isEnabled()) {
            try {
                return mPanService.getConnectedDevices();
@@ -283,7 +284,7 @@ public final class BluetoothPan implements BluetoothProfile {
     * {@inheritDoc}
     */
    public List<BluetoothDevice> getDevicesMatchingConnectionStates(int[] states) {
        if (DBG) log("getDevicesMatchingStates()");
        if (VDBG) log("getDevicesMatchingStates()");
        if (mPanService != null && isEnabled()) {
            try {
                return mPanService.getDevicesMatchingConnectionStates(states);
@@ -300,7 +301,7 @@ public final class BluetoothPan implements BluetoothProfile {
     * {@inheritDoc}
     */
    public int getConnectionState(BluetoothDevice device) {
        if (DBG) log("getState(" + device + ")");
        if (VDBG) log("getState(" + device + ")");
        if (mPanService != null && isEnabled()
            && isValidDevice(device)) {
            try {
@@ -324,7 +325,7 @@ public final class BluetoothPan implements BluetoothProfile {
    }

    public boolean isTetheringOn() {
        if (DBG) log("isTetheringOn()");
        if (VDBG) log("isTetheringOn()");
        try {
            return mPanService.isTetheringOn();
        } catch (RemoteException e) {
Loading