Eino-Ville Talvala | 283ae234f | 2016-12-08 13:38:52 -0800 | [diff] [blame] | 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; |
Shuzhen Wang | 34bf53f | 2020-01-15 10:49:52 -0800 | [diff] [blame] | 33 | public String[] unavailablePhysicalCameras; |
Eino-Ville Talvala | 283ae234f | 2016-12-08 13:38:52 -0800 | [diff] [blame] | 34 | |
| 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 Wang | 34bf53f | 2020-01-15 10:49:52 -0800 | [diff] [blame] | 44 | out.writeStringArray(unavailablePhysicalCameras); |
Eino-Ville Talvala | 283ae234f | 2016-12-08 13:38:52 -0800 | [diff] [blame] | 45 | } |
| 46 | |
| 47 | public void readFromParcel(Parcel in) { |
| 48 | cameraId = in.readString(); |
| 49 | status = in.readInt(); |
Shuzhen Wang | 34bf53f | 2020-01-15 10:49:52 -0800 | [diff] [blame] | 50 | unavailablePhysicalCameras = in.readStringArray(); |
Eino-Ville Talvala | 283ae234f | 2016-12-08 13:38:52 -0800 | [diff] [blame] | 51 | } |
| 52 | |
Jeff Sharkey | 9e8f83d | 2019-02-28 12:06:45 -0700 | [diff] [blame] | 53 | public static final @android.annotation.NonNull Parcelable.Creator<CameraStatus> CREATOR = |
Eino-Ville Talvala | 283ae234f | 2016-12-08 13:38:52 -0800 | [diff] [blame] | 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 | }; |