diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2022-01-31 21:02:38 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2022-01-31 21:02:38 +0000 |
commit | 5b2935e93a8029b15ef42c47cc780bfbc455a1af (patch) | |
tree | 0bb74d229fae64635716021984d12d0b27f2cc89 | |
parent | 54d92117890830258bc0e4b756ef2ed1e8155ccd (diff) | |
parent | 8d8239ccb85fa0689b91a977fcbbc1914aef90de (diff) |
Merge "Remove new added hidden calls in Bt" am: 2f97b037bf am: c422a7c00a am: 2cad6d58f8 am: 8d8239ccb8
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/1965498
Change-Id: Ia5f4d2d0e2ff6cebdf7d745c3f1ace6ce9fa32c8
-rw-r--r-- | android/app/src/com/android/bluetooth/btservice/AdapterService.java | 29 | ||||
-rw-r--r-- | android/app/src/com/android/bluetooth/le_audio/LeAudioBroadcasterNativeInterface.java | 2 |
2 files changed, 13 insertions, 18 deletions
diff --git a/android/app/src/com/android/bluetooth/btservice/AdapterService.java b/android/app/src/com/android/bluetooth/btservice/AdapterService.java index 444376139c..3680c7fafd 100644 --- a/android/app/src/com/android/bluetooth/btservice/AdapterService.java +++ b/android/app/src/com/android/bluetooth/btservice/AdapterService.java @@ -95,7 +95,6 @@ import android.sysprop.BluetoothProperties; import android.text.TextUtils; import android.util.Base64; import android.util.Log; -import android.util.Slog; import android.util.SparseArray; import com.android.bluetooth.BluetoothMetricsProto; @@ -1294,10 +1293,8 @@ public class AdapterService extends Service { PendingIntent pendingIntent, AttributionSource attributionSource) { if (mBluetoothServerSockets.containsKey(uuid.getUuid())) { - Slog.d(TAG, - String.format( - "Cannot start RFCOMM listener: UUID %s already in use.", - uuid.getUuid())); + Log.d(TAG, String.format( + "Cannot start RFCOMM listener: UUID %s already in use.", uuid.getUuid())); return BluetoothStatusCodes.RFCOMM_LISTENER_START_FAILED_UUID_IN_USE; } @@ -1315,10 +1312,8 @@ public class AdapterService extends Service { RfcommListenerData listenerData = mBluetoothServerSockets.get(uuid.getUuid()); if (listenerData == null) { - Slog.d(TAG, - String.format( - "Cannot stop RFCOMM listener: UUID %s is not registered.", - uuid.getUuid())); + Log.d(TAG, String.format( + "Cannot stop RFCOMM listener: UUID %s is not registered.", uuid.getUuid())); return BluetoothStatusCodes.RFCOMM_LISTENER_OPERATION_FAILED_NO_MATCHING_SERVICE_RECORD; } @@ -1357,7 +1352,7 @@ public class AdapterService extends Service { return socketInfo; } - mHandler.removeCallbacksAndEqualMessages(socket); + mHandler.removeCallbacksAndMessages(socket); socketInfo.bluetoothDevice = socket.getRemoteDevice(); socketInfo.pfd = socket.getParcelFileDescriptor(); @@ -1376,7 +1371,7 @@ public class AdapterService extends Service { if (mBluetoothServerSockets.containsKey(uuid)) { // The uuid still being in the map indicates that the accept failure is // unexpected. Try and restart the listener. - Slog.e(TAG, "Failed to accept socket on " + listenerData.mServerSocket, e); + Log.e(TAG, "Failed to accept socket on " + listenerData.mServerSocket, e); restartRfcommListener(listenerData, uuid); } return; @@ -1386,7 +1381,7 @@ public class AdapterService extends Service { try { listenerData.mPendingIntent.send(); } catch (PendingIntent.CanceledException e) { - Slog.e(TAG, "PendingIntent for RFCOMM socket notifications cancelled.", e); + Log.e(TAG, "PendingIntent for RFCOMM socket notifications cancelled.", e); // The pending intent was cancelled, close the server as there is no longer any way // to notify the app that registered the listener. listenerData.closeServerAndPendingSockets(mHandler); @@ -1410,7 +1405,7 @@ public class AdapterService extends Service { listenerData.mPendingIntent, listenerData.mAttributionSource); } catch (IOException e) { - Slog.e(TAG, "Failed to recreate rfcomm server socket", e); + Log.e(TAG, "Failed to recreate rfcomm server socket", e); mBluetoothServerSockets.remove(uuid); } @@ -1423,7 +1418,7 @@ public class AdapterService extends Service { try { socket.close(); } catch (IOException e) { - Slog.e(TAG, "Failed to close bt socket", e); + Log.e(TAG, "Failed to close bt socket", e); // We don't care if closing the socket failed, just continue on. } } @@ -1482,16 +1477,16 @@ public class AdapterService extends Service { try { mServerSocket.close(); } catch (IOException e) { - Slog.e(TAG, "Failed to call close on rfcomm server socket", e); + Log.e(TAG, "Failed to call close on rfcomm server socket", e); result = BluetoothStatusCodes.RFCOMM_LISTENER_FAILED_TO_CLOSE_SERVER_SOCKET; } mPendingSockets.forEach( pendingSocket -> { - handler.removeCallbacksAndEqualMessages(pendingSocket); + handler.removeCallbacksAndMessages(pendingSocket); try { pendingSocket.close(); } catch (IOException e) { - Slog.e(TAG, "Failed to close socket", e); + Log.e(TAG, "Failed to close socket", e); } }); mPendingSockets.clear(); diff --git a/android/app/src/com/android/bluetooth/le_audio/LeAudioBroadcasterNativeInterface.java b/android/app/src/com/android/bluetooth/le_audio/LeAudioBroadcasterNativeInterface.java index 2adb094b2e..7c3e06e992 100644 --- a/android/app/src/com/android/bluetooth/le_audio/LeAudioBroadcasterNativeInterface.java +++ b/android/app/src/com/android/bluetooth/le_audio/LeAudioBroadcasterNativeInterface.java @@ -49,7 +49,7 @@ public class LeAudioBroadcasterNativeInterface { private LeAudioBroadcasterNativeInterface() { mAdapter = BluetoothAdapter.getDefaultAdapter(); if (mAdapter == null) { - Log.wtfStack(TAG, "No Bluetooth Adapter Available"); + Log.wtf(TAG, "No Bluetooth Adapter Available"); } } |