blob: 1f92f6d9ebf1fef7ef3f8a0496caca549bdf8cac [file] [log] [blame]
Emilian Peevde62d842017-03-23 19:20:40 +00001/*
2 * Copyright (C) 2017 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.camera2.params;
18
19import android.os.Parcel;
20import android.os.Parcelable;
21import android.util.Log;
22
23/**
24 * A class for describing the vendor tag cache declared by a camera HAL module.
25 * Generally only used by the native side of
26 * android.hardware.camera2.impl.CameraMetadataNative
27 *
28 * @hide
29 */
30public final class VendorTagDescriptorCache implements Parcelable {
31
32 private VendorTagDescriptorCache(Parcel source) {
33 }
34
35 public static final Parcelable.Creator<VendorTagDescriptorCache> CREATOR =
36 new Parcelable.Creator<VendorTagDescriptorCache>() {
37 @Override
38 public VendorTagDescriptorCache createFromParcel(Parcel source) {
39 try {
40 VendorTagDescriptorCache vendorDescriptorCache = new VendorTagDescriptorCache(source);
41 return vendorDescriptorCache;
42 } catch (Exception e) {
43 Log.e(TAG, "Exception creating VendorTagDescriptorCache from parcel", e);
44 return null;
45 }
46 }
47
48 @Override
49 public VendorTagDescriptorCache[] newArray(int size) {
50 return new VendorTagDescriptorCache[size];
51 }
52 };
53
54 @Override
55 public int describeContents() {
56 return 0;
57 }
58
59 @Override
60 public void writeToParcel(Parcel dest, int flags) {
61 if (dest == null) {
62 throw new IllegalArgumentException("dest must not be null");
63 }
64 }
65
66 private static final String TAG = "VendorTagDescriptorCache";
67}