Felipe Leme | ecb08be | 2018-11-27 15:48:47 -0800 | [diff] [blame] | 1 | /* |
| 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 Leme | 749b889 | 2018-12-03 16:30:30 -0800 | [diff] [blame^] | 16 | package android.service.contentcapture; |
Felipe Leme | ecb08be | 2018-11-27 15:48:47 -0800 | [diff] [blame] | 17 | |
| 18 | import android.annotation.NonNull; |
| 19 | import android.annotation.SystemApi; |
| 20 | import android.os.Parcel; |
| 21 | import android.os.Parcelable; |
Felipe Leme | 749b889 | 2018-12-03 16:30:30 -0800 | [diff] [blame^] | 22 | import android.view.contentcapture.ContentCaptureEvent; |
Felipe Leme | ecb08be | 2018-11-27 15:48:47 -0800 | [diff] [blame] | 23 | |
| 24 | import java.util.List; |
| 25 | |
| 26 | /** |
| 27 | * Batch of content capture events. |
| 28 | * |
| 29 | * @hide |
| 30 | */ |
| 31 | @SystemApi |
| 32 | public 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 | } |