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

Unverified Commit d219b0cb authored by Roman Birg's avatar Roman Birg Committed by Michael Bestas
Browse files

Bluetooth: handle opening incoming APK files



Ticket: FEIJ-493

Change-Id: I991146482ae69acf02ada93aa6c71441e67927d7
Signed-off-by: default avatarRoman Birg <roman@cyngn.com>
parent 146317a7
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -207,6 +207,14 @@ public class BluetoothOppUtility {
            return;
        }

        CustomIntent activityIntent = new CustomIntent(Intent.ACTION_VIEW);
        if ("application/vnd.android.package-archive".equals(mimetype)) {
            // PackageInstaller doesn't like content URIs, so open file
            activityIntent.setDataAndType(Uri.fromFile(f), mimetype);
            context.startActivity(activityIntent);
            return;
        }

        Uri path = FileProvider.getUriForFile(context,
                       "com.google.android.bluetooth.fileprovider", f);
        // If there is no scheme, then it must be a file
@@ -215,7 +223,6 @@ public class BluetoothOppUtility {
        }

        if (isRecognizedFileType(context, path, mimetype)) {
            CustomIntent activityIntent = new CustomIntent(Intent.ACTION_VIEW);
            activityIntent.setDataAndTypeAndNormalize(path, mimetype);

            List<ResolveInfo> resInfoList = context.getPackageManager()