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

Unverified Commit 4a60c8c2 authored by Brian Delwiche's avatar Brian Delwiche Committed by Michael Bestas
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
(cherry picked from commit bbbbdb52)
Merged-In: I61118f22577de7b975fb0df8dac8583e91f7b8c7
parent 855d864e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ 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 Objects.equals(uri.getAuthority(), BluetoothShare.CONTENT_URI.getAuthority());