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