1/*
2 * Copyright (C) 2013 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 * Information about a camera
24 *
25 * @hide
26 */
27public class CameraInfo implements Parcelable {
28    // Can't parcel nested classes, so make this a top level class that composes
29    // CameraInfo.
30    public Camera.CameraInfo info = new Camera.CameraInfo();
31
32    @Override
33    public int describeContents() {
34        return 0;
35    }
36
37    @Override
38    public void writeToParcel(Parcel out, int flags) {
39        out.writeInt(info.facing);
40        out.writeInt(info.orientation);
41    }
42
43    public void readFromParcel(Parcel in) {
44        info.facing = in.readInt();
45        info.orientation = in.readInt();
46    }
47
48    public static final Parcelable.Creator<CameraInfo> CREATOR =
49            new Parcelable.Creator<CameraInfo>() {
50        @Override
51        public CameraInfo createFromParcel(Parcel in) {
52            CameraInfo info = new CameraInfo();
53            info.readFromParcel(in);
54
55            return info;
56        }
57
58        @Override
59        public CameraInfo[] newArray(int size) {
60            return new CameraInfo[size];
61        }
62    };
63};
64