blob: 1fb8798b6f20bb86119ef8a10c3ae09ec522e43c [file] [log] [blame]
Leland Millerc39f23c2019-02-06 10:07:38 -08001/*
2 * Copyright (C) 2019 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package android.telephony.ims;
17
18import static com.android.internal.annotations.VisibleForTesting.Visibility.PROTECTED;
19
20import android.annotation.Nullable;
21import android.net.Uri;
22import android.os.Parcel;
23
24import com.android.internal.annotations.VisibleForTesting;
25
26/**
27 * @hide - used only for internal communication with the ircs service
28 */
29public class RcsGroupThreadIconChangedEventDescriptor extends RcsGroupThreadEventDescriptor {
30 private final Uri mNewIcon;
31
32 public RcsGroupThreadIconChangedEventDescriptor(long timestamp, int rcsGroupThreadId,
33 int originatingParticipantId, @Nullable Uri newIcon) {
34 super(timestamp, rcsGroupThreadId, originatingParticipantId);
35 mNewIcon = newIcon;
36 }
37
38 @Override
39 @VisibleForTesting(visibility = PROTECTED)
40 public RcsGroupThreadIconChangedEvent createRcsEvent() {
41 return new RcsGroupThreadIconChangedEvent(mTimestamp, new RcsGroupThread(mRcsGroupThreadId),
42 new RcsParticipant(mOriginatingParticipantId), mNewIcon);
43 }
44
Jeff Sharkey9e8f83d2019-02-28 12:06:45 -070045 public static final @android.annotation.NonNull Creator<RcsGroupThreadIconChangedEventDescriptor> CREATOR =
Leland Millerc39f23c2019-02-06 10:07:38 -080046 new Creator<RcsGroupThreadIconChangedEventDescriptor>() {
47 @Override
48 public RcsGroupThreadIconChangedEventDescriptor createFromParcel(Parcel in) {
49 return new RcsGroupThreadIconChangedEventDescriptor(in);
50 }
51
52 @Override
53 public RcsGroupThreadIconChangedEventDescriptor[] newArray(int size) {
54 return new RcsGroupThreadIconChangedEventDescriptor[size];
55 }
56 };
57
58 protected RcsGroupThreadIconChangedEventDescriptor(Parcel in) {
59 super(in);
60 mNewIcon = in.readParcelable(Uri.class.getClassLoader());
61 }
62
63 @Override
64 public int describeContents() {
65 return 0;
66 }
67
68 @Override
69 public void writeToParcel(Parcel dest, int flags) {
70 super.writeToParcel(dest, flags);
71 dest.writeParcelable(mNewIcon, flags);
72 }
73}