diff options
| author | 2019-02-07 14:41:33 -0800 | |
|---|---|---|
| committer | 2019-02-07 14:41:33 -0800 | |
| commit | 40bfe83cba03c6b6823ed1355032bd0ead0e428d (patch) | |
| tree | 44a1482fde846d66d6d77cd33cd62f93c452fb0e | |
| parent | 23f34cd61f5569927c746090a626e05f740cb2ae (diff) | |
| parent | cc1b53a4538c240ef0cc3b98f1ba766d514c1864 (diff) | |
Merge "Make RCS Message Store APIs ready to unhide" am: 90f86257f0 am: b4cd2e4135
am: cc1b53a453
Change-Id: Id5361ef12c45b3c957f404fbe58c160462430af7
45 files changed, 451 insertions, 348 deletions
diff --git a/telephony/java/android/telephony/ims/Rcs1To1Thread.java b/telephony/java/android/telephony/ims/Rcs1To1Thread.java index cc28ee0758c2..3255f8d0786d 100644 --- a/telephony/java/android/telephony/ims/Rcs1To1Thread.java +++ b/telephony/java/android/telephony/ims/Rcs1To1Thread.java @@ -23,7 +23,7 @@ import android.annotation.WorkerThread; * {@link RcsParticipant}s. Please see Section 5 (1-to-1 Messaging) - GSMA RCC.71 (RCS Universal * Profile Service Definition Document) * - * @hide - TODO(109759350) make this public + * @hide - TODO: make public */ public class Rcs1To1Thread extends RcsThread { private int mThreadId; diff --git a/telephony/java/android/telephony/ims/RcsEvent.java b/telephony/java/android/telephony/ims/RcsEvent.java index 744ac76a7828..ef359a124d47 100644 --- a/telephony/java/android/telephony/ims/RcsEvent.java +++ b/telephony/java/android/telephony/ims/RcsEvent.java @@ -16,14 +16,17 @@ package android.telephony.ims; import android.os.Parcel; -import android.os.Parcelable; /** * The base class for events that can happen on {@link RcsParticipant}s and {@link RcsThread}s. - * @hide - TODO(109759350) make this public + * + * @hide - TODO: make public */ -public abstract class RcsEvent implements Parcelable { - protected long mTimestamp; +public abstract class RcsEvent { + /** + * @hide + */ + protected final long mTimestamp; protected RcsEvent(long timestamp) { mTimestamp = timestamp; @@ -44,17 +47,17 @@ public abstract class RcsEvent implements Parcelable { */ abstract void persist() throws RcsMessageStoreException; + /** + * @hide + */ RcsEvent(Parcel in) { mTimestamp = in.readLong(); } - @Override + /** + * @hide + */ public void writeToParcel(Parcel dest, int flags) { dest.writeLong(mTimestamp); } - - @Override - public int describeContents() { - return 0; - } } diff --git a/telephony/java/android/telephony/ims/RcsEventQueryParameters.aidl b/telephony/java/android/telephony/ims/RcsEventQueryParams.aidl index 9a3600bbae90..f18c4dfd2dcd 100644 --- a/telephony/java/android/telephony/ims/RcsEventQueryParameters.aidl +++ b/telephony/java/android/telephony/ims/RcsEventQueryParams.aidl @@ -17,4 +17,4 @@ package android.telephony.ims; -parcelable RcsEventQueryParameters; +parcelable RcsEventQueryParams; diff --git a/telephony/java/android/telephony/ims/RcsEventQueryParameters.java b/telephony/java/android/telephony/ims/RcsEventQueryParams.java index 6aee56f56f45..5249becd476e 100644 --- a/telephony/java/android/telephony/ims/RcsEventQueryParameters.java +++ b/telephony/java/android/telephony/ims/RcsEventQueryParams.java @@ -35,29 +35,29 @@ import java.security.InvalidParameterException; /** * The parameters to pass into - * {@link RcsMessageStore#getRcsEvents(RcsEventQueryParameters)} in order to select a + * {@link RcsMessageStore#getRcsEvents(RcsEventQueryParams)} in order to select a * subset of {@link RcsEvent}s present in the message store. * - * @hide TODO - make the Builder and builder() public. The rest should stay internal only. + * @hide - TODO: make public */ -public class RcsEventQueryParameters implements Parcelable { +public final class RcsEventQueryParams implements Parcelable { /** * Flag to be used with {@link Builder#setEventType(int)} to make - * {@link RcsMessageStore#getRcsEvents(RcsEventQueryParameters)} return all types of + * {@link RcsMessageStore#getRcsEvents(RcsEventQueryParams)} return all types of * {@link RcsEvent}s */ public static final int ALL_EVENTS = -1; /** * Flag to be used with {@link Builder#setEventType(int)} to make - * {@link RcsMessageStore#getRcsEvents(RcsEventQueryParameters)} return sub-types of + * {@link RcsMessageStore#getRcsEvents(RcsEventQueryParams)} return sub-types of * {@link RcsGroupThreadEvent}s */ public static final int ALL_GROUP_THREAD_EVENTS = 0; /** * Flag to be used with {@link Builder#setEventType(int)} to make - * {@link RcsMessageStore#getRcsEvents(RcsEventQueryParameters)} return only + * {@link RcsMessageStore#getRcsEvents(RcsEventQueryParams)} return only * {@link RcsParticipantAliasChangedEvent}s */ public static final int PARTICIPANT_ALIAS_CHANGED_EVENT = @@ -65,7 +65,7 @@ public class RcsEventQueryParameters implements Parcelable { /** * Flag to be used with {@link Builder#setEventType(int)} to make - * {@link RcsMessageStore#getRcsEvents(RcsEventQueryParameters)} return only + * {@link RcsMessageStore#getRcsEvents(RcsEventQueryParams)} return only * {@link RcsGroupThreadParticipantJoinedEvent}s */ public static final int GROUP_THREAD_PARTICIPANT_JOINED_EVENT = @@ -73,7 +73,7 @@ public class RcsEventQueryParameters implements Parcelable { /** * Flag to be used with {@link Builder#setEventType(int)} to make - * {@link RcsMessageStore#getRcsEvents(RcsEventQueryParameters)} return only + * {@link RcsMessageStore#getRcsEvents(RcsEventQueryParams)} return only * {@link RcsGroupThreadParticipantLeftEvent}s */ public static final int GROUP_THREAD_PARTICIPANT_LEFT_EVENT = @@ -81,14 +81,14 @@ public class RcsEventQueryParameters implements Parcelable { /** * Flag to be used with {@link Builder#setEventType(int)} to make - * {@link RcsMessageStore#getRcsEvents(RcsEventQueryParameters)} return only + * {@link RcsMessageStore#getRcsEvents(RcsEventQueryParams)} return only * {@link RcsGroupThreadNameChangedEvent}s */ public static final int GROUP_THREAD_NAME_CHANGED_EVENT = NAME_CHANGED_EVENT_TYPE; /** * Flag to be used with {@link Builder#setEventType(int)} to make - * {@link RcsMessageStore#getRcsEvents(RcsEventQueryParameters)} return only + * {@link RcsMessageStore#getRcsEvents(RcsEventQueryParams)} return only * {@link RcsGroupThreadIconChangedEvent}s */ public static final int GROUP_THREAD_ICON_CHANGED_EVENT = ICON_CHANGED_EVENT_TYPE; @@ -134,7 +134,7 @@ public class RcsEventQueryParameters implements Parcelable { // The thread that the results are limited to private int mThreadId; - RcsEventQueryParameters(@EventType int eventType, int threadId, + RcsEventQueryParams(@EventType int eventType, int threadId, @SortingProperty int sortingProperty, boolean isAscending, int limit) { mEventType = eventType; mSortingProperty = sortingProperty; @@ -144,7 +144,7 @@ public class RcsEventQueryParameters implements Parcelable { } /** - * @return Returns the type of {@link RcsEvent}s that this {@link RcsEventQueryParameters} is + * @return Returns the type of {@link RcsEvent}s that this {@link RcsEventQueryParams} is * set to query for. */ public @EventType int getEventType() { @@ -152,7 +152,7 @@ public class RcsEventQueryParameters implements Parcelable { } /** - * @return Returns the type of {@link RcsEvent}s that this {@link RcsEventQueryParameters} is + * @return Returns the type of {@link RcsEvent}s that this {@link RcsEventQueryParams} is * set to query for. */ public int getLimit() { @@ -186,7 +186,7 @@ public class RcsEventQueryParameters implements Parcelable { } /** - * A helper class to build the {@link RcsEventQueryParameters}. + * A helper class to build the {@link RcsEventQueryParams}. */ public static class Builder { private @EventType int mEventType; @@ -196,8 +196,8 @@ public class RcsEventQueryParameters implements Parcelable { private int mThreadId; /** - * Creates a new builder for {@link RcsEventQueryParameters} to be used in - * {@link RcsMessageStore#getRcsEvents(RcsEventQueryParameters)} + * Creates a new builder for {@link RcsEventQueryParams} to be used in + * {@link RcsMessageStore#getRcsEvents(RcsEventQueryParams)} */ public Builder() { // empty implementation @@ -236,7 +236,7 @@ public class RcsEventQueryParameters implements Parcelable { /** * Sets the property where the results should be sorted against. Defaults to - * {@link RcsEventQueryParameters.SortingProperty#SORT_BY_CREATION_ORDER} + * {@link RcsEventQueryParams.SortingProperty#SORT_BY_CREATION_ORDER} * * @param sortingProperty against which property the results should be sorted * @return The same instance of the builder to chain parameters. @@ -273,18 +273,18 @@ public class RcsEventQueryParameters implements Parcelable { } /** - * Builds the {@link RcsEventQueryParameters} to use in - * {@link RcsMessageStore#getRcsEvents(RcsEventQueryParameters)} + * Builds the {@link RcsEventQueryParams} to use in + * {@link RcsMessageStore#getRcsEvents(RcsEventQueryParams)} * - * @return An instance of {@link RcsEventQueryParameters} to use with the event query. + * @return An instance of {@link RcsEventQueryParams} to use with the event query. */ - public RcsEventQueryParameters build() { - return new RcsEventQueryParameters(mEventType, mThreadId, mSortingProperty, + public RcsEventQueryParams build() { + return new RcsEventQueryParams(mEventType, mThreadId, mSortingProperty, mIsAscending, mLimit); } } - protected RcsEventQueryParameters(Parcel in) { + private RcsEventQueryParams(Parcel in) { mEventType = in.readInt(); mThreadId = in.readInt(); mSortingProperty = in.readInt(); @@ -292,20 +292,19 @@ public class RcsEventQueryParameters implements Parcelable { mLimit = in.readInt(); } - public static final Creator<RcsEventQueryParameters> CREATOR = - new Creator<RcsEventQueryParameters>() { + public static final Creator<RcsEventQueryParams> CREATOR = + new Creator<RcsEventQueryParams>() { @Override - public RcsEventQueryParameters createFromParcel(Parcel in) { - return new RcsEventQueryParameters(in); + public RcsEventQueryParams createFromParcel(Parcel in) { + return new RcsEventQueryParams(in); } @Override - public RcsEventQueryParameters[] newArray(int size) { - return new RcsEventQueryParameters[size]; + public RcsEventQueryParams[] newArray(int size) { + return new RcsEventQueryParams[size]; } }; - @Override public int describeContents() { return 0; diff --git a/telephony/java/android/telephony/ims/RcsEventQueryResult.java b/telephony/java/android/telephony/ims/RcsEventQueryResult.java index 27898ab0d9a2..f8d57fa5c09d 100644 --- a/telephony/java/android/telephony/ims/RcsEventQueryResult.java +++ b/telephony/java/android/telephony/ims/RcsEventQueryResult.java @@ -22,13 +22,13 @@ import android.os.Parcelable; import java.util.List; /** - * The result of a {@link RcsMessageStore#getRcsEvents(RcsEventQueryParameters)} + * The result of a {@link RcsMessageStore#getRcsEvents(RcsEventQueryParams)} * call. This class allows getting the token for querying the next batch of events in order to * prevent handling large amounts of data at once. * - * @hide + * @hide - TODO: make public */ -public class RcsEventQueryResult implements Parcelable { +public final class RcsEventQueryResult implements Parcelable { private RcsQueryContinuationToken mContinuationToken; private List<RcsEvent> mEvents; @@ -63,7 +63,8 @@ public class RcsEventQueryResult implements Parcelable { return mEvents; } - protected RcsEventQueryResult(Parcel in) { + private RcsEventQueryResult(Parcel in) { + mContinuationToken = in.readParcelable(RcsQueryContinuationToken.class.getClassLoader()); } public static final Creator<RcsEventQueryResult> CREATOR = new Creator<RcsEventQueryResult>() { diff --git a/telephony/java/android/telephony/ims/RcsFileTransferCreationParameters.aidl b/telephony/java/android/telephony/ims/RcsFileTransferCreationParameters.aidl deleted file mode 100644 index 5fec021525af..000000000000 --- a/telephony/java/android/telephony/ims/RcsFileTransferCreationParameters.aidl +++ /dev/null @@ -1,20 +0,0 @@ -/* - * - * Copyright 2019, The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.telephony.ims; - -parcelable RcsFileTransferCreationParameters; diff --git a/telephony/java/android/telephony/ims/RcsParticipantQueryParameters.aidl b/telephony/java/android/telephony/ims/RcsFileTransferCreationParams.aidl index ea8288cd9f6a..155219038d7b 100644 --- a/telephony/java/android/telephony/ims/RcsParticipantQueryParameters.aidl +++ b/telephony/java/android/telephony/ims/RcsFileTransferCreationParams.aidl @@ -17,4 +17,4 @@ package android.telephony.ims; -parcelable RcsParticipantQueryParameters; +parcelable RcsFileTransferCreationParams; diff --git a/telephony/java/android/telephony/ims/RcsFileTransferCreationParameters.java b/telephony/java/android/telephony/ims/RcsFileTransferCreationParams.java index bd7cb4bc90bc..663def5df50f 100644 --- a/telephony/java/android/telephony/ims/RcsFileTransferCreationParameters.java +++ b/telephony/java/android/telephony/ims/RcsFileTransferCreationParams.java @@ -22,12 +22,12 @@ import android.os.Parcelable; /** * Pass an instance of this class to - * {@link RcsMessage#insertFileTransfer(RcsFileTransferCreationParameters)} create an + * {@link RcsMessage#insertFileTransfer(RcsFileTransferCreationParams)} create an * {@link RcsFileTransferPart} and save it into storage. * - * @hide - TODO(109759350) make this public + * @hide - TODO: make public */ -public class RcsFileTransferCreationParameters implements Parcelable { +public final class RcsFileTransferCreationParams implements Parcelable { private String mRcsFileTransferSessionId; private Uri mContentUri; private String mContentMimeType; @@ -128,7 +128,7 @@ public class RcsFileTransferCreationParameters implements Parcelable { /** * @hide */ - RcsFileTransferCreationParameters(Builder builder) { + RcsFileTransferCreationParams(Builder builder) { mRcsFileTransferSessionId = builder.mRcsFileTransferSessionId; mContentUri = builder.mContentUri; mContentMimeType = builder.mContentMimeType; @@ -143,7 +143,7 @@ public class RcsFileTransferCreationParameters implements Parcelable { } /** - * A builder to create instances of {@link RcsFileTransferCreationParameters} + * A builder to create instances of {@link RcsFileTransferCreationParams} */ public class Builder { private String mRcsFileTransferSessionId; @@ -300,18 +300,18 @@ public class RcsFileTransferCreationParameters implements Parcelable { } /** - * Creates an instance of {@link RcsFileTransferCreationParameters} with the given + * Creates an instance of {@link RcsFileTransferCreationParams} with the given * parameters. * * @return The same instance of {@link Builder} to chain methods - * @see RcsMessage#insertFileTransfer(RcsFileTransferCreationParameters) + * @see RcsMessage#insertFileTransfer(RcsFileTransferCreationParams) */ - public RcsFileTransferCreationParameters build() { - return new RcsFileTransferCreationParameters(this); + public RcsFileTransferCreationParams build() { + return new RcsFileTransferCreationParams(this); } } - protected RcsFileTransferCreationParameters(Parcel in) { + private RcsFileTransferCreationParams(Parcel in) { mRcsFileTransferSessionId = in.readString(); mContentUri = in.readParcelable(Uri.class.getClassLoader()); mContentMimeType = in.readString(); @@ -325,16 +325,16 @@ public class RcsFileTransferCreationParameters implements Parcelable { mFileTransferStatus = in.readInt(); } - public static final Creator<RcsFileTransferCreationParameters> CREATOR = - new Creator<RcsFileTransferCreationParameters>() { + public static final Creator<RcsFileTransferCreationParams> CREATOR = + new Creator<RcsFileTransferCreationParams>() { @Override - public RcsFileTransferCreationParameters createFromParcel(Parcel in) { - return new RcsFileTransferCreationParameters(in); + public RcsFileTransferCreationParams createFromParcel(Parcel in) { + return new RcsFileTransferCreationParams(in); } @Override - public RcsFileTransferCreationParameters[] newArray(int size) { - return new RcsFileTransferCreationParameters[size]; + public RcsFileTransferCreationParams[] newArray(int size) { + return new RcsFileTransferCreationParams[size]; } }; diff --git a/telephony/java/android/telephony/ims/RcsFileTransferPart.java b/telephony/java/android/telephony/ims/RcsFileTransferPart.java index 2eadc4a1724e..1ce799919e09 100644 --- a/telephony/java/android/telephony/ims/RcsFileTransferPart.java +++ b/telephony/java/android/telephony/ims/RcsFileTransferPart.java @@ -27,7 +27,7 @@ import java.lang.annotation.RetentionPolicy; * A part of a composite {@link RcsMessage} that holds a file transfer. Please see Section 7 * (File Transfer) - GSMA RCC.71 (RCS Universal Profile Service Definition Document) * - * @hide - TODO(109759350) make this public + * @hide - TODO: make public */ public class RcsFileTransferPart { /** diff --git a/telephony/java/android/telephony/ims/RcsGroupThread.java b/telephony/java/android/telephony/ims/RcsGroupThread.java index 6f6258e3d894..2c42494ee924 100644 --- a/telephony/java/android/telephony/ims/RcsGroupThread.java +++ b/telephony/java/android/telephony/ims/RcsGroupThread.java @@ -30,7 +30,7 @@ import java.util.Set; * or leave. Please see Section 6 (Group Chat) - GSMA RCC.71 (RCS Universal Profile Service * Definition Document) * - * @hide - TODO(sahinc) make this public + * @hide - TODO: make public */ public class RcsGroupThread extends RcsThread { /** @@ -166,8 +166,8 @@ public class RcsGroupThread extends RcsThread { @WorkerThread @NonNull public Set<RcsParticipant> getParticipants() throws RcsMessageStoreException { - RcsParticipantQueryParameters queryParameters = - new RcsParticipantQueryParameters.Builder().setThread(this).build(); + RcsParticipantQueryParams queryParameters = + new RcsParticipantQueryParams.Builder().setThread(this).build(); RcsParticipantQueryResult queryResult = RcsControllerCall.call( iRcs -> iRcs.getParticipants(queryParameters)); diff --git a/telephony/java/android/telephony/ims/RcsGroupThreadEvent.java b/telephony/java/android/telephony/ims/RcsGroupThreadEvent.java index a18437b8366e..bc61877a81d6 100644 --- a/telephony/java/android/telephony/ims/RcsGroupThreadEvent.java +++ b/telephony/java/android/telephony/ims/RcsGroupThreadEvent.java @@ -21,7 +21,7 @@ import android.os.Parcel; /** * An event that happened on an {@link RcsGroupThread}. * - * @hide - TODO(109759350) make this public + * @hide - TODO: make public */ public abstract class RcsGroupThreadEvent extends RcsEvent { private final int mRcsGroupThreadId; @@ -50,13 +50,18 @@ public abstract class RcsGroupThreadEvent extends RcsEvent { return new RcsParticipant(mOriginatingParticipantId); } + /** + * @hide + */ RcsGroupThreadEvent(Parcel in) { super(in); mRcsGroupThreadId = in.readInt(); mOriginatingParticipantId = in.readInt(); } - @Override + /** + * @hide + */ public void writeToParcel(Parcel dest, int flags) { super.writeToParcel(dest, flags); dest.writeInt(mRcsGroupThreadId); diff --git a/telephony/java/android/telephony/ims/RcsGroupThreadIconChangedEvent.java b/telephony/java/android/telephony/ims/RcsGroupThreadIconChangedEvent.java index 7beed3ba7ec2..74af9738e976 100644 --- a/telephony/java/android/telephony/ims/RcsGroupThreadIconChangedEvent.java +++ b/telephony/java/android/telephony/ims/RcsGroupThreadIconChangedEvent.java @@ -19,14 +19,16 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.net.Uri; import android.os.Parcel; +import android.os.Parcelable; /** * An event that indicates an {@link RcsGroupThread}'s icon was changed. Please see R6-2-5 - GSMA * RCC.71 (RCS Universal Profile Service Definition Document) * - * @hide - TODO(109759350) make this public + * @hide - TODO: make public */ -public class RcsGroupThreadIconChangedEvent extends RcsGroupThreadEvent { +public final class RcsGroupThreadIconChangedEvent extends RcsGroupThreadEvent implements + Parcelable { private final Uri mNewIcon; /** @@ -91,7 +93,7 @@ public class RcsGroupThreadIconChangedEvent extends RcsGroupThreadEvent { } }; - protected RcsGroupThreadIconChangedEvent(Parcel in) { + private RcsGroupThreadIconChangedEvent(Parcel in) { super(in); mNewIcon = in.readParcelable(Uri.class.getClassLoader()); } diff --git a/telephony/java/android/telephony/ims/RcsGroupThreadNameChangedEvent.java b/telephony/java/android/telephony/ims/RcsGroupThreadNameChangedEvent.java index 0d2ea4febfbc..06f4d5b10bb4 100644 --- a/telephony/java/android/telephony/ims/RcsGroupThreadNameChangedEvent.java +++ b/telephony/java/android/telephony/ims/RcsGroupThreadNameChangedEvent.java @@ -18,15 +18,17 @@ package android.telephony.ims; import android.annotation.NonNull; import android.annotation.Nullable; import android.os.Parcel; +import android.os.Parcelable; /** * An event that indicates an {@link RcsGroupThread}'s name was changed. Please see R6-2-5 - GSMA * RCC.71 (RCS Universal Profile Service Definition Document) * - * @hide - TODO(109759350) make this public + * @hide - TODO: make public */ -public class RcsGroupThreadNameChangedEvent extends RcsGroupThreadEvent { - private String mNewName; +public final class RcsGroupThreadNameChangedEvent extends RcsGroupThreadEvent implements + Parcelable { + private final String mNewName; /** * Creates a new {@link RcsGroupThreadNameChangedEvent}. This event is not persisted into @@ -89,7 +91,7 @@ public class RcsGroupThreadNameChangedEvent extends RcsGroupThreadEvent { } }; - protected RcsGroupThreadNameChangedEvent(Parcel in) { + private RcsGroupThreadNameChangedEvent(Parcel in) { super(in); mNewName = in.readString(); } diff --git a/telephony/java/android/telephony/ims/RcsGroupThreadParticipantJoinedEvent.java b/telephony/java/android/telephony/ims/RcsGroupThreadParticipantJoinedEvent.java index 2adafc7e1bb1..493270795e01 100644 --- a/telephony/java/android/telephony/ims/RcsGroupThreadParticipantJoinedEvent.java +++ b/telephony/java/android/telephony/ims/RcsGroupThreadParticipantJoinedEvent.java @@ -17,15 +17,17 @@ package android.telephony.ims; import android.annotation.NonNull; import android.os.Parcel; +import android.os.Parcelable; /** * An event that indicates an RCS participant has joined an {@link RcsThread}. Please see US6-3 - * GSMA RCC.71 (RCS Universal Profile Service Definition Document) * - * @hide - TODO(109759350) make this public + * @hide - TODO: make public */ -public class RcsGroupThreadParticipantJoinedEvent extends RcsGroupThreadEvent { - private int mJoinedParticipantId; +public final class RcsGroupThreadParticipantJoinedEvent extends RcsGroupThreadEvent implements + Parcelable { + private final int mJoinedParticipantId; /** * Creates a new {@link RcsGroupThreadParticipantJoinedEvent}. This event is not persisted into @@ -89,7 +91,7 @@ public class RcsGroupThreadParticipantJoinedEvent extends RcsGroupThreadEvent { } }; - protected RcsGroupThreadParticipantJoinedEvent(Parcel in) { + private RcsGroupThreadParticipantJoinedEvent(Parcel in) { super(in); mJoinedParticipantId = in.readInt(); } diff --git a/telephony/java/android/telephony/ims/RcsGroupThreadParticipantLeftEvent.java b/telephony/java/android/telephony/ims/RcsGroupThreadParticipantLeftEvent.java index 87c1852964ee..970a046e1105 100644 --- a/telephony/java/android/telephony/ims/RcsGroupThreadParticipantLeftEvent.java +++ b/telephony/java/android/telephony/ims/RcsGroupThreadParticipantLeftEvent.java @@ -17,15 +17,17 @@ package android.telephony.ims; import android.annotation.NonNull; import android.os.Parcel; +import android.os.Parcelable; /** * An event that indicates an RCS participant has left an {@link RcsThread}. Please see US6-23 - * GSMA RCC.71 (RCS Universal Profile Service Definition Document) * - * @hide - TODO(109759350) make this public + * @hide - TODO: make public */ -public class RcsGroupThreadParticipantLeftEvent extends RcsGroupThreadEvent { - private int mLeavingParticipantId; +public final class RcsGroupThreadParticipantLeftEvent extends RcsGroupThreadEvent implements + Parcelable { + private final int mLeavingParticipantId; /** * Creates a new {@link RcsGroupThreadParticipantLeftEvent}. his event is not persisted into @@ -88,7 +90,7 @@ public class RcsGroupThreadParticipantLeftEvent extends RcsGroupThreadEvent { } }; - protected RcsGroupThreadParticipantLeftEvent(Parcel in) { + private RcsGroupThreadParticipantLeftEvent(Parcel in) { super(in); mLeavingParticipantId = in.readInt(); } diff --git a/telephony/java/android/telephony/ims/RcsIncomingMessage.java b/telephony/java/android/telephony/ims/RcsIncomingMessage.java index 2ea115bd675b..f3b7815c2453 100644 --- a/telephony/java/android/telephony/ims/RcsIncomingMessage.java +++ b/telephony/java/android/telephony/ims/RcsIncomingMessage.java @@ -20,7 +20,7 @@ import android.annotation.WorkerThread; /** * This is a single instance of a message received over RCS. * - * @hide - TODO(109759350) make this public + * @hide - TODO: make public */ public class RcsIncomingMessage extends RcsMessage { /** diff --git a/telephony/java/android/telephony/ims/RcsIncomingMessageCreationParameters.aidl b/telephony/java/android/telephony/ims/RcsIncomingMessageCreationParameters.aidl deleted file mode 100644 index 76073c22af0c..000000000000 --- a/telephony/java/android/telephony/ims/RcsIncomingMessageCreationParameters.aidl +++ /dev/null @@ -1,20 +0,0 @@ -/* - * - * Copyright 2019, The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.telephony.ims; - -parcelable RcsIncomingMessageCreationParameters; diff --git a/telephony/java/android/telephony/ims/RcsIncomingMessageCreationParams.aidl b/telephony/java/android/telephony/ims/RcsIncomingMessageCreationParams.aidl new file mode 100644 index 000000000000..1f1d4f68213a --- /dev/null +++ b/telephony/java/android/telephony/ims/RcsIncomingMessageCreationParams.aidl @@ -0,0 +1,20 @@ +/* + * + * Copyright 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.telephony.ims; + +parcelable RcsIncomingMessageCreationParams; diff --git a/telephony/java/android/telephony/ims/RcsIncomingMessageCreationParameters.java b/telephony/java/android/telephony/ims/RcsIncomingMessageCreationParams.java index acde8af0d295..64b2339905eb 100644 --- a/telephony/java/android/telephony/ims/RcsIncomingMessageCreationParameters.java +++ b/telephony/java/android/telephony/ims/RcsIncomingMessageCreationParams.java @@ -21,13 +21,13 @@ import android.os.Parcel; import android.os.Parcelable; /** - * {@link RcsIncomingMessageCreationParameters} is a collection of parameters that should be passed - * into {@link RcsThread#addIncomingMessage(RcsIncomingMessageCreationParameters)} to generate an + * {@link RcsIncomingMessageCreationParams} is a collection of parameters that should be passed + * into {@link RcsThread#addIncomingMessage(RcsIncomingMessageCreationParams)} to generate an * {@link RcsIncomingMessage} on that {@link RcsThread} * - * @hide TODO:make public + * @hide - TODO: make public */ -public class RcsIncomingMessageCreationParameters extends RcsMessageCreationParameters implements +public final class RcsIncomingMessageCreationParams extends RcsMessageCreationParams implements Parcelable { // The arrival timestamp for the RcsIncomingMessage to be created private final long mArrivalTimestamp; @@ -37,18 +37,18 @@ public class RcsIncomingMessageCreationParameters extends RcsMessageCreationPara private final int mSenderParticipantId; /** - * Builder to help create an {@link RcsIncomingMessageCreationParameters} + * Builder to help create an {@link RcsIncomingMessageCreationParams} * - * @see RcsThread#addIncomingMessage(RcsIncomingMessageCreationParameters) + * @see RcsThread#addIncomingMessage(RcsIncomingMessageCreationParams) */ - public static class Builder extends RcsMessageCreationParameters.Builder { + public static class Builder extends RcsMessageCreationParams.Builder { private RcsParticipant mSenderParticipant; private long mArrivalTimestamp; private long mSeenTimestamp; /** * Creates a {@link Builder} to create an instance of - * {@link RcsIncomingMessageCreationParameters} + * {@link RcsIncomingMessageCreationParams} * * @param originationTimestamp The timestamp of {@link RcsMessage} creation. The origination * timestamp value in milliseconds passed after midnight, @@ -103,22 +103,22 @@ public class RcsIncomingMessageCreationParameters extends RcsMessageCreationPara /** * Creates parameters for creating a new incoming message. - * @return A new instance of {@link RcsIncomingMessageCreationParameters} to create a new + * @return A new instance of {@link RcsIncomingMessageCreationParams} to create a new * {@link RcsIncomingMessage} */ - public RcsIncomingMessageCreationParameters build() { - return new RcsIncomingMessageCreationParameters(this); + public RcsIncomingMessageCreationParams build() { + return new RcsIncomingMessageCreationParams(this); } } - private RcsIncomingMessageCreationParameters(Builder builder) { + private RcsIncomingMessageCreationParams(Builder builder) { super(builder); mArrivalTimestamp = builder.mArrivalTimestamp; mSeenTimestamp = builder.mSeenTimestamp; mSenderParticipantId = builder.mSenderParticipant.getId(); } - protected RcsIncomingMessageCreationParameters(Parcel in) { + private RcsIncomingMessageCreationParams(Parcel in) { super(in); mArrivalTimestamp = in.readLong(); mSeenTimestamp = in.readLong(); @@ -152,16 +152,16 @@ public class RcsIncomingMessageCreationParameters extends RcsMessageCreationPara return mSenderParticipantId; } - public static final Creator<RcsIncomingMessageCreationParameters> CREATOR = - new Creator<RcsIncomingMessageCreationParameters>() { + public static final Creator<RcsIncomingMessageCreationParams> CREATOR = + new Creator<RcsIncomingMessageCreationParams>() { @Override - public RcsIncomingMessageCreationParameters createFromParcel(Parcel in) { - return new RcsIncomingMessageCreationParameters(in); + public RcsIncomingMessageCreationParams createFromParcel(Parcel in) { + return new RcsIncomingMessageCreationParams(in); } @Override - public RcsIncomingMessageCreationParameters[] newArray(int size) { - return new RcsIncomingMessageCreationParameters[size]; + public RcsIncomingMessageCreationParams[] newArray(int size) { + return new RcsIncomingMessageCreationParams[size]; } }; @@ -172,7 +172,7 @@ public class RcsIncomingMessageCreationParameters extends RcsMessageCreationPara @Override public void writeToParcel(Parcel dest, int flags) { - super.writeToParcel(dest, flags); + super.writeToParcel(dest); dest.writeLong(mArrivalTimestamp); dest.writeLong(mSeenTimestamp); dest.writeInt(mSenderParticipantId); diff --git a/telephony/java/android/telephony/ims/RcsManager.java b/telephony/java/android/telephony/ims/RcsManager.java index e84d4ed9e7be..90bd0446d6f3 100644 --- a/telephony/java/android/telephony/ims/RcsManager.java +++ b/telephony/java/android/telephony/ims/RcsManager.java @@ -20,11 +20,19 @@ import android.content.Context; /** * The manager class for RCS related utilities. - * @hide + * + * @hide - TODO: make public */ @SystemService(Context.TELEPHONY_RCS_SERVICE) public class RcsManager { + /** + * @hide + */ + public RcsManager() { + // empty constructor + } + private static final RcsMessageStore sRcsMessageStoreInstance = new RcsMessageStore(); /** diff --git a/telephony/java/android/telephony/ims/RcsMessage.java b/telephony/java/android/telephony/ims/RcsMessage.java index b70a9a7973f5..1700941b94ed 100644 --- a/telephony/java/android/telephony/ims/RcsMessage.java +++ b/telephony/java/android/telephony/ims/RcsMessage.java @@ -28,7 +28,7 @@ import java.util.Set; /** * This is a single instance of a message sent or received over RCS. * - * @hide - TODO(109759350) make this public + * @hide - TODO: make public */ public abstract class RcsMessage { /** @@ -83,7 +83,10 @@ public abstract class RcsMessage { */ public static final int SEEN = 9; - protected int mId; + /** + * @hide + */ + protected final int mId; @IntDef({ DRAFT, QUEUED, SENDING, SENT, RETRYING, FAILED, RECEIVED, SEEN @@ -277,7 +280,7 @@ public abstract class RcsMessage { @NonNull @WorkerThread public RcsFileTransferPart insertFileTransfer( - RcsFileTransferCreationParameters fileTransferCreationParameters) + RcsFileTransferCreationParams fileTransferCreationParameters) throws RcsMessageStoreException { return new RcsFileTransferPart(RcsControllerCall.call( iRcs -> iRcs.storeFileTransfer(mId, isIncoming(), fileTransferCreationParameters))); diff --git a/telephony/java/android/telephony/ims/RcsMessageCreationParameters.java b/telephony/java/android/telephony/ims/RcsMessageCreationParams.java index ff3f33ed2e1b..9ac4dcdf2d74 100644 --- a/telephony/java/android/telephony/ims/RcsMessageCreationParameters.java +++ b/telephony/java/android/telephony/ims/RcsMessageCreationParams.java @@ -21,18 +21,16 @@ import static android.telephony.ims.RcsMessage.LOCATION_NOT_SET; import android.annotation.CheckResult; import android.annotation.Nullable; import android.os.Parcel; -import android.os.Parcelable; -import android.telephony.SubscriptionInfo; /** * The collection of parameters to be passed into - * {@link RcsThread#addIncomingMessage(RcsIncomingMessageCreationParameters)} and - * {@link RcsThread#addOutgoingMessage(RcsMessageCreationParameters)} to create and persist + * {@link RcsThread#addIncomingMessage(RcsIncomingMessageCreationParams)} and + * {@link RcsThread#addOutgoingMessage(RcsOutgoingMessageCreationParams)} to create and persist * {@link RcsMessage}s on an {@link RcsThread} * - * @hide TODO - make public + * @hide - TODO: make public */ -public class RcsMessageCreationParameters implements Parcelable { +public class RcsMessageCreationParams { // The globally unique id of the RcsMessage to be created. private final String mRcsMessageGlobalId; @@ -110,7 +108,7 @@ public class RcsMessageCreationParameters implements Parcelable { /** * The base builder for creating {@link RcsMessage}s on {@link RcsThread}s. * - * @see RcsIncomingMessageCreationParameters + * @see RcsIncomingMessageCreationParams */ public static class Builder { private String mRcsMessageGlobalId; @@ -122,15 +120,7 @@ public class RcsMessageCreationParameters implements Parcelable { private double mLongitude = LOCATION_NOT_SET; /** - * Creates a new {@link Builder} to create an instance of - * {@link RcsMessageCreationParameters}. - * - * @param originationTimestamp The timestamp of {@link RcsMessage} creation. The origination - * timestamp value in milliseconds passed after midnight, - * January 1, 1970 UTC - * @param subscriptionId The subscription ID that was used to send or receive this - * {@link RcsMessage} - * @see SubscriptionInfo#getSubscriptionId() + * @hide */ public Builder(long originationTimestamp, int subscriptionId) { mOriginationTimestamp = originationTimestamp; @@ -207,14 +197,14 @@ public class RcsMessageCreationParameters implements Parcelable { } /** - * @hide + * @return Builds and returns a newly created {@link RcsMessageCreationParams} */ - public RcsMessageCreationParameters build() { - return new RcsMessageCreationParameters(this); + public RcsMessageCreationParams build() { + return new RcsMessageCreationParams(this); } } - protected RcsMessageCreationParameters(Builder builder) { + protected RcsMessageCreationParams(Builder builder) { mRcsMessageGlobalId = builder.mRcsMessageGlobalId; mSubId = builder.mSubId; mMessageStatus = builder.mMessageStatus; @@ -224,7 +214,10 @@ public class RcsMessageCreationParameters implements Parcelable { mLongitude = builder.mLongitude; } - protected RcsMessageCreationParameters(Parcel in) { + /** + * @hide + */ + RcsMessageCreationParams(Parcel in) { mRcsMessageGlobalId = in.readString(); mSubId = in.readInt(); mMessageStatus = in.readInt(); @@ -234,26 +227,10 @@ public class RcsMessageCreationParameters implements Parcelable { mLongitude = in.readDouble(); } - public static final Creator<RcsMessageCreationParameters> CREATOR = - new Creator<RcsMessageCreationParameters>() { - @Override - public RcsMessageCreationParameters createFromParcel(Parcel in) { - return new RcsMessageCreationParameters(in); - } - - @Override - public RcsMessageCreationParameters[] newArray(int size) { - return new RcsMessageCreationParameters[size]; - } - }; - - @Override - public int describeContents() { - return 0; - } - - @Override - public void writeToParcel(Parcel dest, int flags) { + /** + * @hide + */ + public void writeToParcel(Parcel dest) { dest.writeString(mRcsMessageGlobalId); dest.writeInt(mSubId); dest.writeInt(mMessageStatus); diff --git a/telephony/java/android/telephony/ims/RcsThreadQueryParameters.aidl b/telephony/java/android/telephony/ims/RcsMessageQueryParams.aidl index 52e73ce02407..e9cbd9cc4ebe 100644 --- a/telephony/java/android/telephony/ims/RcsThreadQueryParameters.aidl +++ b/telephony/java/android/telephony/ims/RcsMessageQueryParams.aidl @@ -17,4 +17,4 @@ package android.telephony.ims; -parcelable RcsThreadQueryParameters; +parcelable RcsMessageQueryParams; diff --git a/telephony/java/android/telephony/ims/RcsMessageQueryParameters.java b/telephony/java/android/telephony/ims/RcsMessageQueryParams.java index c964cf9af7c5..fae0d97cd722 100644 --- a/telephony/java/android/telephony/ims/RcsMessageQueryParameters.java +++ b/telephony/java/android/telephony/ims/RcsMessageQueryParams.java @@ -29,12 +29,12 @@ import java.security.InvalidParameterException; /** * The parameters to pass into - * {@link RcsMessageStore#getRcsMessages(RcsMessageQueryParameters)} in order to select a + * {@link RcsMessageStore#getRcsMessages(RcsMessageQueryParams)} in order to select a * subset of {@link RcsMessage}s present in the message store. * - * @hide TODO - make the Builder and builder() public. The rest should stay internal only. + * @hide - TODO: make public */ -public class RcsMessageQueryParameters implements Parcelable { +public final class RcsMessageQueryParams implements Parcelable { /** * @hide - not meant for public use */ @@ -60,28 +60,28 @@ public class RcsMessageQueryParameters implements Parcelable { /** * Bitmask flag to be used with {@link Builder#setMessageType(int)} to make - * {@link RcsMessageStore#getRcsMessages(RcsMessageQueryParameters)} return + * {@link RcsMessageStore#getRcsMessages(RcsMessageQueryParams)} return * {@link RcsIncomingMessage}s. */ public static final int MESSAGE_TYPE_INCOMING = 0x0001; /** * Bitmask flag to be used with {@link Builder#setMessageType(int)} to make - * {@link RcsMessageStore#getRcsMessages(RcsMessageQueryParameters)} return + * {@link RcsMessageStore#getRcsMessages(RcsMessageQueryParams)} return * {@link RcsOutgoingMessage}s. */ public static final int MESSAGE_TYPE_OUTGOING = 0x0002; /** * Bitmask flag to be used with {@link Builder#setFileTransferPresence(int)} to make - * {@link RcsMessageStore#getRcsMessages(RcsMessageQueryParameters)} return {@link RcsMessage}s + * {@link RcsMessageStore#getRcsMessages(RcsMessageQueryParams)} return {@link RcsMessage}s * that have an {@link RcsFileTransferPart} attached. */ public static final int MESSAGES_WITH_FILE_TRANSFERS = 0x0004; /** * Bitmask flag to be used with {@link Builder#setFileTransferPresence(int)} to make - * {@link RcsMessageStore#getRcsMessages(RcsMessageQueryParameters)} return {@link RcsMessage}s + * {@link RcsMessageStore#getRcsMessages(RcsMessageQueryParams)} return {@link RcsMessage}s * that don't have an {@link RcsFileTransferPart} attached. */ public static final int MESSAGES_WITHOUT_FILE_TRANSFERS = 0x0008; @@ -106,7 +106,7 @@ public class RcsMessageQueryParameters implements Parcelable { // The thread that the results should be limited to private int mThreadId; - RcsMessageQueryParameters(int messageType, int fileTransferPresence, String messageLike, + RcsMessageQueryParams(int messageType, int fileTransferPresence, String messageLike, int threadId, @SortingProperty int sortingProperty, boolean isAscending, int limit) { mMessageType = messageType; mFileTransferPresence = fileTransferPresence; @@ -118,7 +118,7 @@ public class RcsMessageQueryParameters implements Parcelable { } /** - * @return Returns the type of {@link RcsMessage}s that this {@link RcsMessageQueryParameters} + * @return Returns the type of {@link RcsMessage}s that this {@link RcsMessageQueryParams} * is set to query for. */ public int getMessageType() { @@ -177,7 +177,7 @@ public class RcsMessageQueryParameters implements Parcelable { } /** - * A helper class to build the {@link RcsMessageQueryParameters}. + * A helper class to build the {@link RcsMessageQueryParams}. */ public static class Builder { private @SortingProperty int mSortingProperty; @@ -189,8 +189,8 @@ public class RcsMessageQueryParameters implements Parcelable { private int mThreadId = THREAD_ID_NOT_SET; /** - * Creates a new builder for {@link RcsMessageQueryParameters} to be used in - * {@link RcsMessageStore#getRcsMessages(RcsMessageQueryParameters)} + * Creates a new builder for {@link RcsMessageQueryParams} to be used in + * {@link RcsMessageStore#getRcsMessages(RcsMessageQueryParams)} * */ public Builder() { @@ -221,8 +221,8 @@ public class RcsMessageQueryParameters implements Parcelable { * * @param messageType The type of message to be returned. * @return The same instance of the builder to chain parameters. - * @see RcsMessageQueryParameters#MESSAGE_TYPE_INCOMING - * @see RcsMessageQueryParameters#MESSAGE_TYPE_OUTGOING + * @see RcsMessageQueryParams#MESSAGE_TYPE_INCOMING + * @see RcsMessageQueryParams#MESSAGE_TYPE_OUTGOING */ @CheckResult public Builder setMessageType(int messageType) { @@ -235,8 +235,8 @@ public class RcsMessageQueryParameters implements Parcelable { * * @param fileTransferPresence Whether file transfers should be included in the result * @return The same instance of the builder to chain parameters. - * @see RcsMessageQueryParameters#MESSAGES_WITH_FILE_TRANSFERS - * @see RcsMessageQueryParameters#MESSAGES_WITHOUT_FILE_TRANSFERS + * @see RcsMessageQueryParams#MESSAGES_WITH_FILE_TRANSFERS + * @see RcsMessageQueryParams#MESSAGES_WITHOUT_FILE_TRANSFERS */ @CheckResult public Builder setFileTransferPresence(int fileTransferPresence) { @@ -264,7 +264,7 @@ public class RcsMessageQueryParameters implements Parcelable { /** * Sets the property where the results should be sorted against. Defaults to - * {@link RcsMessageQueryParameters.SortingProperty#SORT_BY_CREATION_ORDER} + * {@link RcsMessageQueryParams.SortingProperty#SORT_BY_CREATION_ORDER} * * @param sortingProperty against which property the results should be sorted * @return The same instance of the builder to chain parameters. @@ -305,14 +305,14 @@ public class RcsMessageQueryParameters implements Parcelable { } /** - * Builds the {@link RcsMessageQueryParameters} to use in - * {@link RcsMessageStore#getRcsMessages(RcsMessageQueryParameters)} + * Builds the {@link RcsMessageQueryParams} to use in + * {@link RcsMessageStore#getRcsMessages(RcsMessageQueryParams)} * - * @return An instance of {@link RcsMessageQueryParameters} to use with the message + * @return An instance of {@link RcsMessageQueryParams} to use with the message * query. */ - public RcsMessageQueryParameters build() { - return new RcsMessageQueryParameters(mMessageType, mFileTransferPresence, mMessageLike, + public RcsMessageQueryParams build() { + return new RcsMessageQueryParams(mMessageType, mFileTransferPresence, mMessageLike, mThreadId, mSortingProperty, mIsAscending, mLimit); } } @@ -320,7 +320,7 @@ public class RcsMessageQueryParameters implements Parcelable { /** * Parcelable boilerplate below. */ - protected RcsMessageQueryParameters(Parcel in) { + private RcsMessageQueryParams(Parcel in) { mMessageType = in.readInt(); mFileTransferPresence = in.readInt(); mMessageLike = in.readString(); @@ -330,16 +330,16 @@ public class RcsMessageQueryParameters implements Parcelable { mThreadId = in.readInt(); } - public static final Creator<RcsMessageQueryParameters> CREATOR = - new Creator<RcsMessageQueryParameters>() { + public static final Creator<RcsMessageQueryParams> CREATOR = + new Creator<RcsMessageQueryParams>() { @Override - public RcsMessageQueryParameters createFromParcel(Parcel in) { - return new RcsMessageQueryParameters(in); + public RcsMessageQueryParams createFromParcel(Parcel in) { + return new RcsMessageQueryParams(in); } @Override - public RcsMessageQueryParameters[] newArray(int size) { - return new RcsMessageQueryParameters[size]; + public RcsMessageQueryParams[] newArray(int size) { + return new RcsMessageQueryParams[size]; } }; diff --git a/telephony/java/android/telephony/ims/RcsMessageQueryResult.java b/telephony/java/android/telephony/ims/RcsMessageQueryResult.java index c3846fdebf2e..5adab760d594 100644 --- a/telephony/java/android/telephony/ims/RcsMessageQueryResult.java +++ b/telephony/java/android/telephony/ims/RcsMessageQueryResult.java @@ -29,13 +29,13 @@ import java.util.ArrayList; import java.util.List; /** - * The result of a {@link RcsMessageStore#getRcsMessages(RcsMessageQueryParameters)} + * The result of a {@link RcsMessageStore#getRcsMessages(RcsMessageQueryParams)} * call. This class allows getting the token for querying the next batch of messages in order to * prevent handling large amounts of data at once. * - * @hide + * @hide - TODO: make public */ -public class RcsMessageQueryResult implements Parcelable { +public final class RcsMessageQueryResult implements Parcelable { // The token to continue the query to get the next batch of results private RcsQueryContinuationToken mContinuationToken; // The message type and message ID pairs for all the messages in this query result @@ -83,7 +83,7 @@ public class RcsMessageQueryResult implements Parcelable { return messages; } - protected RcsMessageQueryResult(Parcel in) { + private RcsMessageQueryResult(Parcel in) { mContinuationToken = in.readParcelable( RcsQueryContinuationToken.class.getClassLoader()); in.readTypedList(mMessageTypeIdPairs, RcsTypeIdPair.CREATOR); diff --git a/telephony/java/android/telephony/ims/RcsMessageSnippet.java b/telephony/java/android/telephony/ims/RcsMessageSnippet.java index 9399c2003827..565bb99de89a 100644 --- a/telephony/java/android/telephony/ims/RcsMessageSnippet.java +++ b/telephony/java/android/telephony/ims/RcsMessageSnippet.java @@ -24,9 +24,9 @@ import android.telephony.ims.RcsMessage.RcsMessageStatus; /** * An immutable summary of the latest {@link RcsMessage} on an {@link RcsThread} * - * @hide TODO: make public + * @hide - TODO: make public */ -public class RcsMessageSnippet implements Parcelable { +public final class RcsMessageSnippet implements Parcelable { private final String mText; private final @RcsMessageStatus int mStatus; private final long mTimestamp; @@ -65,7 +65,7 @@ public class RcsMessageSnippet implements Parcelable { return mTimestamp; } - protected RcsMessageSnippet(Parcel in) { + private RcsMessageSnippet(Parcel in) { mText = in.readString(); mStatus = in.readInt(); mTimestamp = in.readLong(); diff --git a/telephony/java/android/telephony/ims/RcsMessageStore.java b/telephony/java/android/telephony/ims/RcsMessageStore.java index c8c36a8e479b..eca5ed518521 100644 --- a/telephony/java/android/telephony/ims/RcsMessageStore.java +++ b/telephony/java/android/telephony/ims/RcsMessageStore.java @@ -27,7 +27,7 @@ import java.util.List; * RcsMessageStore is the application interface to RcsProvider and provides access methods to * RCS related database tables. * - * @hide - TODO make this public + * @hide - TODO: make public */ public class RcsMessageStore { /** @@ -39,7 +39,7 @@ public class RcsMessageStore { */ @WorkerThread @NonNull - public RcsThreadQueryResult getRcsThreads(@Nullable RcsThreadQueryParameters queryParameters) + public RcsThreadQueryResult getRcsThreads(@Nullable RcsThreadQueryParams queryParameters) throws RcsMessageStoreException { return RcsControllerCall.call(iRcs -> iRcs.getRcsThreads(queryParameters)); } @@ -68,7 +68,7 @@ public class RcsMessageStore { @WorkerThread @NonNull public RcsParticipantQueryResult getRcsParticipants( - @Nullable RcsParticipantQueryParameters queryParameters) + @Nullable RcsParticipantQueryParams queryParameters) throws RcsMessageStoreException { return RcsControllerCall.call(iRcs -> iRcs.getParticipants(queryParameters)); } @@ -99,7 +99,7 @@ public class RcsMessageStore { @WorkerThread @NonNull public RcsMessageQueryResult getRcsMessages( - @Nullable RcsMessageQueryParameters queryParameters) throws RcsMessageStoreException { + @Nullable RcsMessageQueryParams queryParameters) throws RcsMessageStoreException { return RcsControllerCall.call(iRcs -> iRcs.getMessages(queryParameters)); } @@ -127,7 +127,7 @@ public class RcsMessageStore { @WorkerThread @NonNull public RcsEventQueryResult getRcsEvents( - @Nullable RcsEventQueryParameters queryParameters) throws RcsMessageStoreException { + @Nullable RcsEventQueryParams queryParameters) throws RcsMessageStoreException { return RcsControllerCall.call(iRcs -> iRcs.getEvents(queryParameters)); } diff --git a/telephony/java/android/telephony/ims/RcsMessageStoreException.java b/telephony/java/android/telephony/ims/RcsMessageStoreException.java index e158f1a55aec..7c00749b1690 100644 --- a/telephony/java/android/telephony/ims/RcsMessageStoreException.java +++ b/telephony/java/android/telephony/ims/RcsMessageStoreException.java @@ -20,7 +20,7 @@ package android.telephony.ims; * An exception that happened on {@link RcsMessageStore} or one of the derived storage classes in * {@link android.telephony.ims} * - * @hide TODO: make public + * @hide - TODO: make public */ public class RcsMessageStoreException extends Exception { diff --git a/telephony/java/android/telephony/ims/RcsOutgoingMessage.java b/telephony/java/android/telephony/ims/RcsOutgoingMessage.java index 0bd55ec2d25a..dfcdee4a803d 100644 --- a/telephony/java/android/telephony/ims/RcsOutgoingMessage.java +++ b/telephony/java/android/telephony/ims/RcsOutgoingMessage.java @@ -24,7 +24,7 @@ import java.util.List; /** * This is a single instance of a message sent over RCS. * - * @hide - TODO(109759350) make this public + * @hide - TODO: make public */ public class RcsOutgoingMessage extends RcsMessage { RcsOutgoingMessage(int id) { diff --git a/telephony/java/android/telephony/ims/RcsOutgoingMessageCreationParams.aidl b/telephony/java/android/telephony/ims/RcsOutgoingMessageCreationParams.aidl new file mode 100644 index 000000000000..0c38d9f5766b --- /dev/null +++ b/telephony/java/android/telephony/ims/RcsOutgoingMessageCreationParams.aidl @@ -0,0 +1,20 @@ +/* + * + * Copyright 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.telephony.ims; + +parcelable RcsOutgoingMessageCreationParams; diff --git a/telephony/java/android/telephony/ims/RcsOutgoingMessageCreationParams.java b/telephony/java/android/telephony/ims/RcsOutgoingMessageCreationParams.java new file mode 100644 index 000000000000..ca466e8c9d3e --- /dev/null +++ b/telephony/java/android/telephony/ims/RcsOutgoingMessageCreationParams.java @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.telephony.ims; + +import android.os.Parcel; +import android.os.Parcelable; + +/** + * {@link RcsOutgoingMessageCreationParams} is a collection of parameters that should be passed + * into {@link RcsThread#addOutgoingMessage(RcsOutgoingMessageCreationParams)} to generate an + * {@link RcsOutgoingMessage} on that {@link RcsThread} + * + * @hide - TODO: make public + */ +public final class RcsOutgoingMessageCreationParams extends RcsMessageCreationParams + implements Parcelable { + /** + * A builder to instantiate and persist an {@link RcsOutgoingMessage} + */ + public static class Builder extends RcsMessageCreationParams.Builder { + + /** + * Creates a new {@link Builder} to create an instance of + * {@link RcsOutgoingMessageCreationParams}. + * + * @param originationTimestamp The timestamp of {@link RcsMessage} creation. The origination + * timestamp value in milliseconds passed after midnight, + * January 1, 1970 UTC + * @param subscriptionId The subscription ID that was used to send or receive this + * {@link RcsMessage} + * @see android.telephony.SubscriptionInfo#getSubscriptionId() + */ + public Builder(long originationTimestamp, int subscriptionId) { + super(originationTimestamp, subscriptionId); + } + + /** + * Creates configuration parameters for a new message. + */ + public RcsOutgoingMessageCreationParams build() { + return new RcsOutgoingMessageCreationParams(this); + } + } + + private RcsOutgoingMessageCreationParams(Builder builder) { + super(builder); + } + + private RcsOutgoingMessageCreationParams(Parcel in) { + super(in); + } + + public static final Creator<RcsOutgoingMessageCreationParams> CREATOR = + new Creator<RcsOutgoingMessageCreationParams>() { + @Override + public RcsOutgoingMessageCreationParams createFromParcel(Parcel in) { + return new RcsOutgoingMessageCreationParams(in); + } + + @Override + public RcsOutgoingMessageCreationParams[] newArray(int size) { + return new RcsOutgoingMessageCreationParams[size]; + } + }; + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + super.writeToParcel(dest); + } +} diff --git a/telephony/java/android/telephony/ims/RcsOutgoingMessageDelivery.java b/telephony/java/android/telephony/ims/RcsOutgoingMessageDelivery.java index b93f892df295..5a3062a69e3f 100644 --- a/telephony/java/android/telephony/ims/RcsOutgoingMessageDelivery.java +++ b/telephony/java/android/telephony/ims/RcsOutgoingMessageDelivery.java @@ -22,7 +22,7 @@ import android.annotation.WorkerThread; * This class holds the delivery information of an {@link RcsOutgoingMessage} for each * {@link RcsParticipant} that the message was intended for. * - * @hide - TODO(109759350) make this public + * @hide - TODO: make public */ public class RcsOutgoingMessageDelivery { // The participant that this delivery is intended for diff --git a/telephony/java/android/telephony/ims/RcsParticipant.java b/telephony/java/android/telephony/ims/RcsParticipant.java index ce0ad2c4749b..37b827b8e83c 100644 --- a/telephony/java/android/telephony/ims/RcsParticipant.java +++ b/telephony/java/android/telephony/ims/RcsParticipant.java @@ -21,7 +21,7 @@ import android.annotation.WorkerThread; /** * RcsParticipant is an RCS capable contact that can participate in {@link RcsThread}s. * - * @hide - TODO(109759350) make this public + * @hide - TODO: make public */ public class RcsParticipant { // The row ID of this participant in the database diff --git a/telephony/java/android/telephony/ims/RcsParticipantAliasChangedEvent.java b/telephony/java/android/telephony/ims/RcsParticipantAliasChangedEvent.java index 04cdf86df9c0..aa278b38cf81 100644 --- a/telephony/java/android/telephony/ims/RcsParticipantAliasChangedEvent.java +++ b/telephony/java/android/telephony/ims/RcsParticipantAliasChangedEvent.java @@ -18,18 +18,19 @@ package android.telephony.ims; import android.annotation.NonNull; import android.annotation.Nullable; import android.os.Parcel; +import android.os.Parcelable; /** * An event that indicates an {@link RcsParticipant}'s alias was changed. Please see US18-2 - GSMA * RCC.71 (RCS Universal Profile Service Definition Document) * - * @hide - TODO(109759350) make this public + * @hide - TODO: make public */ -public class RcsParticipantAliasChangedEvent extends RcsEvent { +public final class RcsParticipantAliasChangedEvent extends RcsEvent implements Parcelable { // The ID of the participant that changed their alias - private int mParticipantId; + private final int mParticipantId; // The new alias of the above participant - private String mNewAlias; + private final String mNewAlias; /** * Creates a new {@link RcsParticipantAliasChangedEvent}. This event is not persisted into @@ -98,7 +99,7 @@ public class RcsParticipantAliasChangedEvent extends RcsEvent { } }; - protected RcsParticipantAliasChangedEvent(Parcel in) { + private RcsParticipantAliasChangedEvent(Parcel in) { super(in); mNewAlias = in.readString(); mParticipantId = in.readInt(); diff --git a/telephony/java/android/telephony/ims/RcsMessageQueryParameters.aidl b/telephony/java/android/telephony/ims/RcsParticipantQueryParams.aidl index c325c23ba9bd..b7c0f93c8c5f 100644 --- a/telephony/java/android/telephony/ims/RcsMessageQueryParameters.aidl +++ b/telephony/java/android/telephony/ims/RcsParticipantQueryParams.aidl @@ -17,4 +17,4 @@ package android.telephony.ims; -parcelable RcsMessageQueryParameters; +parcelable RcsParticipantQueryParams; diff --git a/telephony/java/android/telephony/ims/RcsParticipantQueryParameters.java b/telephony/java/android/telephony/ims/RcsParticipantQueryParams.java index 3611fc187fc4..57c67fa7aa03 100644 --- a/telephony/java/android/telephony/ims/RcsParticipantQueryParameters.java +++ b/telephony/java/android/telephony/ims/RcsParticipantQueryParams.java @@ -28,12 +28,12 @@ import java.security.InvalidParameterException; /** * The parameters to pass into - * {@link RcsMessageStore#getRcsParticipants(RcsParticipantQueryParameters)} in order to select a + * {@link RcsMessageStore#getRcsParticipants(RcsParticipantQueryParams)} in order to select a * subset of {@link RcsThread}s present in the message store. * - * @hide TODO - make the Builder and builder() public. The rest should stay internal only. + * @hide - TODO: make public */ -public class RcsParticipantQueryParameters implements Parcelable { +public final class RcsParticipantQueryParams implements Parcelable { /** * Flag to set with {@link Builder#setSortProperty(int)} to sort the results in the order of * creation time for faster query results @@ -75,7 +75,7 @@ public class RcsParticipantQueryParameters implements Parcelable { */ public static final String PARTICIPANT_QUERY_PARAMETERS_KEY = "participant_query_parameters"; - RcsParticipantQueryParameters(int rcsThreadId, String aliasLike, String canonicalAddressLike, + RcsParticipantQueryParams(int rcsThreadId, String aliasLike, String canonicalAddressLike, @SortingProperty int sortingProperty, boolean isAscending, int limit) { mThreadId = rcsThreadId; @@ -143,7 +143,7 @@ public class RcsParticipantQueryParameters implements Parcelable { } /** - * A helper class to build the {@link RcsParticipantQueryParameters}. + * A helper class to build the {@link RcsParticipantQueryParams}. */ public static class Builder { private String mAliasLike; @@ -154,8 +154,8 @@ public class RcsParticipantQueryParameters implements Parcelable { private int mThreadId; /** - * Creates a new builder for {@link RcsParticipantQueryParameters} to be used in - * {@link RcsMessageStore#getRcsParticipants(RcsParticipantQueryParameters)} + * Creates a new builder for {@link RcsParticipantQueryParams} to be used in + * {@link RcsMessageStore#getRcsParticipants(RcsParticipantQueryParams)} */ public Builder() { // empty implementation @@ -231,7 +231,7 @@ public class RcsParticipantQueryParameters implements Parcelable { /** * Sets the property where the results should be sorted against. Defaults to - * {@link RcsParticipantQueryParameters.SortingProperty#SORT_BY_CREATION_ORDER} + * {@link RcsParticipantQueryParams.SortingProperty#SORT_BY_CREATION_ORDER} * * @param sortingProperty against which property the results should be sorted * @return The same instance of the builder to chain parameters. @@ -255,14 +255,14 @@ public class RcsParticipantQueryParameters implements Parcelable { } /** - * Builds the {@link RcsParticipantQueryParameters} to use in - * {@link RcsMessageStore#getRcsParticipants(RcsParticipantQueryParameters)} + * Builds the {@link RcsParticipantQueryParams} to use in + * {@link RcsMessageStore#getRcsParticipants(RcsParticipantQueryParams)} * - * @return An instance of {@link RcsParticipantQueryParameters} to use with the participant + * @return An instance of {@link RcsParticipantQueryParams} to use with the participant * query. */ - public RcsParticipantQueryParameters build() { - return new RcsParticipantQueryParameters(mThreadId, mAliasLike, mCanonicalAddressLike, + public RcsParticipantQueryParams build() { + return new RcsParticipantQueryParams(mThreadId, mAliasLike, mCanonicalAddressLike, mSortingProperty, mIsAscending, mLimit); } } @@ -270,7 +270,7 @@ public class RcsParticipantQueryParameters implements Parcelable { /** * Parcelable boilerplate below. */ - protected RcsParticipantQueryParameters(Parcel in) { + private RcsParticipantQueryParams(Parcel in) { mAliasLike = in.readString(); mCanonicalAddressLike = in.readString(); mSortingProperty = in.readInt(); @@ -279,16 +279,16 @@ public class RcsParticipantQueryParameters implements Parcelable { mThreadId = in.readInt(); } - public static final Creator<RcsParticipantQueryParameters> CREATOR = - new Creator<RcsParticipantQueryParameters>() { + public static final Creator<RcsParticipantQueryParams> CREATOR = + new Creator<RcsParticipantQueryParams>() { @Override - public RcsParticipantQueryParameters createFromParcel(Parcel in) { - return new RcsParticipantQueryParameters(in); + public RcsParticipantQueryParams createFromParcel(Parcel in) { + return new RcsParticipantQueryParams(in); } @Override - public RcsParticipantQueryParameters[] newArray(int size) { - return new RcsParticipantQueryParameters[size]; + public RcsParticipantQueryParams[] newArray(int size) { + return new RcsParticipantQueryParams[size]; } }; diff --git a/telephony/java/android/telephony/ims/RcsParticipantQueryResult.java b/telephony/java/android/telephony/ims/RcsParticipantQueryResult.java index 2f4ab465a6cf..4eae39d1a2c6 100644 --- a/telephony/java/android/telephony/ims/RcsParticipantQueryResult.java +++ b/telephony/java/android/telephony/ims/RcsParticipantQueryResult.java @@ -25,13 +25,13 @@ import java.util.ArrayList; import java.util.List; /** - * The result of a {@link RcsMessageStore#getRcsParticipants(RcsParticipantQueryParameters)} + * The result of a {@link RcsMessageStore#getRcsParticipants(RcsParticipantQueryParams)} * call. This class allows getting the token for querying the next batch of participants in order to * prevent handling large amounts of data at once. * - * @hide + * @hide - TODO: make public */ -public class RcsParticipantQueryResult implements Parcelable { +public final class RcsParticipantQueryResult implements Parcelable { // A token for the caller to continue their query for the next batch of results private RcsQueryContinuationToken mContinuationToken; // The list of participant IDs returned with this query @@ -75,7 +75,7 @@ public class RcsParticipantQueryResult implements Parcelable { return participantList; } - protected RcsParticipantQueryResult(Parcel in) { + private RcsParticipantQueryResult(Parcel in) { mContinuationToken = in.readParcelable( RcsQueryContinuationToken.class.getClassLoader()); } diff --git a/telephony/java/android/telephony/ims/RcsQueryContinuationToken.java b/telephony/java/android/telephony/ims/RcsQueryContinuationToken.java index e880651d6cdb..c1ff39652397 100644 --- a/telephony/java/android/telephony/ims/RcsQueryContinuationToken.java +++ b/telephony/java/android/telephony/ims/RcsQueryContinuationToken.java @@ -24,11 +24,17 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** - * This interface allows using the same implementation for continuation token usage in - * {@link com.android.providers.telephony.RcsProvider} - * @hide - TODO make getQueryType() and types public - the rest should stay internal + * A token for enabling continuation queries. Instances are acquired through + * {@code getContinuationToken} on result objects after initial query is done. + * + * @see RcsEventQueryResult#getContinuationToken() + * @see RcsMessageQueryResult#getContinuationToken() + * @see RcsParticipantQueryResult#getContinuationToken() + * @see RcsThreadQueryResult#getContinuationToken() + * + * @hide - TODO: make public */ -public class RcsQueryContinuationToken implements Parcelable { +public final class RcsQueryContinuationToken implements Parcelable { /** * Denotes that this {@link RcsQueryContinuationToken} token is meant to allow continuing * {@link RcsEvent} queries @@ -116,7 +122,7 @@ public class RcsQueryContinuationToken implements Parcelable { return mQueryType; } - protected RcsQueryContinuationToken(Parcel in) { + private RcsQueryContinuationToken(Parcel in) { mQueryType = in.readInt(); mRawQuery = in.readString(); mLimit = in.readInt(); diff --git a/telephony/java/android/telephony/ims/RcsThread.java b/telephony/java/android/telephony/ims/RcsThread.java index 238f5e7ce625..88655865f47b 100644 --- a/telephony/java/android/telephony/ims/RcsThread.java +++ b/telephony/java/android/telephony/ims/RcsThread.java @@ -28,10 +28,13 @@ import com.android.internal.annotations.VisibleForTesting; * RcsThread represents a single RCS conversation thread. It holds messages that were sent and * received and events that occurred on that thread. * - * @hide - TODO(109759350) make this public + * @hide - TODO: make public */ public abstract class RcsThread { - // The rcs_participant_thread_id that represents this thread in the database + /** + * The rcs_participant_thread_id that represents this thread in the database + * @hide + */ protected int mThreadId; /** @@ -59,10 +62,10 @@ public abstract class RcsThread { @WorkerThread @NonNull public RcsIncomingMessage addIncomingMessage( - @NonNull RcsIncomingMessageCreationParameters rcsIncomingMessageCreationParameters) + @NonNull RcsIncomingMessageCreationParams rcsIncomingMessageCreationParams) throws RcsMessageStoreException { return new RcsIncomingMessage(RcsControllerCall.call(iRcs -> iRcs.addIncomingMessage( - mThreadId, rcsIncomingMessageCreationParameters))); + mThreadId, rcsIncomingMessageCreationParams))); } /** @@ -73,10 +76,10 @@ public abstract class RcsThread { @WorkerThread @NonNull public RcsOutgoingMessage addOutgoingMessage( - @NonNull RcsMessageCreationParameters rcsMessageCreationParameters) + @NonNull RcsOutgoingMessageCreationParams rcsOutgoingMessageCreationParams) throws RcsMessageStoreException { int messageId = RcsControllerCall.call(iRcs -> iRcs.addOutgoingMessage( - mThreadId, rcsMessageCreationParameters)); + mThreadId, rcsOutgoingMessageCreationParams)); return new RcsOutgoingMessage(messageId); } @@ -97,7 +100,7 @@ public abstract class RcsThread { /** * Convenience function for loading all the {@link RcsMessage}s in this {@link RcsThread}. For * a more detailed and paginated query, please use - * {@link RcsMessageStore#getRcsMessages(RcsMessageQueryParameters)} + * {@link RcsMessageStore#getRcsMessages(RcsMessageQueryParams)} * * @return Loads the {@link RcsMessage}s in this thread and returns them in an immutable list. * @throws RcsMessageStoreException if the messages could not be read from the storage @@ -105,8 +108,8 @@ public abstract class RcsThread { @WorkerThread @NonNull public RcsMessageQueryResult getMessages() throws RcsMessageStoreException { - RcsMessageQueryParameters queryParameters = - new RcsMessageQueryParameters.Builder().setThread(this).build(); + RcsMessageQueryParams queryParameters = + new RcsMessageQueryParams.Builder().setThread(this).build(); return RcsControllerCall.call(iRcs -> iRcs.getMessages(queryParameters)); } diff --git a/telephony/java/android/telephony/ims/RcsMessageCreationParameters.aidl b/telephony/java/android/telephony/ims/RcsThreadQueryParams.aidl index 5774d00ca934..3f351dc5efee 100644 --- a/telephony/java/android/telephony/ims/RcsMessageCreationParameters.aidl +++ b/telephony/java/android/telephony/ims/RcsThreadQueryParams.aidl @@ -17,4 +17,4 @@ package android.telephony.ims; -parcelable RcsMessageCreationParameters; +parcelable RcsThreadQueryParams; diff --git a/telephony/java/android/telephony/ims/RcsThreadQueryParameters.java b/telephony/java/android/telephony/ims/RcsThreadQueryParams.java index 4aa42073b8f8..ba32e320c95b 100644 --- a/telephony/java/android/telephony/ims/RcsThreadQueryParameters.java +++ b/telephony/java/android/telephony/ims/RcsThreadQueryParams.java @@ -33,22 +33,22 @@ import java.util.List; import java.util.Set; /** - * The parameters to pass into {@link RcsMessageStore#getRcsThreads(RcsThreadQueryParameters)} in + * The parameters to pass into {@link RcsMessageStore#getRcsThreads(RcsThreadQueryParams)} in * order to select a subset of {@link RcsThread}s present in the message store. * - * @hide TODO - make the Builder and builder() public. The rest should stay internal only. + * @hide - TODO: make public */ -public class RcsThreadQueryParameters implements Parcelable { +public final class RcsThreadQueryParams implements Parcelable { /** * Bitmask flag to be used with {@link Builder#setThreadType(int)} to make - * {@link RcsMessageStore#getRcsThreads(RcsThreadQueryParameters)} return + * {@link RcsMessageStore#getRcsThreads(RcsThreadQueryParams)} return * {@link RcsGroupThread}s. */ public static final int THREAD_TYPE_GROUP = 0x0001; /** * Bitmask flag to be used with {@link Builder#setThreadType(int)} to make - * {@link RcsMessageStore#getRcsThreads(RcsThreadQueryParameters)} return + * {@link RcsMessageStore#getRcsThreads(RcsThreadQueryParams)} return * {@link Rcs1To1Thread}s. */ public static final int THREAD_TYPE_1_TO_1 = 0x0002; @@ -86,7 +86,7 @@ public class RcsThreadQueryParameters implements Parcelable { */ public static final String THREAD_QUERY_PARAMETERS_KEY = "thread_query_parameters"; - RcsThreadQueryParameters(int threadType, Set<RcsParticipant> participants, + RcsThreadQueryParams(int threadType, Set<RcsParticipant> participants, int limit, int sortingProperty, boolean isAscending) { mThreadType = threadType; mRcsParticipantIds = convertParticipantSetToIdList(participants); @@ -148,7 +148,7 @@ public class RcsThreadQueryParameters implements Parcelable { } /** - * A helper class to build the {@link RcsThreadQueryParameters}. + * A helper class to build the {@link RcsThreadQueryParams}. */ public static class Builder { private int mThreadType; @@ -158,8 +158,8 @@ public class RcsThreadQueryParameters implements Parcelable { private boolean mIsAscending; /** - * Constructs a {@link RcsThreadQueryParameters.Builder} to help build an - * {@link RcsThreadQueryParameters} + * Constructs a {@link RcsThreadQueryParams.Builder} to help build an + * {@link RcsThreadQueryParams} */ public Builder() { mParticipants = new HashSet<>(); @@ -170,8 +170,8 @@ public class RcsThreadQueryParameters implements Parcelable { * * @param threadType Whether to limit the query result to group threads. * @return The same instance of the builder to chain parameters. - * @see RcsThreadQueryParameters#THREAD_TYPE_GROUP - * @see RcsThreadQueryParameters#THREAD_TYPE_1_TO_1 + * @see RcsThreadQueryParams#THREAD_TYPE_GROUP + * @see RcsThreadQueryParams#THREAD_TYPE_1_TO_1 */ @CheckResult public Builder setThreadType(int threadType) { @@ -253,13 +253,13 @@ public class RcsThreadQueryParameters implements Parcelable { } /** - * Builds the {@link RcsThreadQueryParameters} to use in - * {@link RcsMessageStore#getRcsThreads(RcsThreadQueryParameters)} + * Builds the {@link RcsThreadQueryParams} to use in + * {@link RcsMessageStore#getRcsThreads(RcsThreadQueryParams)} * - * @return An instance of {@link RcsThreadQueryParameters} to use with the thread query. + * @return An instance of {@link RcsThreadQueryParams} to use with the thread query. */ - public RcsThreadQueryParameters build() { - return new RcsThreadQueryParameters(mThreadType, mParticipants, mLimit, + public RcsThreadQueryParams build() { + return new RcsThreadQueryParams(mThreadType, mParticipants, mLimit, mSortingProperty, mIsAscending); } } @@ -267,7 +267,7 @@ public class RcsThreadQueryParameters implements Parcelable { /** * Parcelable boilerplate below. */ - protected RcsThreadQueryParameters(Parcel in) { + private RcsThreadQueryParams(Parcel in) { mThreadType = in.readInt(); mRcsParticipantIds = new ArrayList<>(); in.readList(mRcsParticipantIds, Integer.class.getClassLoader()); @@ -276,16 +276,16 @@ public class RcsThreadQueryParameters implements Parcelable { mIsAscending = in.readByte() == 1; } - public static final Creator<RcsThreadQueryParameters> CREATOR = - new Creator<RcsThreadQueryParameters>() { + public static final Creator<RcsThreadQueryParams> CREATOR = + new Creator<RcsThreadQueryParams>() { @Override - public RcsThreadQueryParameters createFromParcel(Parcel in) { - return new RcsThreadQueryParameters(in); + public RcsThreadQueryParams createFromParcel(Parcel in) { + return new RcsThreadQueryParams(in); } @Override - public RcsThreadQueryParameters[] newArray(int size) { - return new RcsThreadQueryParameters[size]; + public RcsThreadQueryParams[] newArray(int size) { + return new RcsThreadQueryParams[size]; } }; diff --git a/telephony/java/android/telephony/ims/RcsThreadQueryResult.java b/telephony/java/android/telephony/ims/RcsThreadQueryResult.java index 6515933fff0e..a91126b89cce 100644 --- a/telephony/java/android/telephony/ims/RcsThreadQueryResult.java +++ b/telephony/java/android/telephony/ims/RcsThreadQueryResult.java @@ -29,13 +29,13 @@ import java.util.ArrayList; import java.util.List; /** - * The result of a {@link RcsMessageStore#getRcsThreads(RcsThreadQueryParameters)} + * The result of a {@link RcsMessageStore#getRcsThreads(RcsThreadQueryParams)} * call. This class allows getting the token for querying the next batch of threads in order to * prevent handling large amounts of data at once. * - * @hide + * @hide - TODO: make public */ -public class RcsThreadQueryResult implements Parcelable { +public final class RcsThreadQueryResult implements Parcelable { // A token for the caller to continue their query for the next batch of results private RcsQueryContinuationToken mContinuationToken; // The list of thread IDs returned with this query @@ -84,7 +84,7 @@ public class RcsThreadQueryResult implements Parcelable { return rcsThreads; } - protected RcsThreadQueryResult(Parcel in) { + private RcsThreadQueryResult(Parcel in) { mContinuationToken = in.readParcelable( RcsQueryContinuationToken.class.getClassLoader()); mRcsThreadIds = new ArrayList<>(); diff --git a/telephony/java/android/telephony/ims/aidl/IRcs.aidl b/telephony/java/android/telephony/ims/aidl/IRcs.aidl index a399786dec54..2478f8cff6b7 100644 --- a/telephony/java/android/telephony/ims/aidl/IRcs.aidl +++ b/telephony/java/android/telephony/ims/aidl/IRcs.aidl @@ -17,18 +17,18 @@ package android.telephony.ims.aidl; import android.net.Uri; -import android.telephony.ims.RcsEventQueryParameters; +import android.telephony.ims.RcsEventQueryParams; import android.telephony.ims.RcsEventQueryResult; -import android.telephony.ims.RcsFileTransferCreationParameters; -import android.telephony.ims.RcsIncomingMessageCreationParameters; -import android.telephony.ims.RcsMessageCreationParameters; +import android.telephony.ims.RcsFileTransferCreationParams; +import android.telephony.ims.RcsIncomingMessageCreationParams; import android.telephony.ims.RcsMessageSnippet; -import android.telephony.ims.RcsMessageQueryParameters; +import android.telephony.ims.RcsMessageQueryParams; import android.telephony.ims.RcsMessageQueryResult; -import android.telephony.ims.RcsParticipantQueryParameters; +import android.telephony.ims.RcsOutgoingMessageCreationParams; +import android.telephony.ims.RcsParticipantQueryParams; import android.telephony.ims.RcsParticipantQueryResult; import android.telephony.ims.RcsQueryContinuationToken; -import android.telephony.ims.RcsThreadQueryParameters; +import android.telephony.ims.RcsThreadQueryParams; import android.telephony.ims.RcsThreadQueryResult; /** @@ -39,22 +39,22 @@ interface IRcs { ///////////////////////// // RcsMessageStore APIs ///////////////////////// - RcsThreadQueryResult getRcsThreads(in RcsThreadQueryParameters queryParameters); + RcsThreadQueryResult getRcsThreads(in RcsThreadQueryParams queryParams); RcsThreadQueryResult getRcsThreadsWithToken( in RcsQueryContinuationToken continuationToken); - RcsParticipantQueryResult getParticipants(in RcsParticipantQueryParameters queryParameters); + RcsParticipantQueryResult getParticipants(in RcsParticipantQueryParams queryParams); RcsParticipantQueryResult getParticipantsWithToken( in RcsQueryContinuationToken continuationToken); - RcsMessageQueryResult getMessages(in RcsMessageQueryParameters queryParameters); + RcsMessageQueryResult getMessages(in RcsMessageQueryParams queryParams); RcsMessageQueryResult getMessagesWithToken( in RcsQueryContinuationToken continuationToken); - RcsEventQueryResult getEvents(in RcsEventQueryParameters queryParameters); + RcsEventQueryResult getEvents(in RcsEventQueryParams queryParams); RcsEventQueryResult getEventsWithToken( in RcsQueryContinuationToken continuationToken); @@ -74,11 +74,11 @@ interface IRcs { // Creates a new RcsIncomingMessage on the given thread and returns its row ID int addIncomingMessage(int rcsThreadId, - in RcsIncomingMessageCreationParameters rcsIncomingMessageCreationParameters); + in RcsIncomingMessageCreationParams rcsIncomingMessageCreationParams); // Creates a new RcsOutgoingMessage on the given thread and returns its row ID int addOutgoingMessage(int rcsThreadId, - in RcsMessageCreationParameters rcsMessageCreationParameters); + in RcsOutgoingMessageCreationParams rcsOutgoingMessageCreationParams); // TODO: modify RcsProvider URI's to allow deleting a message without specifying its thread void deleteMessage(int rcsMessageId, boolean isIncoming, int rcsThreadId, boolean isGroup); @@ -203,7 +203,7 @@ interface IRcs { // Performs the initial write to storage and returns the row ID. int storeFileTransfer(int messageId, boolean isIncoming, - in RcsFileTransferCreationParameters fileTransferCreationParameters); + in RcsFileTransferCreationParams fileTransferCreationParams); void deleteFileTransfer(int partId); diff --git a/tests/RcsTests/src/com/android/tests/ims/RcsParticipantQueryParametersTest.java b/tests/RcsTests/src/com/android/tests/ims/RcsParticipantQueryParamsTest.java index b4bcb5d12e0d..6361a393187e 100644 --- a/tests/RcsTests/src/com/android/tests/ims/RcsParticipantQueryParametersTest.java +++ b/tests/RcsTests/src/com/android/tests/ims/RcsParticipantQueryParamsTest.java @@ -19,39 +19,39 @@ import static com.google.common.truth.Truth.assertThat; import android.os.Parcel; import android.support.test.runner.AndroidJUnit4; -import android.telephony.ims.RcsParticipantQueryParameters; +import android.telephony.ims.RcsParticipantQueryParams; import org.junit.Test; import org.junit.runner.RunWith; @RunWith(AndroidJUnit4.class) -public class RcsParticipantQueryParametersTest { +public class RcsParticipantQueryParamsTest { @Test public void testCanUnparcel() { - RcsParticipantQueryParameters rcsParticipantQueryParameters = - new RcsParticipantQueryParameters.Builder() + RcsParticipantQueryParams rcsParticipantQueryParams = + new RcsParticipantQueryParams.Builder() .setAliasLike("%alias_") .setCanonicalAddressLike("_canonical%") - .setSortProperty(RcsParticipantQueryParameters.SORT_BY_CANONICAL_ADDRESS) + .setSortProperty(RcsParticipantQueryParams.SORT_BY_CANONICAL_ADDRESS) .setSortDirection(true) .setResultLimit(432) .build(); Parcel parcel = Parcel.obtain(); - rcsParticipantQueryParameters.writeToParcel(parcel, - rcsParticipantQueryParameters.describeContents()); + rcsParticipantQueryParams.writeToParcel(parcel, + rcsParticipantQueryParams.describeContents()); parcel.setDataPosition(0); - rcsParticipantQueryParameters = RcsParticipantQueryParameters.CREATOR.createFromParcel( + rcsParticipantQueryParams = RcsParticipantQueryParams.CREATOR.createFromParcel( parcel); - assertThat(rcsParticipantQueryParameters.getAliasLike()).isEqualTo("%alias_"); - assertThat(rcsParticipantQueryParameters.getCanonicalAddressLike()).contains("_canonical%"); - assertThat(rcsParticipantQueryParameters.getLimit()).isEqualTo(432); - assertThat(rcsParticipantQueryParameters.getSortingProperty()).isEqualTo( - RcsParticipantQueryParameters.SORT_BY_CANONICAL_ADDRESS); - assertThat(rcsParticipantQueryParameters.getSortDirection()).isTrue(); + assertThat(rcsParticipantQueryParams.getAliasLike()).isEqualTo("%alias_"); + assertThat(rcsParticipantQueryParams.getCanonicalAddressLike()).contains("_canonical%"); + assertThat(rcsParticipantQueryParams.getLimit()).isEqualTo(432); + assertThat(rcsParticipantQueryParams.getSortingProperty()).isEqualTo( + RcsParticipantQueryParams.SORT_BY_CANONICAL_ADDRESS); + assertThat(rcsParticipantQueryParams.getSortDirection()).isTrue(); } } diff --git a/tests/RcsTests/src/com/android/tests/ims/RcsThreadQueryParametersTest.java b/tests/RcsTests/src/com/android/tests/ims/RcsThreadQueryParamsTest.java index 0a70eeccb0fa..beb4f8ad28e2 100644 --- a/tests/RcsTests/src/com/android/tests/ims/RcsThreadQueryParametersTest.java +++ b/tests/RcsTests/src/com/android/tests/ims/RcsThreadQueryParamsTest.java @@ -15,26 +15,26 @@ */ package com.android.tests.ims; -import static android.telephony.ims.RcsThreadQueryParameters.SORT_BY_TIMESTAMP; -import static android.telephony.ims.RcsThreadQueryParameters.THREAD_TYPE_GROUP; +import static android.telephony.ims.RcsThreadQueryParams.SORT_BY_TIMESTAMP; +import static android.telephony.ims.RcsThreadQueryParams.THREAD_TYPE_GROUP; import static com.google.common.truth.Truth.assertThat; import android.os.Parcel; import android.support.test.runner.AndroidJUnit4; import android.telephony.ims.RcsParticipant; -import android.telephony.ims.RcsThreadQueryParameters; +import android.telephony.ims.RcsThreadQueryParams; import org.junit.Test; import org.junit.runner.RunWith; @RunWith(AndroidJUnit4.class) -public class RcsThreadQueryParametersTest { +public class RcsThreadQueryParamsTest { @Test public void testCanUnparcel() { RcsParticipant rcsParticipant = new RcsParticipant(1); - RcsThreadQueryParameters rcsThreadQueryParameters = new RcsThreadQueryParameters.Builder() + RcsThreadQueryParams rcsThreadQueryParams = new RcsThreadQueryParams.Builder() .setThreadType(THREAD_TYPE_GROUP) .setParticipant(rcsParticipant) .setResultLimit(50) @@ -43,16 +43,16 @@ public class RcsThreadQueryParametersTest { .build(); Parcel parcel = Parcel.obtain(); - rcsThreadQueryParameters.writeToParcel(parcel, rcsThreadQueryParameters.describeContents()); + rcsThreadQueryParams.writeToParcel(parcel, rcsThreadQueryParams.describeContents()); parcel.setDataPosition(0); - rcsThreadQueryParameters = RcsThreadQueryParameters.CREATOR.createFromParcel(parcel); + rcsThreadQueryParams = RcsThreadQueryParams.CREATOR.createFromParcel(parcel); - assertThat(rcsThreadQueryParameters.getThreadType()).isEqualTo(THREAD_TYPE_GROUP); - assertThat(rcsThreadQueryParameters.getRcsParticipantsIds()) + assertThat(rcsThreadQueryParams.getThreadType()).isEqualTo(THREAD_TYPE_GROUP); + assertThat(rcsThreadQueryParams.getRcsParticipantsIds()) .contains(rcsParticipant.getId()); - assertThat(rcsThreadQueryParameters.getLimit()).isEqualTo(50); - assertThat(rcsThreadQueryParameters.getSortingProperty()).isEqualTo(SORT_BY_TIMESTAMP); - assertThat(rcsThreadQueryParameters.getSortDirection()).isTrue(); + assertThat(rcsThreadQueryParams.getLimit()).isEqualTo(50); + assertThat(rcsThreadQueryParams.getSortingProperty()).isEqualTo(SORT_BY_TIMESTAMP); + assertThat(rcsThreadQueryParams.getSortDirection()).isTrue(); } } |