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