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

Commit 6afa5e6c authored by Roman Birg's avatar Roman Birg
Browse files

Bluetooth: handle opening incoming APK files



Ticket: FEIJ-493

Change-Id: I991146482ae69acf02ada93aa6c71441e67927d7
Signed-off-by: default avatarRoman Birg <roman@cyngn.com>
(cherry picked from commit 4e3379cb)
parent 3206b2d2
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -203,6 +203,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
@@ -211,7 +219,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()