diff options
-rw-r--r-- | src/com/android/bluetooth/opp/BluetoothOppUtility.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/com/android/bluetooth/opp/BluetoothOppUtility.java b/src/com/android/bluetooth/opp/BluetoothOppUtility.java index f3774a034..081d15b52 100644 --- a/src/com/android/bluetooth/opp/BluetoothOppUtility.java +++ b/src/com/android/bluetooth/opp/BluetoothOppUtility.java @@ -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() |