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  */
16 package android.hardware.camera2.impl;
17 
18 import android.hardware.camera2.impl.CameraMetadataNative;
19 
20 import android.os.Parcel;
21 import android.os.Parcelable;
22 
23 /**
24  * @hide
25  */
26 public class PhysicalCaptureResultInfo implements Parcelable {
27     private String cameraId;
28     private CameraMetadataNative cameraMetadata;
29 
30     public static final @android.annotation.NonNull Parcelable.Creator<PhysicalCaptureResultInfo> CREATOR =
31             new Parcelable.Creator<PhysicalCaptureResultInfo>() {
32         @Override
33         public PhysicalCaptureResultInfo createFromParcel(Parcel in) {
34             return new PhysicalCaptureResultInfo(in);
35         }
36 
37         @Override
38         public PhysicalCaptureResultInfo[] newArray(int size) {
39             return new PhysicalCaptureResultInfo[size];
40         }
41     };
42 
PhysicalCaptureResultInfo(Parcel in)43     private PhysicalCaptureResultInfo(Parcel in) {
44         readFromParcel(in);
45     }
46 
PhysicalCaptureResultInfo(String cameraId, CameraMetadataNative cameraMetadata)47     public PhysicalCaptureResultInfo(String cameraId, CameraMetadataNative cameraMetadata) {
48         this.cameraId = cameraId;
49         this.cameraMetadata = cameraMetadata;
50     }
51 
52     @Override
describeContents()53     public int describeContents() {
54         return 0;
55     }
56 
57     @Override
writeToParcel(Parcel dest, int flags)58     public void writeToParcel(Parcel dest, int flags) {
59         dest.writeString(cameraId);
60         cameraMetadata.writeToParcel(dest, flags);
61     }
62 
readFromParcel(Parcel in)63     public void readFromParcel(Parcel in) {
64         cameraId = in.readString();
65         cameraMetadata = new CameraMetadataNative();
66         cameraMetadata.readFromParcel(in);
67     }
68 
getCameraId()69     public String getCameraId() {
70         return cameraId;
71     }
72 
getCameraMetadata()73     public CameraMetadataNative getCameraMetadata() {
74         return cameraMetadata;
75     }
76 }
77