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