summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoman Birg <roman@cyngn.com>2016-05-17 11:12:41 -0700
committerGerrit Code Review <gerrit@cyanogenmod.org>2016-05-19 09:11:16 -0700
commit4e3379cb9a0cc200710a7a87fe4d1e589738365c (patch)
treebf065c7295facacca76ace0ad6ea635808fbf27d
parent4502c2468a39ad919fdc9276a9095b8644e7622b (diff)
downloadandroid_packages_apps_Bluetooth-4e3379cb9a0cc200710a7a87fe4d1e589738365c.tar.gz
android_packages_apps_Bluetooth-4e3379cb9a0cc200710a7a87fe4d1e589738365c.tar.bz2
android_packages_apps_Bluetooth-4e3379cb9a0cc200710a7a87fe4d1e589738365c.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.java9
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()