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

Commit 1ffa841d authored by Tony.YS Liu's avatar Tony.YS Liu
Browse files

Take persistable permission for fp content Uri

Bug: 129086327
Test: Manual tested with GMSCore's cl/241082662 and confirmed
b/129086327 is fixed

Change-Id: Idfedce411eb6cff8a0afa200945cb2a00f3644ef
parent d96f4fa1
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ import android.bluetooth.BluetoothClass;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothProfile;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.PorterDuff;
@@ -148,6 +149,12 @@ public class BluetoothUtils {
                    : null;
            final Uri iconUri = uriString != null ? Uri.parse(uriString) : null;
            if (iconUri != null) {
                try {
                    context.getContentResolver().takePersistableUriPermission(iconUri,
                            Intent.FLAG_GRANT_READ_URI_PERMISSION);
                } catch (SecurityException e) {
                    Log.e(TAG, "Failed to take persistable permission for: " + iconUri);
                }
                try {
                    final Bitmap bitmap = MediaStore.Images.Media.getBitmap(
                            context.getContentResolver(), iconUri);