blob: 979634a069dfda8802962c8732314995a11899b5 [file] [log] [blame]
Sahin Caliskan2f932d72019-02-06 10:11:39 -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 */
16
17package android.telephony.ims;
18
19import android.os.Parcel;
20import android.os.Parcelable;
21
22/**
23 * {@link RcsOutgoingMessageCreationParams} is a collection of parameters that should be passed
24 * into {@link RcsThread#addOutgoingMessage(RcsOutgoingMessageCreationParams)} to generate an
25 * {@link RcsOutgoingMessage} on that {@link RcsThread}
Sahin Caliskan2f932d72019-02-06 10:11:39 -080026 */
27public final class RcsOutgoingMessageCreationParams extends RcsMessageCreationParams
28 implements Parcelable {
29 /**
30 * A builder to instantiate and persist an {@link RcsOutgoingMessage}
31 */
32 public static class Builder extends RcsMessageCreationParams.Builder {
33
34 /**
35 * Creates a new {@link Builder} to create an instance of
36 * {@link RcsOutgoingMessageCreationParams}.
37 *
38 * @param originationTimestamp The timestamp of {@link RcsMessage} creation. The origination
39 * timestamp value in milliseconds passed after midnight,
40 * January 1, 1970 UTC
41 * @param subscriptionId The subscription ID that was used to send or receive this
42 * {@link RcsMessage}
43 * @see android.telephony.SubscriptionInfo#getSubscriptionId()
44 */
45 public Builder(long originationTimestamp, int subscriptionId) {
46 super(originationTimestamp, subscriptionId);
47 }
48
49 /**
50 * Creates configuration parameters for a new message.
51 */
52 public RcsOutgoingMessageCreationParams build() {
53 return new RcsOutgoingMessageCreationParams(this);
54 }
55 }
56
57 private RcsOutgoingMessageCreationParams(Builder builder) {
58 super(builder);
59 }
60
61 private RcsOutgoingMessageCreationParams(Parcel in) {
62 super(in);
63 }
64
65 public static final Creator<RcsOutgoingMessageCreationParams> CREATOR =
66 new Creator<RcsOutgoingMessageCreationParams>() {
67 @Override
68 public RcsOutgoingMessageCreationParams createFromParcel(Parcel in) {
69 return new RcsOutgoingMessageCreationParams(in);
70 }
71
72 @Override
73 public RcsOutgoingMessageCreationParams[] newArray(int size) {
74 return new RcsOutgoingMessageCreationParams[size];
75 }
76 };
77
78 @Override
79 public int describeContents() {
80 return 0;
81 }
82
83 @Override
84 public void writeToParcel(Parcel dest, int flags) {
85 super.writeToParcel(dest);
86 }
87}