Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c8dd0795 authored by Andrew Cheng's avatar Andrew Cheng
Browse files

mapclient: use symbolic constant for downloading attachments

In MapClient code, a boolean can be specified when downloading a message
from the Map Server to indicate whether attachments should be downloaded
as well. These booleans are currently directly coded throughout the
code; replace with a symbolic constant.

Bug: 323412264
Test: atest MapClientStateMachineTest
Flag: EXEMPT, mechanical refactor
Change-Id: I888df35444de96842184a0506749b63cb07bc9d5
parent a36df328
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -117,6 +117,9 @@ class MceStateMachine extends StateMachine {
    private static final boolean MESSAGE_SEEN = true;
    private static final boolean MESSAGE_NOT_SEEN = false;

    // Do we download attachments, e.g., if a MMS contains an image.
    private static final boolean DOWNLOAD_ATTACHMENTS = false;

    // Folder names as defined in Bluetooth.org MAP spec V10
    private static final String FOLDER_TELECOM = "telecom";
    private static final String FOLDER_MSG = "msg";
@@ -713,7 +716,9 @@ class MceStateMachine extends StateMachine {
                case MSG_INBOUND_MESSAGE:
                    mMasClient.makeRequest(
                            new RequestGetMessage(
                                    (String) message.obj, MasClient.CharsetType.UTF_8, false));
                                    (String) message.obj,
                                    MasClient.CharsetType.UTF_8,
                                    DOWNLOAD_ATTACHMENTS));
                    break;

                case MSG_NOTIFICATION:
@@ -894,7 +899,9 @@ class MceStateMachine extends StateMachine {
                    }
                    mMasClient.makeRequest(
                            new RequestGetMessage(
                                    event.getHandle(), MasClient.CharsetType.UTF_8, false));
                                    event.getHandle(),
                                    MasClient.CharsetType.UTF_8,
                                    DOWNLOAD_ATTACHMENTS));
                    break;
                case DELIVERY_FAILURE:
                    // fall through