Skip to content

[SMS App] Requesting original attachment file from remote

Summary

This patch adds support to send request o the remote device for original attachment file by sending PACKET_TYPE_SMS_REQUEST_ATTACHMENT packet.

The remote device responds to this request by sending the original file with a network packet of type PACKET_TYPE_SMS_ATTACHMENT_FILE.

The payload is downloaded in the SmsApp cache folder and later opened using the default app on the system for that type of file.

Woking in steps:

  • When a user doubles click on a thumbnail in the chat display UI, the app first searches the dedicated directory with the unique identifier of the file. If the file got found in the local directory, it just opens the file with default app and that is it.

  • In case the file is not present in the local directory a request packet PACKET_TYPE_SMS_REQUEST_ATTACHMENT is created and sent to the remote device.

  • In response, the remote device sends the packet of type PACKET_TYPE_SMS_ATTACHMENT_FILE with the payload and using FileTransferJob class it downloads the file in the dedicated directory and opens the file from there.

Testing

Edited by Aniket Kumar

Merge request reports

Loading