blob: 29802cb33c3804c5832e3fdd93abd0ffb4ea008f [file] [log] [blame]
Eino-Ville Talvala283ae234f2016-12-08 13:38:52 -08001/*
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
17package android.hardware;
18
19import android.os.Parcel;
20import 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 */
30public class CameraStatus implements Parcelable {
31 public String cameraId;
32 public int status;
Shuzhen Wang34bf53f2020-01-15 10:49:52 -080033 public String[] unavailablePhysicalCameras;
Eino-Ville Talvala283ae234f2016-12-08 13:38:52 -080034
35 @Override
36 public int describeContents() {
37 return 0;
38 }
39
40 @Override
41 public void writeToParcel(Parcel out, int flags) {
42 out.writeString(cameraId);
43 out.writeInt(status);
Shuzhen Wang34bf53f2020-01-15 10:49:52 -080044 out.writeStringArray(unavailablePhysicalCameras);
Eino-Ville Talvala283ae234f2016-12-08 13:38:52 -080045 }
46
47 public void readFromParcel(Parcel in) {
48 cameraId = in.readString();
49 status = in.readInt();
Shuzhen Wang34bf53f2020-01-15 10:49:52 -080050 unavailablePhysicalCameras = in.readStringArray();
Eino-Ville Talvala283ae234f2016-12-08 13:38:52 -080051 }
52
Jeff Sharkey9e8f83d2019-02-28 12:06:45 -070053 public static final @android.annotation.NonNull Parcelable.Creator<CameraStatus> CREATOR =
Eino-Ville Talvala283ae234f2016-12-08 13:38:52 -080054 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};