1 /*
2  * Copyright (C) 2016 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.hardware;
18 
19 import android.os.Parcel;
20 import android.os.Parcelable;
21 
22 /**
23  * Status information about a camera.
24  *
25  * Contains the name of the camera device, and its current status, one of the
26  * ICameraServiceListener.STATUS_ values.
27  *
28  * @hide
29  */
30 public class CameraStatus implements Parcelable {
31     public String cameraId;
32     public int status;
33     public String[] unavailablePhysicalCameras;
34 
35     @Override
describeContents()36     public int describeContents() {
37         return 0;
38     }
39 
40     @Override
writeToParcel(Parcel out, int flags)41     public void writeToParcel(Parcel out, int flags) {
42         out.writeString(cameraId);
43         out.writeInt(status);
44         out.writeStringArray(unavailablePhysicalCameras);
45     }
46 
readFromParcel(Parcel in)47     public void readFromParcel(Parcel in) {
48         cameraId = in.readString();
49         status = in.readInt();
50         unavailablePhysicalCameras = in.readStringArray();
51     }
52 
53     public static final @android.annotation.NonNull Parcelable.Creator<CameraStatus> CREATOR =
54             new Parcelable.Creator<CameraStatus>() {
55         @Override
56         public CameraStatus createFromParcel(Parcel in) {
57             CameraStatus status = new CameraStatus();
58             status.readFromParcel(in);
59 
60             return status;
61         }
62 
63         @Override
64         public CameraStatus[] newArray(int size) {
65             return new CameraStatus[size];
66         }
67     };
68 };
69