Merge "Split RCS events into API and internal classes"
This commit is contained in:
@@ -43604,12 +43604,9 @@ package android.telephony.ims {
|
|||||||
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @IntDef({android.telephony.ims.RcsEventQueryParams.SORT_BY_CREATION_ORDER, android.telephony.ims.RcsEventQueryParams.SORT_BY_TIMESTAMP}) public static @interface RcsEventQueryParams.SortingProperty {
|
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @IntDef({android.telephony.ims.RcsEventQueryParams.SORT_BY_CREATION_ORDER, android.telephony.ims.RcsEventQueryParams.SORT_BY_TIMESTAMP}) public static @interface RcsEventQueryParams.SortingProperty {
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class RcsEventQueryResult implements android.os.Parcelable {
|
public class RcsEventQueryResult {
|
||||||
method public int describeContents();
|
|
||||||
method public android.telephony.ims.RcsQueryContinuationToken getContinuationToken();
|
method public android.telephony.ims.RcsQueryContinuationToken getContinuationToken();
|
||||||
method public java.util.List<android.telephony.ims.RcsEvent> getEvents();
|
method public java.util.List<android.telephony.ims.RcsEvent> getEvents();
|
||||||
method public void writeToParcel(android.os.Parcel, int);
|
|
||||||
field public static final android.os.Parcelable.Creator<android.telephony.ims.RcsEventQueryResult> CREATOR;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class RcsFileTransferCreationParams implements android.os.Parcelable {
|
public final class RcsFileTransferCreationParams implements android.os.Parcelable {
|
||||||
@@ -43704,37 +43701,25 @@ package android.telephony.ims {
|
|||||||
method @NonNull public android.telephony.ims.RcsGroupThread getRcsGroupThread();
|
method @NonNull public android.telephony.ims.RcsGroupThread getRcsGroupThread();
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class RcsGroupThreadIconChangedEvent extends android.telephony.ims.RcsGroupThreadEvent implements android.os.Parcelable {
|
public final class RcsGroupThreadIconChangedEvent extends android.telephony.ims.RcsGroupThreadEvent {
|
||||||
ctor public RcsGroupThreadIconChangedEvent(long, @NonNull android.telephony.ims.RcsGroupThread, @NonNull android.telephony.ims.RcsParticipant, @Nullable android.net.Uri);
|
ctor public RcsGroupThreadIconChangedEvent(long, @NonNull android.telephony.ims.RcsGroupThread, @NonNull android.telephony.ims.RcsParticipant, @Nullable android.net.Uri);
|
||||||
method public int describeContents();
|
|
||||||
method @Nullable public android.net.Uri getNewIcon();
|
method @Nullable public android.net.Uri getNewIcon();
|
||||||
method public void writeToParcel(android.os.Parcel, int);
|
|
||||||
field public static final android.os.Parcelable.Creator<android.telephony.ims.RcsGroupThreadIconChangedEvent> CREATOR;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class RcsGroupThreadNameChangedEvent extends android.telephony.ims.RcsGroupThreadEvent implements android.os.Parcelable {
|
public final class RcsGroupThreadNameChangedEvent extends android.telephony.ims.RcsGroupThreadEvent {
|
||||||
ctor public RcsGroupThreadNameChangedEvent(long, @NonNull android.telephony.ims.RcsGroupThread, @NonNull android.telephony.ims.RcsParticipant, @Nullable String);
|
ctor public RcsGroupThreadNameChangedEvent(long, @NonNull android.telephony.ims.RcsGroupThread, @NonNull android.telephony.ims.RcsParticipant, @Nullable String);
|
||||||
method public int describeContents();
|
|
||||||
method @Nullable public String getNewName();
|
method @Nullable public String getNewName();
|
||||||
method public void writeToParcel(android.os.Parcel, int);
|
|
||||||
field public static final android.os.Parcelable.Creator<android.telephony.ims.RcsGroupThreadNameChangedEvent> CREATOR;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class RcsGroupThreadParticipantJoinedEvent extends android.telephony.ims.RcsGroupThreadEvent implements android.os.Parcelable {
|
public final class RcsGroupThreadParticipantJoinedEvent extends android.telephony.ims.RcsGroupThreadEvent {
|
||||||
ctor public RcsGroupThreadParticipantJoinedEvent(long, @NonNull android.telephony.ims.RcsGroupThread, @NonNull android.telephony.ims.RcsParticipant, @NonNull android.telephony.ims.RcsParticipant);
|
ctor public RcsGroupThreadParticipantJoinedEvent(long, @NonNull android.telephony.ims.RcsGroupThread, @NonNull android.telephony.ims.RcsParticipant, @NonNull android.telephony.ims.RcsParticipant);
|
||||||
method public int describeContents();
|
|
||||||
method public android.telephony.ims.RcsParticipant getJoinedParticipant();
|
method public android.telephony.ims.RcsParticipant getJoinedParticipant();
|
||||||
method public void writeToParcel(android.os.Parcel, int);
|
|
||||||
field public static final android.os.Parcelable.Creator<android.telephony.ims.RcsGroupThreadParticipantJoinedEvent> CREATOR;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class RcsGroupThreadParticipantLeftEvent extends android.telephony.ims.RcsGroupThreadEvent implements android.os.Parcelable {
|
public final class RcsGroupThreadParticipantLeftEvent extends android.telephony.ims.RcsGroupThreadEvent {
|
||||||
ctor public RcsGroupThreadParticipantLeftEvent(long, @NonNull android.telephony.ims.RcsGroupThread, @NonNull android.telephony.ims.RcsParticipant, @NonNull android.telephony.ims.RcsParticipant);
|
ctor public RcsGroupThreadParticipantLeftEvent(long, @NonNull android.telephony.ims.RcsGroupThread, @NonNull android.telephony.ims.RcsParticipant, @NonNull android.telephony.ims.RcsParticipant);
|
||||||
method public int describeContents();
|
method @NonNull public android.telephony.ims.RcsParticipant getLeavingParticipant();
|
||||||
method @NonNull public android.telephony.ims.RcsParticipant getLeavingParticipantId();
|
|
||||||
method public void persist() throws android.telephony.ims.RcsMessageStoreException;
|
method public void persist() throws android.telephony.ims.RcsMessageStoreException;
|
||||||
method public void writeToParcel(android.os.Parcel, int);
|
|
||||||
field public static final android.os.Parcelable.Creator<android.telephony.ims.RcsGroupThreadParticipantLeftEvent> CREATOR;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class RcsIncomingMessage extends android.telephony.ims.RcsMessage {
|
public class RcsIncomingMessage extends android.telephony.ims.RcsMessage {
|
||||||
@@ -43926,13 +43911,10 @@ package android.telephony.ims {
|
|||||||
method @WorkerThread public void setContactId(String) throws android.telephony.ims.RcsMessageStoreException;
|
method @WorkerThread public void setContactId(String) throws android.telephony.ims.RcsMessageStoreException;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class RcsParticipantAliasChangedEvent extends android.telephony.ims.RcsEvent implements android.os.Parcelable {
|
public final class RcsParticipantAliasChangedEvent extends android.telephony.ims.RcsEvent {
|
||||||
ctor public RcsParticipantAliasChangedEvent(long, @NonNull android.telephony.ims.RcsParticipant, @Nullable String);
|
ctor public RcsParticipantAliasChangedEvent(long, @NonNull android.telephony.ims.RcsParticipant, @Nullable String);
|
||||||
method public int describeContents();
|
|
||||||
method @Nullable public String getNewAlias();
|
method @Nullable public String getNewAlias();
|
||||||
method @NonNull public android.telephony.ims.RcsParticipant getParticipantId();
|
method @NonNull public android.telephony.ims.RcsParticipant getParticipant();
|
||||||
method public void writeToParcel(android.os.Parcel, int);
|
|
||||||
field public static final android.os.Parcelable.Creator<android.telephony.ims.RcsParticipantAliasChangedEvent> CREATOR;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class RcsParticipantQueryParams implements android.os.Parcelable {
|
public final class RcsParticipantQueryParams implements android.os.Parcelable {
|
||||||
|
|||||||
@@ -15,16 +15,11 @@
|
|||||||
*/
|
*/
|
||||||
package android.telephony.ims;
|
package android.telephony.ims;
|
||||||
|
|
||||||
import android.os.Parcel;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The base class for events that can happen on {@link RcsParticipant}s and {@link RcsThread}s.
|
* The base class for events that can happen on {@link RcsParticipant}s and {@link RcsThread}s.
|
||||||
*/
|
*/
|
||||||
public abstract class RcsEvent {
|
public abstract class RcsEvent {
|
||||||
/**
|
private final long mTimestamp;
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
protected final long mTimestamp;
|
|
||||||
|
|
||||||
protected RcsEvent(long timestamp) {
|
protected RcsEvent(long timestamp) {
|
||||||
mTimestamp = timestamp;
|
mTimestamp = timestamp;
|
||||||
@@ -44,18 +39,4 @@ public abstract class RcsEvent {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
abstract void persist() throws RcsMessageStoreException;
|
abstract void persist() throws RcsMessageStoreException;
|
||||||
|
|
||||||
/**
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
RcsEvent(Parcel in) {
|
|
||||||
mTimestamp = in.readLong();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
public void writeToParcel(Parcel dest, int flags) {
|
|
||||||
dest.writeLong(mTimestamp);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,4 +17,4 @@
|
|||||||
|
|
||||||
package android.telephony.ims;
|
package android.telephony.ims;
|
||||||
|
|
||||||
parcelable RcsEvent;
|
parcelable RcsEventDescriptor;
|
||||||
56
telephony/java/android/telephony/ims/RcsEventDescriptor.java
Normal file
56
telephony/java/android/telephony/ims/RcsEventDescriptor.java
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
/*
|
||||||
|
* 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 static com.android.internal.annotations.VisibleForTesting.Visibility.PROTECTED;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
import com.android.internal.annotations.VisibleForTesting;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @hide - used only for internal communication with the ircs service
|
||||||
|
*/
|
||||||
|
public abstract class RcsEventDescriptor implements Parcelable {
|
||||||
|
protected final long mTimestamp;
|
||||||
|
|
||||||
|
RcsEventDescriptor(long timestamp) {
|
||||||
|
mTimestamp = timestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an RcsEvent based on this RcsEventDescriptor. Overriding this method practically
|
||||||
|
* allows an injection point for RcsEvent dependencies outside of the values contained in the
|
||||||
|
* descriptor.
|
||||||
|
*/
|
||||||
|
@VisibleForTesting(visibility = PROTECTED)
|
||||||
|
public abstract RcsEvent createRcsEvent();
|
||||||
|
|
||||||
|
RcsEventDescriptor(Parcel in) {
|
||||||
|
mTimestamp = in.readLong();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeLong(mTimestamp);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int describeContents() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,9 +16,6 @@
|
|||||||
|
|
||||||
package android.telephony.ims;
|
package android.telephony.ims;
|
||||||
|
|
||||||
import android.os.Parcel;
|
|
||||||
import android.os.Parcelable;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -26,7 +23,7 @@ import java.util.List;
|
|||||||
* call. This class allows getting the token for querying the next batch of events in order to
|
* 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.
|
* prevent handling large amounts of data at once.
|
||||||
*/
|
*/
|
||||||
public final class RcsEventQueryResult implements Parcelable {
|
public class RcsEventQueryResult {
|
||||||
private RcsQueryContinuationToken mContinuationToken;
|
private RcsQueryContinuationToken mContinuationToken;
|
||||||
private List<RcsEvent> mEvents;
|
private List<RcsEvent> mEvents;
|
||||||
|
|
||||||
@@ -60,30 +57,4 @@ public final class RcsEventQueryResult implements Parcelable {
|
|||||||
public List<RcsEvent> getEvents() {
|
public List<RcsEvent> getEvents() {
|
||||||
return mEvents;
|
return mEvents;
|
||||||
}
|
}
|
||||||
|
|
||||||
private RcsEventQueryResult(Parcel in) {
|
|
||||||
mContinuationToken = in.readParcelable(RcsQueryContinuationToken.class.getClassLoader());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static final Creator<RcsEventQueryResult> CREATOR = new Creator<RcsEventQueryResult>() {
|
|
||||||
@Override
|
|
||||||
public RcsEventQueryResult createFromParcel(Parcel in) {
|
|
||||||
return new RcsEventQueryResult(in);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RcsEventQueryResult[] newArray(int size) {
|
|
||||||
return new RcsEventQueryResult[size];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int describeContents() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void writeToParcel(Parcel dest, int flags) {
|
|
||||||
dest.writeParcelable(mContinuationToken, flags);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,4 +17,4 @@
|
|||||||
|
|
||||||
package android.telephony.ims;
|
package android.telephony.ims;
|
||||||
|
|
||||||
parcelable RcsEventQueryResult;
|
parcelable RcsEventQueryResultDescriptor;
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
/*
|
||||||
|
* 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;
|
||||||
|
|
||||||
|
import java.util.LinkedList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contains the raw data backing a {@link RcsEventQueryResult}.
|
||||||
|
*
|
||||||
|
* @hide - used only for internal communication with the ircs service
|
||||||
|
*/
|
||||||
|
public class RcsEventQueryResultDescriptor implements Parcelable {
|
||||||
|
private final RcsQueryContinuationToken mContinuationToken;
|
||||||
|
private final List<RcsEventDescriptor> mEvents;
|
||||||
|
|
||||||
|
public RcsEventQueryResultDescriptor(
|
||||||
|
RcsQueryContinuationToken continuationToken,
|
||||||
|
List<RcsEventDescriptor> events) {
|
||||||
|
mContinuationToken = continuationToken;
|
||||||
|
mEvents = events;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected RcsEventQueryResult getRcsEventQueryResult() {
|
||||||
|
List<RcsEvent> rcsEvents = mEvents.stream()
|
||||||
|
.map(RcsEventDescriptor::createRcsEvent)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
return new RcsEventQueryResult(mContinuationToken, rcsEvents);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected RcsEventQueryResultDescriptor(Parcel in) {
|
||||||
|
mContinuationToken = in.readParcelable(RcsQueryContinuationToken.class.getClassLoader());
|
||||||
|
mEvents = new LinkedList<>();
|
||||||
|
in.readList(mEvents, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Creator<RcsEventQueryResultDescriptor> CREATOR =
|
||||||
|
new Creator<RcsEventQueryResultDescriptor>() {
|
||||||
|
@Override
|
||||||
|
public RcsEventQueryResultDescriptor createFromParcel(Parcel in) {
|
||||||
|
return new RcsEventQueryResultDescriptor(in);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RcsEventQueryResultDescriptor[] newArray(int size) {
|
||||||
|
return new RcsEventQueryResultDescriptor[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int describeContents() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeParcelable(mContinuationToken, flags);
|
||||||
|
dest.writeList(mEvents);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,7 +16,6 @@
|
|||||||
package android.telephony.ims;
|
package android.telephony.ims;
|
||||||
|
|
||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
import android.os.Parcel;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An event that happened on an {@link RcsGroupThread}.
|
* An event that happened on an {@link RcsGroupThread}.
|
||||||
@@ -47,22 +46,4 @@ public abstract class RcsGroupThreadEvent extends RcsEvent {
|
|||||||
public RcsParticipant getOriginatingParticipant() {
|
public RcsParticipant getOriginatingParticipant() {
|
||||||
return new RcsParticipant(mOriginatingParticipantId);
|
return new RcsParticipant(mOriginatingParticipantId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
RcsGroupThreadEvent(Parcel in) {
|
|
||||||
super(in);
|
|
||||||
mRcsGroupThreadId = in.readInt();
|
|
||||||
mOriginatingParticipantId = in.readInt();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
public void writeToParcel(Parcel dest, int flags) {
|
|
||||||
super.writeToParcel(dest, flags);
|
|
||||||
dest.writeInt(mRcsGroupThreadId);
|
|
||||||
dest.writeInt(mOriginatingParticipantId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,4 +16,4 @@
|
|||||||
|
|
||||||
package android.telephony.ims;
|
package android.telephony.ims;
|
||||||
|
|
||||||
parcelable RcsGroupThreadEvent;
|
parcelable RcsGroupThreadEventDescriptor;
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
/*
|
||||||
|
* 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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @hide - used only for internal communication with the ircs service
|
||||||
|
*/
|
||||||
|
public abstract class RcsGroupThreadEventDescriptor extends RcsEventDescriptor {
|
||||||
|
protected final int mRcsGroupThreadId;
|
||||||
|
protected final int mOriginatingParticipantId;
|
||||||
|
|
||||||
|
RcsGroupThreadEventDescriptor(long timestamp, int rcsGroupThreadId,
|
||||||
|
int originatingParticipantId) {
|
||||||
|
super(timestamp);
|
||||||
|
mRcsGroupThreadId = rcsGroupThreadId;
|
||||||
|
mOriginatingParticipantId = originatingParticipantId;
|
||||||
|
}
|
||||||
|
|
||||||
|
RcsGroupThreadEventDescriptor(Parcel in) {
|
||||||
|
super(in);
|
||||||
|
mRcsGroupThreadId = in.readInt();
|
||||||
|
mOriginatingParticipantId = in.readInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
super.writeToParcel(dest, flags);
|
||||||
|
dest.writeInt(mRcsGroupThreadId);
|
||||||
|
dest.writeInt(mOriginatingParticipantId);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -18,15 +18,12 @@ package android.telephony.ims;
|
|||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
import android.annotation.Nullable;
|
import android.annotation.Nullable;
|
||||||
import android.net.Uri;
|
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
|
* 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)
|
* RCC.71 (RCS Universal Profile Service Definition Document)
|
||||||
*/
|
*/
|
||||||
public final class RcsGroupThreadIconChangedEvent extends RcsGroupThreadEvent implements
|
public final class RcsGroupThreadIconChangedEvent extends RcsGroupThreadEvent {
|
||||||
Parcelable {
|
|
||||||
private final Uri mNewIcon;
|
private final Uri mNewIcon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -47,15 +44,6 @@ public final class RcsGroupThreadIconChangedEvent extends RcsGroupThreadEvent im
|
|||||||
mNewIcon = newIcon;
|
mNewIcon = newIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @hide - internal constructor for queries
|
|
||||||
*/
|
|
||||||
public RcsGroupThreadIconChangedEvent(long timestamp, int rcsGroupThreadId,
|
|
||||||
int originatingParticipantId, @Nullable Uri newIcon) {
|
|
||||||
super(timestamp, rcsGroupThreadId, originatingParticipantId);
|
|
||||||
mNewIcon = newIcon;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Returns the {@link Uri} to the icon of the {@link RcsGroupThread} after this
|
* @return Returns the {@link Uri} to the icon of the {@link RcsGroupThread} after this
|
||||||
* {@link RcsGroupThreadIconChangedEvent} occured.
|
* {@link RcsGroupThreadIconChangedEvent} occured.
|
||||||
@@ -77,33 +65,4 @@ public final class RcsGroupThreadIconChangedEvent extends RcsGroupThreadEvent im
|
|||||||
getTimestamp(), getRcsGroupThread().getThreadId(),
|
getTimestamp(), getRcsGroupThread().getThreadId(),
|
||||||
getOriginatingParticipant().getId(), mNewIcon));
|
getOriginatingParticipant().getId(), mNewIcon));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final Creator<RcsGroupThreadIconChangedEvent> CREATOR =
|
|
||||||
new Creator<RcsGroupThreadIconChangedEvent>() {
|
|
||||||
@Override
|
|
||||||
public RcsGroupThreadIconChangedEvent createFromParcel(Parcel in) {
|
|
||||||
return new RcsGroupThreadIconChangedEvent(in);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RcsGroupThreadIconChangedEvent[] newArray(int size) {
|
|
||||||
return new RcsGroupThreadIconChangedEvent[size];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
private RcsGroupThreadIconChangedEvent(Parcel in) {
|
|
||||||
super(in);
|
|
||||||
mNewIcon = in.readParcelable(Uri.class.getClassLoader());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int describeContents() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void writeToParcel(Parcel dest, int flags) {
|
|
||||||
super.writeToParcel(dest, flags);
|
|
||||||
dest.writeParcelable(mNewIcon, flags);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,4 +16,4 @@
|
|||||||
|
|
||||||
package android.telephony.ims;
|
package android.telephony.ims;
|
||||||
|
|
||||||
parcelable RcsGroupThreadIconChangedEvent;
|
parcelable RcsGroupThreadIconChangedEventDescriptor;
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
/*
|
||||||
|
* 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 static com.android.internal.annotations.VisibleForTesting.Visibility.PROTECTED;
|
||||||
|
|
||||||
|
import android.annotation.Nullable;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Parcel;
|
||||||
|
|
||||||
|
import com.android.internal.annotations.VisibleForTesting;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @hide - used only for internal communication with the ircs service
|
||||||
|
*/
|
||||||
|
public class RcsGroupThreadIconChangedEventDescriptor extends RcsGroupThreadEventDescriptor {
|
||||||
|
private final Uri mNewIcon;
|
||||||
|
|
||||||
|
public RcsGroupThreadIconChangedEventDescriptor(long timestamp, int rcsGroupThreadId,
|
||||||
|
int originatingParticipantId, @Nullable Uri newIcon) {
|
||||||
|
super(timestamp, rcsGroupThreadId, originatingParticipantId);
|
||||||
|
mNewIcon = newIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@VisibleForTesting(visibility = PROTECTED)
|
||||||
|
public RcsGroupThreadIconChangedEvent createRcsEvent() {
|
||||||
|
return new RcsGroupThreadIconChangedEvent(mTimestamp, new RcsGroupThread(mRcsGroupThreadId),
|
||||||
|
new RcsParticipant(mOriginatingParticipantId), mNewIcon);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Creator<RcsGroupThreadIconChangedEventDescriptor> CREATOR =
|
||||||
|
new Creator<RcsGroupThreadIconChangedEventDescriptor>() {
|
||||||
|
@Override
|
||||||
|
public RcsGroupThreadIconChangedEventDescriptor createFromParcel(Parcel in) {
|
||||||
|
return new RcsGroupThreadIconChangedEventDescriptor(in);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RcsGroupThreadIconChangedEventDescriptor[] newArray(int size) {
|
||||||
|
return new RcsGroupThreadIconChangedEventDescriptor[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
protected RcsGroupThreadIconChangedEventDescriptor(Parcel in) {
|
||||||
|
super(in);
|
||||||
|
mNewIcon = in.readParcelable(Uri.class.getClassLoader());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int describeContents() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
super.writeToParcel(dest, flags);
|
||||||
|
dest.writeParcelable(mNewIcon, flags);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -17,15 +17,12 @@ package android.telephony.ims;
|
|||||||
|
|
||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
import android.annotation.Nullable;
|
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
|
* 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)
|
* RCC.71 (RCS Universal Profile Service Definition Document)
|
||||||
*/
|
*/
|
||||||
public final class RcsGroupThreadNameChangedEvent extends RcsGroupThreadEvent implements
|
public final class RcsGroupThreadNameChangedEvent extends RcsGroupThreadEvent {
|
||||||
Parcelable {
|
|
||||||
private final String mNewName;
|
private final String mNewName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -46,15 +43,6 @@ public final class RcsGroupThreadNameChangedEvent extends RcsGroupThreadEvent im
|
|||||||
mNewName = newName;
|
mNewName = newName;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @hide - internal constructor for queries
|
|
||||||
*/
|
|
||||||
public RcsGroupThreadNameChangedEvent(long timestamp, int rcsGroupThreadId,
|
|
||||||
int originatingParticipantId, @Nullable String newName) {
|
|
||||||
super(timestamp, rcsGroupThreadId, originatingParticipantId);
|
|
||||||
mNewName = newName;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Returns the name of this {@link RcsGroupThread} after this
|
* @return Returns the name of this {@link RcsGroupThread} after this
|
||||||
* {@link RcsGroupThreadNameChangedEvent} happened.
|
* {@link RcsGroupThreadNameChangedEvent} happened.
|
||||||
@@ -75,33 +63,4 @@ public final class RcsGroupThreadNameChangedEvent extends RcsGroupThreadEvent im
|
|||||||
getTimestamp(), getRcsGroupThread().getThreadId(),
|
getTimestamp(), getRcsGroupThread().getThreadId(),
|
||||||
getOriginatingParticipant().getId(), mNewName));
|
getOriginatingParticipant().getId(), mNewName));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final Creator<RcsGroupThreadNameChangedEvent> CREATOR =
|
|
||||||
new Creator<RcsGroupThreadNameChangedEvent>() {
|
|
||||||
@Override
|
|
||||||
public RcsGroupThreadNameChangedEvent createFromParcel(Parcel in) {
|
|
||||||
return new RcsGroupThreadNameChangedEvent(in);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RcsGroupThreadNameChangedEvent[] newArray(int size) {
|
|
||||||
return new RcsGroupThreadNameChangedEvent[size];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
private RcsGroupThreadNameChangedEvent(Parcel in) {
|
|
||||||
super(in);
|
|
||||||
mNewName = in.readString();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int describeContents() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void writeToParcel(Parcel dest, int flags) {
|
|
||||||
super.writeToParcel(dest, flags);
|
|
||||||
dest.writeString(mNewName);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,4 +17,4 @@
|
|||||||
|
|
||||||
package android.telephony.ims;
|
package android.telephony.ims;
|
||||||
|
|
||||||
parcelable RcsGroupThreadNameChangedEvent;
|
parcelable RcsGroupThreadNameChangedEventDescriptor;
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
/*
|
||||||
|
* 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 static com.android.internal.annotations.VisibleForTesting.Visibility.PROTECTED;
|
||||||
|
|
||||||
|
import android.annotation.Nullable;
|
||||||
|
import android.os.Parcel;
|
||||||
|
|
||||||
|
import com.android.internal.annotations.VisibleForTesting;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @hide - used only for internal communication with the ircs service
|
||||||
|
*/
|
||||||
|
public class RcsGroupThreadNameChangedEventDescriptor extends RcsGroupThreadEventDescriptor {
|
||||||
|
private final String mNewName;
|
||||||
|
|
||||||
|
public RcsGroupThreadNameChangedEventDescriptor(long timestamp, int rcsGroupThreadId,
|
||||||
|
int originatingParticipantId, @Nullable String newName) {
|
||||||
|
super(timestamp, rcsGroupThreadId, originatingParticipantId);
|
||||||
|
mNewName = newName;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@VisibleForTesting(visibility = PROTECTED)
|
||||||
|
public RcsGroupThreadNameChangedEvent createRcsEvent() {
|
||||||
|
return new RcsGroupThreadNameChangedEvent(
|
||||||
|
mTimestamp,
|
||||||
|
new RcsGroupThread(mRcsGroupThreadId),
|
||||||
|
new RcsParticipant(mOriginatingParticipantId),
|
||||||
|
mNewName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Creator<RcsGroupThreadNameChangedEventDescriptor> CREATOR =
|
||||||
|
new Creator<RcsGroupThreadNameChangedEventDescriptor>() {
|
||||||
|
@Override
|
||||||
|
public RcsGroupThreadNameChangedEventDescriptor createFromParcel(Parcel in) {
|
||||||
|
return new RcsGroupThreadNameChangedEventDescriptor(in);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RcsGroupThreadNameChangedEventDescriptor[] newArray(int size) {
|
||||||
|
return new RcsGroupThreadNameChangedEventDescriptor[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
protected RcsGroupThreadNameChangedEventDescriptor(Parcel in) {
|
||||||
|
super(in);
|
||||||
|
mNewName = in.readString();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int describeContents() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
super.writeToParcel(dest, flags);
|
||||||
|
dest.writeString(mNewName);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,16 +16,13 @@
|
|||||||
package android.telephony.ims;
|
package android.telephony.ims;
|
||||||
|
|
||||||
import android.annotation.NonNull;
|
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 -
|
* 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)
|
* GSMA RCC.71 (RCS Universal Profile Service Definition Document)
|
||||||
*/
|
*/
|
||||||
public final class RcsGroupThreadParticipantJoinedEvent extends RcsGroupThreadEvent implements
|
public final class RcsGroupThreadParticipantJoinedEvent extends RcsGroupThreadEvent {
|
||||||
Parcelable {
|
private final RcsParticipant mJoinedParticipantId;
|
||||||
private final int mJoinedParticipantId;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new {@link RcsGroupThreadParticipantJoinedEvent}. This event is not persisted into
|
* Creates a new {@link RcsGroupThreadParticipantJoinedEvent}. This event is not persisted into
|
||||||
@@ -44,23 +41,14 @@ public final class RcsGroupThreadParticipantJoinedEvent extends RcsGroupThreadEv
|
|||||||
@NonNull RcsGroupThread rcsGroupThread, @NonNull RcsParticipant originatingParticipant,
|
@NonNull RcsGroupThread rcsGroupThread, @NonNull RcsParticipant originatingParticipant,
|
||||||
@NonNull RcsParticipant joinedParticipant) {
|
@NonNull RcsParticipant joinedParticipant) {
|
||||||
super(timestamp, rcsGroupThread.getThreadId(), originatingParticipant.getId());
|
super(timestamp, rcsGroupThread.getThreadId(), originatingParticipant.getId());
|
||||||
mJoinedParticipantId = joinedParticipant.getId();
|
mJoinedParticipantId = joinedParticipant;
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @hide - internal constructor for queries
|
|
||||||
*/
|
|
||||||
public RcsGroupThreadParticipantJoinedEvent(long timestamp, int rcsGroupThreadId,
|
|
||||||
int originatingParticipantId, int joinedParticipantId) {
|
|
||||||
super(timestamp, rcsGroupThreadId, originatingParticipantId);
|
|
||||||
mJoinedParticipantId = joinedParticipantId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Returns the {@link RcsParticipant} that joined the associated {@link RcsGroupThread}
|
* @return Returns the {@link RcsParticipant} that joined the associated {@link RcsGroupThread}
|
||||||
*/
|
*/
|
||||||
public RcsParticipant getJoinedParticipant() {
|
public RcsParticipant getJoinedParticipant() {
|
||||||
return new RcsParticipant(mJoinedParticipantId);
|
return mJoinedParticipantId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -75,33 +63,4 @@ public final class RcsGroupThreadParticipantJoinedEvent extends RcsGroupThreadEv
|
|||||||
getRcsGroupThread().getThreadId(), getOriginatingParticipant().getId(),
|
getRcsGroupThread().getThreadId(), getOriginatingParticipant().getId(),
|
||||||
getJoinedParticipant().getId()));
|
getJoinedParticipant().getId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final Creator<RcsGroupThreadParticipantJoinedEvent> CREATOR =
|
|
||||||
new Creator<RcsGroupThreadParticipantJoinedEvent>() {
|
|
||||||
@Override
|
|
||||||
public RcsGroupThreadParticipantJoinedEvent createFromParcel(Parcel in) {
|
|
||||||
return new RcsGroupThreadParticipantJoinedEvent(in);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RcsGroupThreadParticipantJoinedEvent[] newArray(int size) {
|
|
||||||
return new RcsGroupThreadParticipantJoinedEvent[size];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
private RcsGroupThreadParticipantJoinedEvent(Parcel in) {
|
|
||||||
super(in);
|
|
||||||
mJoinedParticipantId = in.readInt();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int describeContents() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void writeToParcel(Parcel dest, int flags) {
|
|
||||||
super.writeToParcel(dest, flags);
|
|
||||||
dest.writeInt(mJoinedParticipantId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,4 +17,4 @@
|
|||||||
|
|
||||||
package android.telephony.ims;
|
package android.telephony.ims;
|
||||||
|
|
||||||
parcelable RcsGroupThreadParticipantJoinedEvent;
|
parcelable RcsGroupThreadParticipantJoinedEventDescriptor;
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
/*
|
||||||
|
* 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 static com.android.internal.annotations.VisibleForTesting.Visibility.PROTECTED;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
|
||||||
|
import com.android.internal.annotations.VisibleForTesting;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @hide - used only for internal communication with the ircs service
|
||||||
|
*/
|
||||||
|
public class RcsGroupThreadParticipantJoinedEventDescriptor extends RcsGroupThreadEventDescriptor {
|
||||||
|
private final int mJoinedParticipantId;
|
||||||
|
|
||||||
|
public RcsGroupThreadParticipantJoinedEventDescriptor(long timestamp, int rcsGroupThreadId,
|
||||||
|
int originatingParticipantId, int joinedParticipantId) {
|
||||||
|
super(timestamp, rcsGroupThreadId, originatingParticipantId);
|
||||||
|
mJoinedParticipantId = joinedParticipantId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@VisibleForTesting(visibility = PROTECTED)
|
||||||
|
public RcsGroupThreadParticipantJoinedEvent createRcsEvent() {
|
||||||
|
return new RcsGroupThreadParticipantJoinedEvent(
|
||||||
|
mTimestamp,
|
||||||
|
new RcsGroupThread(mRcsGroupThreadId),
|
||||||
|
new RcsParticipant(mOriginatingParticipantId),
|
||||||
|
new RcsParticipant(mJoinedParticipantId));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Creator<RcsGroupThreadParticipantJoinedEventDescriptor> CREATOR =
|
||||||
|
new Creator<RcsGroupThreadParticipantJoinedEventDescriptor>() {
|
||||||
|
@Override
|
||||||
|
public RcsGroupThreadParticipantJoinedEventDescriptor createFromParcel(Parcel in) {
|
||||||
|
return new RcsGroupThreadParticipantJoinedEventDescriptor(in);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RcsGroupThreadParticipantJoinedEventDescriptor[] newArray(int size) {
|
||||||
|
return new RcsGroupThreadParticipantJoinedEventDescriptor[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
protected RcsGroupThreadParticipantJoinedEventDescriptor(Parcel in) {
|
||||||
|
super(in);
|
||||||
|
mJoinedParticipantId = in.readInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int describeContents() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
super.writeToParcel(dest, flags);
|
||||||
|
dest.writeInt(mJoinedParticipantId);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,16 +16,13 @@
|
|||||||
package android.telephony.ims;
|
package android.telephony.ims;
|
||||||
|
|
||||||
import android.annotation.NonNull;
|
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 -
|
* 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)
|
* GSMA RCC.71 (RCS Universal Profile Service Definition Document)
|
||||||
*/
|
*/
|
||||||
public final class RcsGroupThreadParticipantLeftEvent extends RcsGroupThreadEvent implements
|
public final class RcsGroupThreadParticipantLeftEvent extends RcsGroupThreadEvent {
|
||||||
Parcelable {
|
private RcsParticipant mLeavingParticipant;
|
||||||
private final int mLeavingParticipantId;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new {@link RcsGroupThreadParticipantLeftEvent}. his event is not persisted into
|
* Creates a new {@link RcsGroupThreadParticipantLeftEvent}. his event is not persisted into
|
||||||
@@ -46,16 +43,7 @@ public final class RcsGroupThreadParticipantLeftEvent extends RcsGroupThreadEven
|
|||||||
@NonNull RcsGroupThread rcsGroupThread, @NonNull RcsParticipant originatingParticipant,
|
@NonNull RcsGroupThread rcsGroupThread, @NonNull RcsParticipant originatingParticipant,
|
||||||
@NonNull RcsParticipant leavingParticipant) {
|
@NonNull RcsParticipant leavingParticipant) {
|
||||||
super(timestamp, rcsGroupThread.getThreadId(), originatingParticipant.getId());
|
super(timestamp, rcsGroupThread.getThreadId(), originatingParticipant.getId());
|
||||||
mLeavingParticipantId = leavingParticipant.getId();
|
mLeavingParticipant = leavingParticipant;
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @hide - internal constructor for queries
|
|
||||||
*/
|
|
||||||
public RcsGroupThreadParticipantLeftEvent(long timestamp, int rcsGroupThreadId,
|
|
||||||
int originatingParticipantId, int leavingParticipantId) {
|
|
||||||
super(timestamp, rcsGroupThreadId, originatingParticipantId);
|
|
||||||
mLeavingParticipantId = leavingParticipantId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -63,44 +51,15 @@ public final class RcsGroupThreadParticipantLeftEvent extends RcsGroupThreadEven
|
|||||||
* after this {@link RcsGroupThreadParticipantLeftEvent} happened.
|
* after this {@link RcsGroupThreadParticipantLeftEvent} happened.
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
public RcsParticipant getLeavingParticipantId() {
|
public RcsParticipant getLeavingParticipant() {
|
||||||
return new RcsParticipant(mLeavingParticipantId);
|
return mLeavingParticipant;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void persist() throws RcsMessageStoreException {
|
public void persist() throws RcsMessageStoreException {
|
||||||
RcsControllerCall.call(
|
RcsControllerCall.call(
|
||||||
iRcs -> iRcs.createGroupThreadParticipantJoinedEvent(getTimestamp(),
|
iRcs -> iRcs.createGroupThreadParticipantLeftEvent(getTimestamp(),
|
||||||
getRcsGroupThread().getThreadId(), getOriginatingParticipant().getId(),
|
getRcsGroupThread().getThreadId(), getOriginatingParticipant().getId(),
|
||||||
getLeavingParticipantId().getId()));
|
getLeavingParticipant().getId()));
|
||||||
}
|
|
||||||
|
|
||||||
public static final Creator<RcsGroupThreadParticipantLeftEvent> CREATOR =
|
|
||||||
new Creator<RcsGroupThreadParticipantLeftEvent>() {
|
|
||||||
@Override
|
|
||||||
public RcsGroupThreadParticipantLeftEvent createFromParcel(Parcel in) {
|
|
||||||
return new RcsGroupThreadParticipantLeftEvent(in);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RcsGroupThreadParticipantLeftEvent[] newArray(int size) {
|
|
||||||
return new RcsGroupThreadParticipantLeftEvent[size];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
private RcsGroupThreadParticipantLeftEvent(Parcel in) {
|
|
||||||
super(in);
|
|
||||||
mLeavingParticipantId = in.readInt();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int describeContents() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void writeToParcel(Parcel dest, int flags) {
|
|
||||||
super.writeToParcel(dest, flags);
|
|
||||||
dest.writeInt(mLeavingParticipantId);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,4 +17,4 @@
|
|||||||
|
|
||||||
package android.telephony.ims;
|
package android.telephony.ims;
|
||||||
|
|
||||||
parcelable RcsGroupThreadParticipantLeftEvent;
|
parcelable RcsGroupThreadParticipantLeftEventDescriptor;
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
/*
|
||||||
|
* 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 static com.android.internal.annotations.VisibleForTesting.Visibility.PROTECTED;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
import com.android.internal.annotations.VisibleForTesting;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @hide - used only for internal communication with the ircs service
|
||||||
|
*/
|
||||||
|
public class RcsGroupThreadParticipantLeftEventDescriptor extends RcsGroupThreadEventDescriptor {
|
||||||
|
private int mLeavingParticipantId;
|
||||||
|
|
||||||
|
public RcsGroupThreadParticipantLeftEventDescriptor(long timestamp, int rcsGroupThreadId,
|
||||||
|
int originatingParticipantId, int leavingParticipantId) {
|
||||||
|
super(timestamp, rcsGroupThreadId, originatingParticipantId);
|
||||||
|
mLeavingParticipantId = leavingParticipantId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@VisibleForTesting(visibility = PROTECTED)
|
||||||
|
public RcsGroupThreadParticipantLeftEvent createRcsEvent() {
|
||||||
|
return new RcsGroupThreadParticipantLeftEvent(
|
||||||
|
mTimestamp,
|
||||||
|
new RcsGroupThread(mRcsGroupThreadId),
|
||||||
|
new RcsParticipant(mOriginatingParticipantId),
|
||||||
|
new RcsParticipant(mLeavingParticipantId));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Parcelable.Creator<RcsGroupThreadParticipantLeftEventDescriptor> CREATOR =
|
||||||
|
new Creator<RcsGroupThreadParticipantLeftEventDescriptor>() {
|
||||||
|
@Override
|
||||||
|
public RcsGroupThreadParticipantLeftEventDescriptor createFromParcel(Parcel in) {
|
||||||
|
return new RcsGroupThreadParticipantLeftEventDescriptor(in);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RcsGroupThreadParticipantLeftEventDescriptor[] newArray(int size) {
|
||||||
|
return new RcsGroupThreadParticipantLeftEventDescriptor[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
protected RcsGroupThreadParticipantLeftEventDescriptor(Parcel in) {
|
||||||
|
super(in);
|
||||||
|
mLeavingParticipantId = in.readInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int describeContents() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
super.writeToParcel(dest, flags);
|
||||||
|
dest.writeInt(mLeavingParticipantId);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -118,15 +118,16 @@ public class RcsMessageStore {
|
|||||||
/**
|
/**
|
||||||
* Returns the first chunk of existing {@link RcsEvent}s in the common storage.
|
* Returns the first chunk of existing {@link RcsEvent}s in the common storage.
|
||||||
*
|
*
|
||||||
* @param queryParameters Parameters to specify to return a subset of all RcsEvents.
|
* @param queryParams Parameters to specify to return a subset of all RcsEvents.
|
||||||
* Passing a value of null will return all events.
|
* Passing a value of null will return all events.
|
||||||
* @throws RcsMessageStoreException if the query could not be completed on the storage
|
* @throws RcsMessageStoreException if the query could not be completed on the storage
|
||||||
*/
|
*/
|
||||||
@WorkerThread
|
@WorkerThread
|
||||||
@NonNull
|
@NonNull
|
||||||
public RcsEventQueryResult getRcsEvents(
|
public RcsEventQueryResult getRcsEvents(
|
||||||
@Nullable RcsEventQueryParams queryParameters) throws RcsMessageStoreException {
|
@Nullable RcsEventQueryParams queryParams) throws RcsMessageStoreException {
|
||||||
return RcsControllerCall.call(iRcs -> iRcs.getEvents(queryParameters));
|
return RcsControllerCall.call(iRcs -> iRcs.getEvents(queryParams))
|
||||||
|
.getRcsEventQueryResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -140,7 +141,8 @@ public class RcsMessageStore {
|
|||||||
@NonNull
|
@NonNull
|
||||||
public RcsEventQueryResult getRcsEvents(
|
public RcsEventQueryResult getRcsEvents(
|
||||||
@NonNull RcsQueryContinuationToken continuationToken) throws RcsMessageStoreException {
|
@NonNull RcsQueryContinuationToken continuationToken) throws RcsMessageStoreException {
|
||||||
return RcsControllerCall.call(iRcs -> iRcs.getEventsWithToken(continuationToken));
|
return RcsControllerCall.call(iRcs -> iRcs.getEventsWithToken(continuationToken))
|
||||||
|
.getRcsEventQueryResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -17,16 +17,14 @@ package android.telephony.ims;
|
|||||||
|
|
||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
import android.annotation.Nullable;
|
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
|
* An event that indicates an {@link RcsParticipant}'s alias was changed. Please see US18-2 - GSMA
|
||||||
* RCC.71 (RCS Universal Profile Service Definition Document)
|
* RCC.71 (RCS Universal Profile Service Definition Document)
|
||||||
*/
|
*/
|
||||||
public final class RcsParticipantAliasChangedEvent extends RcsEvent implements Parcelable {
|
public final class RcsParticipantAliasChangedEvent extends RcsEvent {
|
||||||
// The ID of the participant that changed their alias
|
// The participant that changed their alias
|
||||||
private final int mParticipantId;
|
private final RcsParticipant mParticipant;
|
||||||
// The new alias of the above participant
|
// The new alias of the above participant
|
||||||
private final String mNewAlias;
|
private final String mNewAlias;
|
||||||
|
|
||||||
@@ -43,17 +41,7 @@ public final class RcsParticipantAliasChangedEvent extends RcsEvent implements P
|
|||||||
public RcsParticipantAliasChangedEvent(long timestamp, @NonNull RcsParticipant participant,
|
public RcsParticipantAliasChangedEvent(long timestamp, @NonNull RcsParticipant participant,
|
||||||
@Nullable String newAlias) {
|
@Nullable String newAlias) {
|
||||||
super(timestamp);
|
super(timestamp);
|
||||||
mParticipantId = participant.getId();
|
mParticipant = participant;
|
||||||
mNewAlias = newAlias;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @hide - internal constructor for queries
|
|
||||||
*/
|
|
||||||
public RcsParticipantAliasChangedEvent(long timestamp, int participantId,
|
|
||||||
@Nullable String newAlias) {
|
|
||||||
super(timestamp);
|
|
||||||
mParticipantId = participantId;
|
|
||||||
mNewAlias = newAlias;
|
mNewAlias = newAlias;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,8 +49,8 @@ public final class RcsParticipantAliasChangedEvent extends RcsEvent implements P
|
|||||||
* @return Returns the {@link RcsParticipant} whose alias was changed.
|
* @return Returns the {@link RcsParticipant} whose alias was changed.
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
public RcsParticipant getParticipantId() {
|
public RcsParticipant getParticipant() {
|
||||||
return new RcsParticipant(mParticipantId);
|
return mParticipant;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -81,37 +69,6 @@ public final class RcsParticipantAliasChangedEvent extends RcsEvent implements P
|
|||||||
@Override
|
@Override
|
||||||
public void persist() throws RcsMessageStoreException {
|
public void persist() throws RcsMessageStoreException {
|
||||||
RcsControllerCall.call(iRcs -> iRcs.createParticipantAliasChangedEvent(
|
RcsControllerCall.call(iRcs -> iRcs.createParticipantAliasChangedEvent(
|
||||||
getTimestamp(), getParticipantId().getId(), getNewAlias()));
|
getTimestamp(), getParticipant().getId(), getNewAlias()));
|
||||||
}
|
|
||||||
|
|
||||||
public static final Creator<RcsParticipantAliasChangedEvent> CREATOR =
|
|
||||||
new Creator<RcsParticipantAliasChangedEvent>() {
|
|
||||||
@Override
|
|
||||||
public RcsParticipantAliasChangedEvent createFromParcel(Parcel in) {
|
|
||||||
return new RcsParticipantAliasChangedEvent(in);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RcsParticipantAliasChangedEvent[] newArray(int size) {
|
|
||||||
return new RcsParticipantAliasChangedEvent[size];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
private RcsParticipantAliasChangedEvent(Parcel in) {
|
|
||||||
super(in);
|
|
||||||
mNewAlias = in.readString();
|
|
||||||
mParticipantId = in.readInt();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int describeContents() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void writeToParcel(Parcel dest, int flags) {
|
|
||||||
super.writeToParcel(dest, flags);
|
|
||||||
dest.writeString(mNewAlias);
|
|
||||||
dest.writeInt(mParticipantId);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,4 +17,4 @@
|
|||||||
|
|
||||||
package android.telephony.ims;
|
package android.telephony.ims;
|
||||||
|
|
||||||
parcelable RcsParticipantAliasChangedEvent;
|
parcelable RcsParticipantAliasChangedEventDescriptor;
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
/*
|
||||||
|
* 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 static com.android.internal.annotations.VisibleForTesting.Visibility.PROTECTED;
|
||||||
|
|
||||||
|
import android.annotation.Nullable;
|
||||||
|
import android.os.Parcel;
|
||||||
|
|
||||||
|
import com.android.internal.annotations.VisibleForTesting;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @hide - used only for internal communication with the ircs service
|
||||||
|
*/
|
||||||
|
public class RcsParticipantAliasChangedEventDescriptor extends RcsEventDescriptor {
|
||||||
|
// The ID of the participant that changed their alias
|
||||||
|
protected int mParticipantId;
|
||||||
|
// The new alias of the above participant
|
||||||
|
protected String mNewAlias;
|
||||||
|
|
||||||
|
public RcsParticipantAliasChangedEventDescriptor(long timestamp, int participantId,
|
||||||
|
@Nullable String newAlias) {
|
||||||
|
super(timestamp);
|
||||||
|
mParticipantId = participantId;
|
||||||
|
mNewAlias = newAlias;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@VisibleForTesting(visibility = PROTECTED)
|
||||||
|
public RcsParticipantAliasChangedEvent createRcsEvent() {
|
||||||
|
return new RcsParticipantAliasChangedEvent(
|
||||||
|
mTimestamp, new RcsParticipant(mParticipantId), mNewAlias);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Creator<RcsParticipantAliasChangedEventDescriptor> CREATOR =
|
||||||
|
new Creator<RcsParticipantAliasChangedEventDescriptor>() {
|
||||||
|
@Override
|
||||||
|
public RcsParticipantAliasChangedEventDescriptor createFromParcel(Parcel in) {
|
||||||
|
return new RcsParticipantAliasChangedEventDescriptor(in);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RcsParticipantAliasChangedEventDescriptor[] newArray(int size) {
|
||||||
|
return new RcsParticipantAliasChangedEventDescriptor[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
protected RcsParticipantAliasChangedEventDescriptor(Parcel in) {
|
||||||
|
super(in);
|
||||||
|
mNewAlias = in.readString();
|
||||||
|
mParticipantId = in.readInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int describeContents() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
super.writeToParcel(dest, flags);
|
||||||
|
dest.writeString(mNewAlias);
|
||||||
|
dest.writeInt(mParticipantId);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -18,7 +18,7 @@ package android.telephony.ims.aidl;
|
|||||||
|
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.telephony.ims.RcsEventQueryParams;
|
import android.telephony.ims.RcsEventQueryParams;
|
||||||
import android.telephony.ims.RcsEventQueryResult;
|
import android.telephony.ims.RcsEventQueryResultDescriptor;
|
||||||
import android.telephony.ims.RcsFileTransferCreationParams;
|
import android.telephony.ims.RcsFileTransferCreationParams;
|
||||||
import android.telephony.ims.RcsIncomingMessageCreationParams;
|
import android.telephony.ims.RcsIncomingMessageCreationParams;
|
||||||
import android.telephony.ims.RcsMessageSnippet;
|
import android.telephony.ims.RcsMessageSnippet;
|
||||||
@@ -54,9 +54,9 @@ interface IRcs {
|
|||||||
RcsMessageQueryResult getMessagesWithToken(
|
RcsMessageQueryResult getMessagesWithToken(
|
||||||
in RcsQueryContinuationToken continuationToken);
|
in RcsQueryContinuationToken continuationToken);
|
||||||
|
|
||||||
RcsEventQueryResult getEvents(in RcsEventQueryParams queryParams);
|
RcsEventQueryResultDescriptor getEvents(in RcsEventQueryParams queryParams);
|
||||||
|
|
||||||
RcsEventQueryResult getEventsWithToken(
|
RcsEventQueryResultDescriptor getEventsWithToken(
|
||||||
in RcsQueryContinuationToken continuationToken);
|
in RcsQueryContinuationToken continuationToken);
|
||||||
|
|
||||||
// returns true if the thread was successfully deleted
|
// returns true if the thread was successfully deleted
|
||||||
|
|||||||
@@ -20,9 +20,8 @@ import static com.google.common.truth.Truth.assertThat;
|
|||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
import android.telephony.ims.RcsGroupThread;
|
|
||||||
import android.telephony.ims.RcsGroupThreadIconChangedEvent;
|
import android.telephony.ims.RcsGroupThreadIconChangedEvent;
|
||||||
import android.telephony.ims.RcsParticipant;
|
import android.telephony.ims.RcsGroupThreadIconChangedEventDescriptor;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
@@ -32,20 +31,27 @@ public class RcsGroupThreadIconChangedEventTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCanUnparcel() {
|
public void testCanUnparcel() {
|
||||||
RcsGroupThread rcsGroupThread = new RcsGroupThread(1);
|
int rcsGroupThreadId = 1;
|
||||||
RcsParticipant rcsParticipant = new RcsParticipant(2);
|
int rcsParticipantId = 2;
|
||||||
Uri newIconUri = Uri.parse("content://new_icon");
|
Uri newIconUri = Uri.parse("content://new_icon");
|
||||||
|
|
||||||
RcsGroupThreadIconChangedEvent iconChangedEvent =
|
RcsGroupThreadIconChangedEventDescriptor iconChangedEventDescriptor =
|
||||||
new RcsGroupThreadIconChangedEvent(1234567890, rcsGroupThread, rcsParticipant,
|
new RcsGroupThreadIconChangedEventDescriptor(1234567890, rcsGroupThreadId,
|
||||||
newIconUri);
|
rcsParticipantId, newIconUri);
|
||||||
|
|
||||||
Parcel parcel = Parcel.obtain();
|
Parcel parcel = Parcel.obtain();
|
||||||
iconChangedEvent.writeToParcel(parcel, iconChangedEvent.describeContents());
|
iconChangedEventDescriptor.writeToParcel(
|
||||||
|
parcel, iconChangedEventDescriptor.describeContents());
|
||||||
|
|
||||||
parcel.setDataPosition(0);
|
parcel.setDataPosition(0);
|
||||||
|
|
||||||
iconChangedEvent = RcsGroupThreadIconChangedEvent.CREATOR.createFromParcel(parcel);
|
iconChangedEventDescriptor =
|
||||||
|
RcsGroupThreadIconChangedEventDescriptor.CREATOR.createFromParcel(parcel);
|
||||||
|
|
||||||
|
RcsGroupThreadIconChangedEvent iconChangedEvent =
|
||||||
|
iconChangedEventDescriptor.createRcsEvent();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
assertThat(iconChangedEvent.getNewIcon()).isEqualTo(newIconUri);
|
assertThat(iconChangedEvent.getNewIcon()).isEqualTo(newIconUri);
|
||||||
assertThat(iconChangedEvent.getRcsGroupThread().getThreadId()).isEqualTo(1);
|
assertThat(iconChangedEvent.getRcsGroupThread().getThreadId()).isEqualTo(1);
|
||||||
|
|||||||
@@ -19,9 +19,8 @@ import static com.google.common.truth.Truth.assertThat;
|
|||||||
|
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
import android.telephony.ims.RcsGroupThread;
|
|
||||||
import android.telephony.ims.RcsGroupThreadNameChangedEvent;
|
import android.telephony.ims.RcsGroupThreadNameChangedEvent;
|
||||||
import android.telephony.ims.RcsParticipant;
|
import android.telephony.ims.RcsGroupThreadNameChangedEventDescriptor;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
@@ -32,20 +31,24 @@ public class RcsGroupThreadNameChangedEventTest {
|
|||||||
public void testCanUnparcel() {
|
public void testCanUnparcel() {
|
||||||
String newName = "new name";
|
String newName = "new name";
|
||||||
|
|
||||||
RcsGroupThread rcsGroupThread = new RcsGroupThread(1);
|
int rcsGroupThreadId = 1;
|
||||||
RcsParticipant rcsParticipant = new RcsParticipant(2);
|
int rcsParticipantId = 2;
|
||||||
|
|
||||||
RcsGroupThreadNameChangedEvent nameChangedEvent =
|
RcsGroupThreadNameChangedEventDescriptor nameChangedEventDescriptor =
|
||||||
new RcsGroupThreadNameChangedEvent(1234567890, rcsGroupThread, rcsParticipant,
|
new RcsGroupThreadNameChangedEventDescriptor(
|
||||||
newName);
|
1234567890, rcsGroupThreadId, rcsParticipantId, newName);
|
||||||
|
|
||||||
Parcel parcel = Parcel.obtain();
|
Parcel parcel = Parcel.obtain();
|
||||||
nameChangedEvent.writeToParcel(parcel, nameChangedEvent.describeContents());
|
nameChangedEventDescriptor.writeToParcel(
|
||||||
|
parcel, nameChangedEventDescriptor.describeContents());
|
||||||
|
|
||||||
parcel.setDataPosition(0);
|
parcel.setDataPosition(0);
|
||||||
|
|
||||||
nameChangedEvent = RcsGroupThreadNameChangedEvent.CREATOR.createFromParcel(
|
nameChangedEventDescriptor = RcsGroupThreadNameChangedEventDescriptor.CREATOR
|
||||||
parcel);
|
.createFromParcel(parcel);
|
||||||
|
|
||||||
|
RcsGroupThreadNameChangedEvent nameChangedEvent =
|
||||||
|
nameChangedEventDescriptor.createRcsEvent();
|
||||||
|
|
||||||
assertThat(nameChangedEvent.getNewName()).isEqualTo(newName);
|
assertThat(nameChangedEvent.getNewName()).isEqualTo(newName);
|
||||||
assertThat(nameChangedEvent.getRcsGroupThread().getThreadId()).isEqualTo(1);
|
assertThat(nameChangedEvent.getRcsGroupThread().getThreadId()).isEqualTo(1);
|
||||||
|
|||||||
@@ -19,9 +19,8 @@ import static com.google.common.truth.Truth.assertThat;
|
|||||||
|
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
import android.telephony.ims.RcsGroupThread;
|
|
||||||
import android.telephony.ims.RcsGroupThreadParticipantJoinedEvent;
|
import android.telephony.ims.RcsGroupThreadParticipantJoinedEvent;
|
||||||
import android.telephony.ims.RcsParticipant;
|
import android.telephony.ims.RcsGroupThreadParticipantJoinedEventDescriptor;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
@@ -31,20 +30,24 @@ public class RcsGroupThreadParticipantJoinedEventTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCanUnparcel() {
|
public void testCanUnparcel() {
|
||||||
RcsGroupThread rcsGroupThread = new RcsGroupThread(1);
|
int rcsGroupThreadId = 1;
|
||||||
RcsParticipant rcsParticipant = new RcsParticipant(2);
|
int rcsParticipantId = 2;
|
||||||
|
|
||||||
RcsGroupThreadParticipantJoinedEvent participantJoinedEvent =
|
RcsGroupThreadParticipantJoinedEventDescriptor participantJoinedEventDescriptor =
|
||||||
new RcsGroupThreadParticipantJoinedEvent(1234567890, rcsGroupThread, rcsParticipant,
|
new RcsGroupThreadParticipantJoinedEventDescriptor(
|
||||||
rcsParticipant);
|
1234567890, rcsGroupThreadId, rcsParticipantId, rcsParticipantId);
|
||||||
|
|
||||||
Parcel parcel = Parcel.obtain();
|
Parcel parcel = Parcel.obtain();
|
||||||
participantJoinedEvent.writeToParcel(parcel, participantJoinedEvent.describeContents());
|
participantJoinedEventDescriptor.writeToParcel(
|
||||||
|
parcel, participantJoinedEventDescriptor.describeContents());
|
||||||
|
|
||||||
parcel.setDataPosition(0);
|
parcel.setDataPosition(0);
|
||||||
|
|
||||||
participantJoinedEvent = RcsGroupThreadParticipantJoinedEvent.CREATOR.createFromParcel(
|
participantJoinedEventDescriptor = RcsGroupThreadParticipantJoinedEventDescriptor.CREATOR
|
||||||
parcel);
|
.createFromParcel(parcel);
|
||||||
|
|
||||||
|
RcsGroupThreadParticipantJoinedEvent participantJoinedEvent =
|
||||||
|
participantJoinedEventDescriptor.createRcsEvent();
|
||||||
|
|
||||||
assertThat(participantJoinedEvent.getJoinedParticipant().getId()).isEqualTo(2);
|
assertThat(participantJoinedEvent.getJoinedParticipant().getId()).isEqualTo(2);
|
||||||
assertThat(participantJoinedEvent.getRcsGroupThread().getThreadId()).isEqualTo(1);
|
assertThat(participantJoinedEvent.getRcsGroupThread().getThreadId()).isEqualTo(1);
|
||||||
|
|||||||
@@ -19,9 +19,8 @@ import static com.google.common.truth.Truth.assertThat;
|
|||||||
|
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
import android.telephony.ims.RcsGroupThread;
|
|
||||||
import android.telephony.ims.RcsGroupThreadParticipantLeftEvent;
|
import android.telephony.ims.RcsGroupThreadParticipantLeftEvent;
|
||||||
import android.telephony.ims.RcsParticipant;
|
import android.telephony.ims.RcsGroupThreadParticipantLeftEventDescriptor;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
@@ -30,24 +29,29 @@ import org.junit.runner.RunWith;
|
|||||||
public class RcsGroupThreadParticipantLeftEventTest {
|
public class RcsGroupThreadParticipantLeftEventTest {
|
||||||
@Test
|
@Test
|
||||||
public void testCanUnparcel() {
|
public void testCanUnparcel() {
|
||||||
RcsGroupThread rcsGroupThread = new RcsGroupThread(1);
|
int rcsGroupThreadId = 1;
|
||||||
RcsParticipant rcsParticipant = new RcsParticipant(2);
|
int rcsParticipantId = 2;
|
||||||
|
|
||||||
RcsGroupThreadParticipantLeftEvent participantLeftEvent =
|
RcsGroupThreadParticipantLeftEventDescriptor participantLeftEventDescriptor =
|
||||||
new RcsGroupThreadParticipantLeftEvent(1234567890, rcsGroupThread, rcsParticipant,
|
new RcsGroupThreadParticipantLeftEventDescriptor(
|
||||||
rcsParticipant);
|
1234567890, rcsGroupThreadId, rcsParticipantId, rcsParticipantId);
|
||||||
|
|
||||||
Parcel parcel = Parcel.obtain();
|
Parcel parcel = Parcel.obtain();
|
||||||
participantLeftEvent.writeToParcel(parcel, participantLeftEvent.describeContents());
|
participantLeftEventDescriptor.writeToParcel(
|
||||||
|
parcel, participantLeftEventDescriptor.describeContents());
|
||||||
|
|
||||||
parcel.setDataPosition(0);
|
parcel.setDataPosition(0);
|
||||||
|
|
||||||
// create from parcel
|
// create from parcel
|
||||||
parcel.setDataPosition(0);
|
parcel.setDataPosition(0);
|
||||||
participantLeftEvent = RcsGroupThreadParticipantLeftEvent.CREATOR.createFromParcel(
|
participantLeftEventDescriptor = RcsGroupThreadParticipantLeftEventDescriptor.CREATOR
|
||||||
parcel);
|
.createFromParcel(parcel);
|
||||||
|
|
||||||
|
RcsGroupThreadParticipantLeftEvent participantLeftEvent =
|
||||||
|
participantLeftEventDescriptor.createRcsEvent();
|
||||||
|
|
||||||
assertThat(participantLeftEvent.getRcsGroupThread().getThreadId()).isEqualTo(1);
|
assertThat(participantLeftEvent.getRcsGroupThread().getThreadId()).isEqualTo(1);
|
||||||
assertThat(participantLeftEvent.getLeavingParticipantId().getId()).isEqualTo(2);
|
assertThat(participantLeftEvent.getLeavingParticipant().getId()).isEqualTo(2);
|
||||||
assertThat(participantLeftEvent.getTimestamp()).isEqualTo(1234567890);
|
assertThat(participantLeftEvent.getTimestamp()).isEqualTo(1234567890);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,10 +19,9 @@ import static com.google.common.truth.Truth.assertThat;
|
|||||||
|
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
import android.telephony.ims.RcsParticipant;
|
|
||||||
import android.telephony.ims.RcsParticipantAliasChangedEvent;
|
import android.telephony.ims.RcsParticipantAliasChangedEvent;
|
||||||
|
import android.telephony.ims.RcsParticipantAliasChangedEventDescriptor;
|
||||||
|
|
||||||
import org.junit.Before;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
@@ -30,27 +29,27 @@ import org.junit.runner.RunWith;
|
|||||||
public class RcsParticipantAliasChangedEventTest {
|
public class RcsParticipantAliasChangedEventTest {
|
||||||
private static final String OLD_ALIAS = "old alias";
|
private static final String OLD_ALIAS = "old alias";
|
||||||
private static final String NEW_ALIAS = "new alias";
|
private static final String NEW_ALIAS = "new alias";
|
||||||
private RcsParticipant mParticipant;
|
private int mParticipantId = 3;
|
||||||
|
|
||||||
@Before
|
|
||||||
public void setUp() {
|
|
||||||
mParticipant = new RcsParticipant(3);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCanUnparcel() {
|
public void testCanUnparcel() {
|
||||||
RcsParticipantAliasChangedEvent aliasChangedEvent =
|
RcsParticipantAliasChangedEventDescriptor aliasChangedEventDescriptor =
|
||||||
new RcsParticipantAliasChangedEvent(1234567890, mParticipant, NEW_ALIAS);
|
new RcsParticipantAliasChangedEventDescriptor(
|
||||||
|
1234567890, mParticipantId, NEW_ALIAS);
|
||||||
|
|
||||||
Parcel parcel = Parcel.obtain();
|
Parcel parcel = Parcel.obtain();
|
||||||
aliasChangedEvent.writeToParcel(parcel, aliasChangedEvent.describeContents());
|
aliasChangedEventDescriptor.writeToParcel(
|
||||||
|
parcel, aliasChangedEventDescriptor.describeContents());
|
||||||
|
|
||||||
parcel.setDataPosition(0);
|
parcel.setDataPosition(0);
|
||||||
|
|
||||||
aliasChangedEvent = RcsParticipantAliasChangedEvent.CREATOR.createFromParcel(
|
aliasChangedEventDescriptor = RcsParticipantAliasChangedEventDescriptor.CREATOR
|
||||||
parcel);
|
.createFromParcel(parcel);
|
||||||
|
|
||||||
assertThat(aliasChangedEvent.getParticipantId().getId()).isEqualTo(3);
|
RcsParticipantAliasChangedEvent aliasChangedEvent =
|
||||||
|
aliasChangedEventDescriptor.createRcsEvent();
|
||||||
|
|
||||||
|
assertThat(aliasChangedEvent.getParticipant().getId()).isEqualTo(mParticipantId);
|
||||||
assertThat(aliasChangedEvent.getNewAlias()).isEqualTo(NEW_ALIAS);
|
assertThat(aliasChangedEvent.getNewAlias()).isEqualTo(NEW_ALIAS);
|
||||||
assertThat(aliasChangedEvent.getTimestamp()).isEqualTo(1234567890);
|
assertThat(aliasChangedEvent.getTimestamp()).isEqualTo(1234567890);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user