diff options
author | Roman Birg <roman@cyngn.com> | 2016-05-17 11:12:41 -0700 |
---|---|---|
committer | Michael Bestas <mikeioannina@gmail.com> | 2016-12-30 16:48:59 +0200 |
commit | d219b0cb8990f82cb825087857459c671c05a85c (patch) | |
tree | cfd112e6f9b20fe141d34c9f6e227f5da8501af7 | |
parent | 146317a7e69dc64cdf9fe7901589805d102efc4a (diff) | |
download | android_packages_apps_Bluetooth-d219b0cb8990f82cb825087857459c671c05a85c.tar.gz android_packages_apps_Bluetooth-d219b0cb8990f82cb825087857459c671c05a85c.tar.bz2 android_packages_apps_Bluetooth-d219b0cb8990f82cb825087857459c671c05a85c.zip |
Bluetooth: handle opening incoming APK files
Ticket: FEIJ-493
Change-Id: I991146482ae69acf02ada93aa6c71441e67927d7
Signed-off-by: Roman Birg <roman@cyngn.com>
-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 c386349b9..15f4a8932 100644 --- a/src/com/android/bluetooth/opp/BluetoothOppUtility.java +++ b/src/com/android/bluetooth/opp/BluetoothOppUtility.java @@ -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() |