diff options
author | Roman Birg <roman@cyngn.com> | 2016-05-17 11:12:41 -0700 |
---|---|---|
committer | Roman Birg <roman@cyngn.com> | 2016-05-19 09:11:23 -0700 |
commit | 6afa5e6ca1856e8965b32d63d636f6e385ec1d13 (patch) | |
tree | 3916f0c663df38bfb5b815795c720fc5dec00483 | |
parent | 3206b2d2ee6e958c0377855077a6d23b4c7fe21e (diff) | |
download | android_packages_apps_Bluetooth-6afa5e6ca1856e8965b32d63d636f6e385ec1d13.tar.gz android_packages_apps_Bluetooth-6afa5e6ca1856e8965b32d63d636f6e385ec1d13.tar.bz2 android_packages_apps_Bluetooth-6afa5e6ca1856e8965b32d63d636f6e385ec1d13.zip |
Bluetooth: handle opening incoming APK files
Ticket: FEIJ-493
Change-Id: I991146482ae69acf02ada93aa6c71441e67927d7
Signed-off-by: Roman Birg <roman@cyngn.com>
(cherry picked from commit 4e3379cb9a0cc200710a7a87fe4d1e589738365c)
-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() |