安卓禁用蓝牙文件传输
系统
android 8.1.0
修改代码
禁用蓝牙文件传输功能
UpdateThread类中,在其public void run()函数中,直接返回,不进下面的while循环。
packages目录下
diff --git a/apps/Bluetooth/src/com/android/bluetooth/opp/BluetoothOppService.java b/apps/Bluetooth/src/com/android/bluetooth/opp/BluetoothOppService.java
index 77f38943..55fef185 100644
--- a/apps/Bluetooth/src/com/android/bluetooth/opp/BluetoothOppService.java
+++ b/apps/Bluetooth/src/com/android/bluetooth/opp/BluetoothOppService.java
@@ -489,6 +489,13 @@ public class BluetoothOppService extends ProfileService implements IObexConnecti
public void run() {
Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
+ // disable bt share file
+ if (true) {
+ Log.d(TAG, "-------cta disable bt send file");
+ interrupt();
+ return;
+ }
+
boolean keepService = false;
while (!isInterrupted) {
synchronized (BluetoothOppService.this) {
@@ -637,6 +644,7 @@ public class BluetoothOppService extends ProfileService implements IObexConnecti
uri = null;
Log.e(TAG, "insertShare found null URI at cursor!");
}
+
BluetoothOppShareInfo info = new BluetoothOppShareInfo(
cursor.getInt(cursor.getColumnIndexOrThrow(BluetoothShare._ID)),
uri
作者:帅得不敢出门