Loading android/app/src/com/android/bluetooth/Utils.java +14 −0 Original line number Diff line number Diff line Loading @@ -186,6 +186,20 @@ public final class Utils { return String.format("XX:XX:XX:XX:%02X:%02X", address[4], address[5]); } /** * Returns the correct device address to be used for connections over BR/EDR transport. * * @param device the device for which to obtain the connection address * @return either identity address or device address in String format */ public static String getBrEdrAddress(BluetoothDevice device) { String address = device.getIdentityAddress(); if (address == null) { address = device.getAddress(); } return address; } /** * Returns the correct device address to be used for connections over BR/EDR transport. * Loading android/app/src/com/android/bluetooth/opp/BluetoothOppManager.java +12 −2 Original line number Diff line number Diff line Loading @@ -51,7 +51,9 @@ import android.util.Pair; import com.android.bluetooth.BluetoothMethodProxy; import com.android.bluetooth.BluetoothStatsLog; import com.android.bluetooth.R; import com.android.bluetooth.Utils; import com.android.bluetooth.content_profiles.ContentProfileErrorReportUtils; import com.android.bluetooth.flags.Flags; import com.android.internal.annotations.VisibleForTesting; import java.util.ArrayList; Loading Loading @@ -502,7 +504,11 @@ public class BluetoothOppManager { } values.put(BluetoothShare.MIMETYPE, contentType); values.put(BluetoothShare.DESTINATION, mRemoteDevice.getIdentityAddress()); values.put( BluetoothShare.DESTINATION, Flags.identityAddressNullIfUnknown() ? Utils.getBrEdrAddress(mRemoteDevice) : mRemoteDevice.getIdentityAddress()); values.put(BluetoothShare.TIMESTAMP, ts); if (mIsHandoverInitiated) { values.put(BluetoothShare.USER_CONFIRMATION, Loading @@ -524,7 +530,11 @@ public class BluetoothOppManager { ContentValues values = new ContentValues(); values.put(BluetoothShare.URI, mUri); values.put(BluetoothShare.MIMETYPE, mTypeOfSingleFile); values.put(BluetoothShare.DESTINATION, mRemoteDevice.getIdentityAddress()); values.put( BluetoothShare.DESTINATION, Flags.identityAddressNullIfUnknown() ? Utils.getBrEdrAddress(mRemoteDevice) : mRemoteDevice.getIdentityAddress()); if (mIsHandoverInitiated) { values.put(BluetoothShare.USER_CONFIRMATION, BluetoothShare.USER_CONFIRMATION_HANDOVER_CONFIRMED); Loading Loading
android/app/src/com/android/bluetooth/Utils.java +14 −0 Original line number Diff line number Diff line Loading @@ -186,6 +186,20 @@ public final class Utils { return String.format("XX:XX:XX:XX:%02X:%02X", address[4], address[5]); } /** * Returns the correct device address to be used for connections over BR/EDR transport. * * @param device the device for which to obtain the connection address * @return either identity address or device address in String format */ public static String getBrEdrAddress(BluetoothDevice device) { String address = device.getIdentityAddress(); if (address == null) { address = device.getAddress(); } return address; } /** * Returns the correct device address to be used for connections over BR/EDR transport. * Loading
android/app/src/com/android/bluetooth/opp/BluetoothOppManager.java +12 −2 Original line number Diff line number Diff line Loading @@ -51,7 +51,9 @@ import android.util.Pair; import com.android.bluetooth.BluetoothMethodProxy; import com.android.bluetooth.BluetoothStatsLog; import com.android.bluetooth.R; import com.android.bluetooth.Utils; import com.android.bluetooth.content_profiles.ContentProfileErrorReportUtils; import com.android.bluetooth.flags.Flags; import com.android.internal.annotations.VisibleForTesting; import java.util.ArrayList; Loading Loading @@ -502,7 +504,11 @@ public class BluetoothOppManager { } values.put(BluetoothShare.MIMETYPE, contentType); values.put(BluetoothShare.DESTINATION, mRemoteDevice.getIdentityAddress()); values.put( BluetoothShare.DESTINATION, Flags.identityAddressNullIfUnknown() ? Utils.getBrEdrAddress(mRemoteDevice) : mRemoteDevice.getIdentityAddress()); values.put(BluetoothShare.TIMESTAMP, ts); if (mIsHandoverInitiated) { values.put(BluetoothShare.USER_CONFIRMATION, Loading @@ -524,7 +530,11 @@ public class BluetoothOppManager { ContentValues values = new ContentValues(); values.put(BluetoothShare.URI, mUri); values.put(BluetoothShare.MIMETYPE, mTypeOfSingleFile); values.put(BluetoothShare.DESTINATION, mRemoteDevice.getIdentityAddress()); values.put( BluetoothShare.DESTINATION, Flags.identityAddressNullIfUnknown() ? Utils.getBrEdrAddress(mRemoteDevice) : mRemoteDevice.getIdentityAddress()); if (mIsHandoverInitiated) { values.put(BluetoothShare.USER_CONFIRMATION, BluetoothShare.USER_CONFIRMATION_HANDOVER_CONFIRMED); Loading