Eino-Ville Talvala | 5d2d778 | 2015-12-17 16:50:50 -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.camera2.params; |
| 18 | |
| 19 | import android.os.Parcel; |
| 20 | import android.os.Parcelable; |
| 21 | import android.util.Log; |
| 22 | |
| 23 | /** |
| 24 | * A class for describing the vendor tags 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 | */ |
| 30 | public final class VendorTagDescriptor implements Parcelable { |
| 31 | |
| 32 | private VendorTagDescriptor(Parcel source) { |
| 33 | } |
| 34 | |
Jeff Sharkey | 9e8f83d | 2019-02-28 12:06:45 -0700 | [diff] [blame] | 35 | public static final @android.annotation.NonNull Parcelable.Creator<VendorTagDescriptor> CREATOR = |
Eino-Ville Talvala | 5d2d778 | 2015-12-17 16:50:50 -0800 | [diff] [blame] | 36 | new Parcelable.Creator<VendorTagDescriptor>() { |
| 37 | @Override |
| 38 | public VendorTagDescriptor createFromParcel(Parcel source) { |
| 39 | try { |
| 40 | VendorTagDescriptor vendorDescriptor = new VendorTagDescriptor(source); |
| 41 | return vendorDescriptor; |
| 42 | } catch (Exception e) { |
| 43 | Log.e(TAG, "Exception creating VendorTagDescriptor from parcel", e); |
| 44 | return null; |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | @Override |
| 49 | public VendorTagDescriptor[] newArray(int size) { |
| 50 | return new VendorTagDescriptor[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 = "VendorTagDescriptor"; |
| 67 | } |