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

Commit 0cd29128 authored by Ajay Panicker's avatar Ajay Panicker Committed by android-build-merger
Browse files

Protect against SecurityException generated by query

am: 3b00f32c

Change-Id: I6a5b581d1ec3ec2ef3a870f7088135c224b59fb5
parents a4788f40 3b00f32c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -117,7 +117,11 @@ public class BluetoothOppSendFileInfo {
            } catch (SQLiteException e) {
                // some content providers don't support the DISPLAY_NAME or SIZE columns
                metadataCursor = null;
            } catch (SecurityException e) {
                Log.e(TAG, "generateFileInfo: Permission error, could not access URI: " + uri);
                return SEND_FILE_INFO_ERROR;
            }

            if (metadataCursor != null) {
                try {
                    if (metadataCursor.moveToFirst()) {
+3 −0
Original line number Diff line number Diff line
@@ -331,6 +331,9 @@ public class BluetoothOppUtility {

    static void putSendFileInfo(Uri uri, BluetoothOppSendFileInfo sendFileInfo) {
        if (D) Log.d(TAG, "putSendFileInfo: uri=" + uri + " sendFileInfo=" + sendFileInfo);
        if (sendFileInfo == BluetoothOppSendFileInfo.SEND_FILE_INFO_ERROR) {
            Log.e(TAG, "putSendFileInfo: bad sendFileInfo, URI: " + uri);
        }
        sSendFileMap.put(uri, sendFileInfo);
    }