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      public String clientPackage;
35  
36      @Override
describeContents()37      public int describeContents() {
38          return 0;
39      }
40  
41      @Override
writeToParcel(Parcel out, int flags)42      public void writeToParcel(Parcel out, int flags) {
43          out.writeString(cameraId);
44          out.writeInt(status);
45          out.writeStringArray(unavailablePhysicalCameras);
46          out.writeString(clientPackage);
47      }
48  
readFromParcel(Parcel in)49      public void readFromParcel(Parcel in) {
50          cameraId = in.readString();
51          status = in.readInt();
52          unavailablePhysicalCameras = in.readStringArray();
53          clientPackage = in.readString();
54      }
55  
56      public static final @android.annotation.NonNull Parcelable.Creator<CameraStatus> CREATOR =
57              new Parcelable.Creator<CameraStatus>() {
58          @Override
59          public CameraStatus createFromParcel(Parcel in) {
60              CameraStatus status = new CameraStatus();
61              status.readFromParcel(in);
62  
63              return status;
64          }
65  
66          @Override
67          public CameraStatus[] newArray(int size) {
68              return new CameraStatus[size];
69          }
70      };
71  }
72