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

Commit 09b64357 authored by Leland Miller's avatar Leland Miller Committed by android-build-merger
Browse files

Merge "Use RcsParticipantQueryResultParcelable"

am: f9e1128b

Change-Id: Ie594686448d90f20673fcb6f3cbe6ba281350f66
parents 606b316d f9e1128b
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -99,7 +99,7 @@ import android.telephony.ims.RcsMessageSnippet;
import android.telephony.ims.RcsMessageStore;
import android.telephony.ims.RcsMessageStore;
import android.telephony.ims.RcsOutgoingMessageCreationParams;
import android.telephony.ims.RcsOutgoingMessageCreationParams;
import android.telephony.ims.RcsParticipantQueryParams;
import android.telephony.ims.RcsParticipantQueryParams;
import android.telephony.ims.RcsParticipantQueryResult;
import android.telephony.ims.RcsParticipantQueryResultParcelable;
import android.telephony.ims.RcsQueryContinuationToken;
import android.telephony.ims.RcsQueryContinuationToken;
import android.telephony.ims.RcsThreadQueryParams;
import android.telephony.ims.RcsThreadQueryParams;
import android.telephony.ims.RcsThreadQueryResultParcelable;
import android.telephony.ims.RcsThreadQueryResultParcelable;
@@ -184,7 +184,7 @@ public class RcsMessageStoreController extends IRcs.Stub {
    }
    }


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


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


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


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


    RcsParticipantQueryHelper(ContentResolver contentResolver) {
    RcsParticipantQueryHelper(ContentResolver contentResolver) {
        mContentResolver = contentResolver;
        mContentResolver = contentResolver;
    }
    }


    RcsParticipant getParticipantFromId(int participantId) throws RemoteException {
    RcsParticipantQueryResultParcelable performParticipantQuery(Bundle bundle)
        RcsParticipant participant = null;
            throws RemoteException {
        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 {
        RcsQueryContinuationToken continuationToken = null;
        RcsQueryContinuationToken continuationToken = null;
        List<Integer> participantList = new ArrayList<>();
        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) {
    static Uri getUriForParticipant(int participantId) {