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

Commit f9e1128b authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Use RcsParticipantQueryResultParcelable"

parents 6a71c891 e8c7c38c
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -99,7 +99,7 @@ import android.telephony.ims.RcsMessageSnippet;
import android.telephony.ims.RcsMessageStore;
import android.telephony.ims.RcsOutgoingMessageCreationParams;
import android.telephony.ims.RcsParticipantQueryParams;
import android.telephony.ims.RcsParticipantQueryResult;
import android.telephony.ims.RcsParticipantQueryResultParcelable;
import android.telephony.ims.RcsQueryContinuationToken;
import android.telephony.ims.RcsThreadQueryParams;
import android.telephony.ims.RcsThreadQueryResultParcelable;
@@ -184,7 +184,7 @@ public class RcsMessageStoreController extends IRcs.Stub {
    }

    @Override
    public RcsParticipantQueryResult getParticipants(
    public RcsParticipantQueryResultParcelable getParticipants(
            RcsParticipantQueryParams queryParameters) throws RemoteException {
        Bundle bundle = new Bundle();
        bundle.putParcelable(PARTICIPANT_QUERY_PARAMETERS_KEY, queryParameters);
@@ -192,7 +192,7 @@ public class RcsMessageStoreController extends IRcs.Stub {
    }

    @Override
    public RcsParticipantQueryResult getParticipantsWithToken(
    public RcsParticipantQueryResultParcelable getParticipantsWithToken(
            RcsQueryContinuationToken continuationToken) throws RemoteException {
        Bundle bundle = new Bundle();
        bundle.putParcelable(QUERY_CONTINUATION_TOKEN, continuationToken);
+4 −20
Original line number Diff line number Diff line
@@ -24,37 +24,21 @@ import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.os.RemoteException;
import android.telephony.ims.RcsParticipant;
import android.telephony.ims.RcsParticipantQueryResult;
import android.telephony.ims.RcsParticipantQueryResultParcelable;
import android.telephony.ims.RcsQueryContinuationToken;

import java.util.ArrayList;
import java.util.List;

class RcsParticipantQueryHelper {
    static final Uri CANONICAL_ADDRESSES_URI = Uri.parse("content://mms-sms/canonical-addresses");
    private final ContentResolver mContentResolver;

    RcsParticipantQueryHelper(ContentResolver contentResolver) {
        mContentResolver = contentResolver;
    }

    RcsParticipant getParticipantFromId(int participantId) throws RemoteException {
        RcsParticipant participant = null;
        try (Cursor cursor = mContentResolver.query(
                Uri.withAppendedPath(RCS_PARTICIPANT_URI, Integer.toString(participantId)),
                new String[]{RCS_PARTICIPANT_ID_COLUMN}, null, null)) {
            if (cursor == null || !cursor.moveToNext()) {
                throw new RemoteException("Could not find participant with id: " + participantId);
            }

            participant = new RcsParticipant(
                    cursor.getInt(cursor.getColumnIndex(RCS_PARTICIPANT_ID_COLUMN)));
        }
        return participant;
    }

    RcsParticipantQueryResult performParticipantQuery(Bundle bundle) throws RemoteException {
    RcsParticipantQueryResultParcelable performParticipantQuery(Bundle bundle)
            throws RemoteException {
        RcsQueryContinuationToken continuationToken = null;
        List<Integer> participantList = new ArrayList<>();

@@ -74,7 +58,7 @@ class RcsParticipantQueryHelper {
            }
        }

        return new RcsParticipantQueryResult(continuationToken, participantList);
        return new RcsParticipantQueryResultParcelable(continuationToken, participantList);
    }

    static Uri getUriForParticipant(int participantId) {