blob: df58f52dc59c3d6ced79898966473a4ce53b45f6 [file] [log] [blame]
Felipe Lemeecb08be2018-11-27 15:48:47 -08001/*
2 * Copyright (C) 2018 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 */
Felipe Leme749b8892018-12-03 16:30:30 -080016package android.service.contentcapture;
Felipe Lemeecb08be2018-11-27 15:48:47 -080017
18import android.annotation.NonNull;
19import android.annotation.SystemApi;
20import android.os.Parcel;
21import android.os.Parcelable;
Felipe Leme749b8892018-12-03 16:30:30 -080022import android.view.contentcapture.ContentCaptureEvent;
Felipe Lemeecb08be2018-11-27 15:48:47 -080023
24import java.util.List;
25
26/**
27 * Batch of content capture events.
28 *
29 * @hide
30 */
31@SystemApi
32public final class ContentCaptureEventsRequest implements Parcelable {
33
34 private final List<ContentCaptureEvent> mEvents;
35
36 /** @hide */
37 public ContentCaptureEventsRequest(@NonNull List<ContentCaptureEvent> events) {
38 mEvents = events;
39 }
40
41 /**
42 * Gets the events.
43 */
44 @NonNull
45 public List<ContentCaptureEvent> getEvents() {
46 return mEvents;
47 }
48
49 @Override
50 public int describeContents() {
51 return 0;
52 }
53
54 @Override
55 public void writeToParcel(Parcel parcel, int flags) {
56 parcel.writeTypedList(mEvents, flags);
57 }
58
59 public static final Parcelable.Creator<ContentCaptureEventsRequest> CREATOR =
60 new Parcelable.Creator<ContentCaptureEventsRequest>() {
61
62 @Override
63 public ContentCaptureEventsRequest createFromParcel(Parcel parcel) {
64 return new ContentCaptureEventsRequest(parcel
65 .createTypedArrayList(ContentCaptureEvent.CREATOR));
66 }
67
68 @Override
69 public ContentCaptureEventsRequest[] newArray(int size) {
70 return new ContentCaptureEventsRequest[size];
71 }
72 };
73}