summaryrefslogtreecommitdiffstats
path: root/src/com/android/bluetooth/opp/BluetoothOppLauncherActivity.java
diff options
context:
space:
mode:
authorJack He <siyuanh@google.com>2017-03-13 10:37:06 -0700
committerMSe <mse1969@posteo.de>2017-06-09 10:26:05 +0200
commit7d99b2d1d73b0f9d501dc9c99e0139c65f3b2b8e (patch)
tree5e606e7aa843667db182efdb66431edc4089e2b0 /src/com/android/bluetooth/opp/BluetoothOppLauncherActivity.java
parent63909f33c742c49a0781a741d096372a8a13eb80 (diff)
downloadandroid_packages_apps_Bluetooth-7d99b2d1d73b0f9d501dc9c99e0139c65f3b2b8e.tar.gz
android_packages_apps_Bluetooth-7d99b2d1d73b0f9d501dc9c99e0139c65f3b2b8e.tar.bz2
android_packages_apps_Bluetooth-7d99b2d1d73b0f9d501dc9c99e0139c65f3b2b8e.zip
[BACKPORT] OPP: Restrict file based URI access to external storage
* Allow only external storage paths in file based URI in BluetoothOppSendFileInfo when the file send request comes from an external source * Fix a potential NPE when using Uri.getPath() Bug: 35310991 Test: Make, test various cases of Bluetooth file share AOSP-Change-Id: I8ff00d63d3c880667302f8d7ff8eaa0c0b533921 (cherry picked from commit 3edd7f0a8aadf2f44bc62ea5b567c74d39a534c8) (cherry picked from commit 3ce229fa602f739d1e98e2a85a3bd955c3a308f6) CVE-2017-0639 Change-Id: I8e90c92ae7be6819528e35638bf033f4826af16d
Diffstat (limited to 'src/com/android/bluetooth/opp/BluetoothOppLauncherActivity.java')
-rw-r--r--src/com/android/bluetooth/opp/BluetoothOppLauncherActivity.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/com/android/bluetooth/opp/BluetoothOppLauncherActivity.java b/src/com/android/bluetooth/opp/BluetoothOppLauncherActivity.java
index 717597b06..2e395e1a4 100644
--- a/src/com/android/bluetooth/opp/BluetoothOppLauncherActivity.java
+++ b/src/com/android/bluetooth/opp/BluetoothOppLauncherActivity.java
@@ -111,7 +111,8 @@ public class BluetoothOppLauncherActivity extends Activity {
Thread t = new Thread(new Runnable() {
public void run() {
BluetoothOppManager.getInstance(BluetoothOppLauncherActivity.this)
- .saveSendingFileInfo(type,stream.toString(), false);
+ .saveSendingFileInfo(type,stream.toString(),
+ false /* isHandover */, true /* fromExternal */);
//Done getting file info..Launch device picker and finish this activity
launchDevicePicker();
finish();
@@ -127,7 +128,8 @@ public class BluetoothOppLauncherActivity extends Activity {
Thread t = new Thread(new Runnable() {
public void run() {
BluetoothOppManager.getInstance(BluetoothOppLauncherActivity.this)
- .saveSendingFileInfo(type,fileUri.toString(), false);
+ .saveSendingFileInfo(type,fileUri.toString(),
+ false /* isHandover */, false /* fromExternal */);
//Done getting file info..Launch device picker
//and finish this activity
launchDevicePicker();
@@ -155,7 +157,8 @@ public class BluetoothOppLauncherActivity extends Activity {
Thread t = new Thread(new Runnable() {
public void run() {
BluetoothOppManager.getInstance(BluetoothOppLauncherActivity.this)
- .saveSendingFileInfo(mimeType,uris, false);
+ .saveSendingFileInfo(mimeType,uris,
+ false /* isHandover */, true /* fromExternal */);
//Done getting file info..Launch device picker
//and finish this activity
launchDevicePicker();