Loading AndroidManifest.xml +1 −0 Original line number Original line Diff line number Diff line Loading @@ -65,6 +65,7 @@ android:permission="com.android.permission.WHITELIST_BLUETOOTH_DEVICE"> android:permission="com.android.permission.WHITELIST_BLUETOOTH_DEVICE"> <intent-filter> <intent-filter> <action android:name="android.btopp.intent.action.WHITELIST_DEVICE" /> <action android:name="android.btopp.intent.action.WHITELIST_DEVICE" /> <action android:name="android.btopp.intent.action.STOP_HANDOVER_TRANSFER" /> </intent-filter> </intent-filter> </receiver> </receiver> <activity android:name=".opp.BluetoothOppLauncherActivity" <activity android:name=".opp.BluetoothOppLauncherActivity" Loading src/com/android/bluetooth/opp/BluetoothOppHandoverReceiver.java +9 −0 Original line number Original line Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.bluetooth.BluetoothDevice; import android.content.BroadcastReceiver; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Context; import android.content.Intent; import android.content.Intent; import android.net.Uri; import android.util.Log; import android.util.Log; public class BluetoothOppHandoverReceiver extends BroadcastReceiver { public class BluetoothOppHandoverReceiver extends BroadcastReceiver { Loading @@ -36,6 +37,14 @@ public class BluetoothOppHandoverReceiver extends BroadcastReceiver { if (D) Log.d(TAG, "Adding " + device + " to whitelist"); if (D) Log.d(TAG, "Adding " + device + " to whitelist"); if (device == null) return; if (device == null) return; BluetoothOppManager.getInstance(context).addToWhitelist(device.getAddress()); BluetoothOppManager.getInstance(context).addToWhitelist(device.getAddress()); } else if (action.equals(Constants.ACTION_STOP_HANDOVER)) { int id = intent.getIntExtra(Constants.EXTRA_BT_OPP_TRANSFER_ID, -1); if (id != -1) { Uri contentUri = Uri.parse(BluetoothShare.CONTENT_URI + "/" + id); if (D) Log.d(TAG, "Stopping handover transfer with Uri " + contentUri); context.getContentResolver().delete(contentUri, null, null); } } else { } else { if (D) Log.d(TAG, "Unknown action: " + action); if (D) Log.d(TAG, "Unknown action: " + action); } } Loading src/com/android/bluetooth/opp/Constants.java +3 −0 Original line number Original line Diff line number Diff line Loading @@ -71,6 +71,9 @@ public class Constants { /** the intent that whitelists a remote bluetooth device for auto-receive confirmation (NFC) */ /** the intent that whitelists a remote bluetooth device for auto-receive confirmation (NFC) */ public static final String ACTION_WHITELIST_DEVICE = "android.btopp.intent.action.WHITELIST_DEVICE"; public static final String ACTION_WHITELIST_DEVICE = "android.btopp.intent.action.WHITELIST_DEVICE"; /** the intent that can be sent by handover requesters to stop a BTOPP transfer */ public static final String ACTION_STOP_HANDOVER = "android.btopp.intent.action.STOP_HANDOVER_TRANSFER"; /** the intent extra to show all received files in the transfer history */ /** the intent extra to show all received files in the transfer history */ public static final String EXTRA_SHOW_ALL_FILES = "android.btopp.intent.extra.SHOW_ALL"; public static final String EXTRA_SHOW_ALL_FILES = "android.btopp.intent.extra.SHOW_ALL"; Loading Loading
AndroidManifest.xml +1 −0 Original line number Original line Diff line number Diff line Loading @@ -65,6 +65,7 @@ android:permission="com.android.permission.WHITELIST_BLUETOOTH_DEVICE"> android:permission="com.android.permission.WHITELIST_BLUETOOTH_DEVICE"> <intent-filter> <intent-filter> <action android:name="android.btopp.intent.action.WHITELIST_DEVICE" /> <action android:name="android.btopp.intent.action.WHITELIST_DEVICE" /> <action android:name="android.btopp.intent.action.STOP_HANDOVER_TRANSFER" /> </intent-filter> </intent-filter> </receiver> </receiver> <activity android:name=".opp.BluetoothOppLauncherActivity" <activity android:name=".opp.BluetoothOppLauncherActivity" Loading
src/com/android/bluetooth/opp/BluetoothOppHandoverReceiver.java +9 −0 Original line number Original line Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.bluetooth.BluetoothDevice; import android.content.BroadcastReceiver; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Context; import android.content.Intent; import android.content.Intent; import android.net.Uri; import android.util.Log; import android.util.Log; public class BluetoothOppHandoverReceiver extends BroadcastReceiver { public class BluetoothOppHandoverReceiver extends BroadcastReceiver { Loading @@ -36,6 +37,14 @@ public class BluetoothOppHandoverReceiver extends BroadcastReceiver { if (D) Log.d(TAG, "Adding " + device + " to whitelist"); if (D) Log.d(TAG, "Adding " + device + " to whitelist"); if (device == null) return; if (device == null) return; BluetoothOppManager.getInstance(context).addToWhitelist(device.getAddress()); BluetoothOppManager.getInstance(context).addToWhitelist(device.getAddress()); } else if (action.equals(Constants.ACTION_STOP_HANDOVER)) { int id = intent.getIntExtra(Constants.EXTRA_BT_OPP_TRANSFER_ID, -1); if (id != -1) { Uri contentUri = Uri.parse(BluetoothShare.CONTENT_URI + "/" + id); if (D) Log.d(TAG, "Stopping handover transfer with Uri " + contentUri); context.getContentResolver().delete(contentUri, null, null); } } else { } else { if (D) Log.d(TAG, "Unknown action: " + action); if (D) Log.d(TAG, "Unknown action: " + action); } } Loading
src/com/android/bluetooth/opp/Constants.java +3 −0 Original line number Original line Diff line number Diff line Loading @@ -71,6 +71,9 @@ public class Constants { /** the intent that whitelists a remote bluetooth device for auto-receive confirmation (NFC) */ /** the intent that whitelists a remote bluetooth device for auto-receive confirmation (NFC) */ public static final String ACTION_WHITELIST_DEVICE = "android.btopp.intent.action.WHITELIST_DEVICE"; public static final String ACTION_WHITELIST_DEVICE = "android.btopp.intent.action.WHITELIST_DEVICE"; /** the intent that can be sent by handover requesters to stop a BTOPP transfer */ public static final String ACTION_STOP_HANDOVER = "android.btopp.intent.action.STOP_HANDOVER_TRANSFER"; /** the intent extra to show all received files in the transfer history */ /** the intent extra to show all received files in the transfer history */ public static final String EXTRA_SHOW_ALL_FILES = "android.btopp.intent.extra.SHOW_ALL"; public static final String EXTRA_SHOW_ALL_FILES = "android.btopp.intent.extra.SHOW_ALL"; Loading