Skip to content
Snippets Groups Projects
Commit bbbbdb52 authored by Brian Delwiche's avatar Brian Delwiche
Browse files

Fix OPP comparison

isBluetoothShareUri_correctlyCheckUri (under
com.android.bluetooth.opp.BluetoothOppUtilityTest) is failing
on null input due to an incorrect comparison in
isBluetoothShareUri.  Change the comparison to one which can
cope with null input.

Bug: 257190999
Test: atest: BluetoothOppUtilityTest
Tag: #security
Ignore-AOSP-First: Security
Change-Id: I61118f22577de7b975fb0df8dac8583e91f7b8c7
(cherry picked from commit c9b53b95)
Merged-In: I61118f22577de7b975fb0df8dac8583e91f7b8c7
parent 8c63c7c1
No related branches found
No related tags found
No related merge requests found
......@@ -63,6 +63,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
/**
......@@ -80,10 +81,10 @@ public class BluetoothOppUtility {
public static boolean isBluetoothShareUri(Uri uri) {
if (uri.toString().startsWith(BluetoothShare.CONTENT_URI.toString())
&& !uri.getAuthority().equals(BluetoothShare.CONTENT_URI.getAuthority())) {
&& !Objects.equals(uri.getAuthority(), BluetoothShare.CONTENT_URI.getAuthority())) {
EventLog.writeEvent(0x534e4554, "225880741", -1, "");
}
return uri.getAuthority().equals(BluetoothShare.CONTENT_URI.getAuthority());
return Objects.equals(uri.getAuthority(), BluetoothShare.CONTENT_URI.getAuthority());
}
public static BluetoothOppTransferInfo queryRecord(Context context, Uri uri) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment