Debian Codegraph @

core/java/android/hardware/camera2/utils/CameraIdAndSessionConfiguration.java

raw symbols SCIP
1 /*
2 * Copyright (C) 2020 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 package android.hardware.camera2.utils;
17
18 import android.annotation.NonNull;
19 import android.hardware.camera2.params.SessionConfiguration;
20 import android.os.Parcel;
21 import android.os.Parcelable;
22
23 /**
24 * CameraIdAndSessionConfiguration
25 *
26 * Includes the pair of a cameraId and its corresponding SessionConfiguration, to be used with
27 * ICameraService.isConcurrentSessionConfigurationSupported.
28 * @hide
29 */
30 public class CameraIdAndSessionConfiguration implements Parcelable {
31
32 private String mCameraId;
33 private SessionConfiguration mSessionConfiguration;
34
35 public CameraIdAndSessionConfiguration(@NonNull String cameraId,
36 @NonNull SessionConfiguration sessionConfiguration) {
37 mCameraId = cameraId;
38 mSessionConfiguration = sessionConfiguration;
39 }
40
41 public static final @NonNull
42 Parcelable.Creator<CameraIdAndSessionConfiguration> CREATOR =
43 new Parcelable.Creator<CameraIdAndSessionConfiguration>() {
44 @Override
45 public CameraIdAndSessionConfiguration createFromParcel(Parcel in) {
46 return new CameraIdAndSessionConfiguration(in);
47 }
48
49 @Override
50 public CameraIdAndSessionConfiguration[] newArray(int size) {
51 return new CameraIdAndSessionConfiguration[size];
52 }
53 };
54
55 private CameraIdAndSessionConfiguration(Parcel in) {
56 readFromParcel(in);
57 }
58
59 @Override
60 public int describeContents() {
61 return 0;
62 }
63
64 @Override
65 public void writeToParcel(Parcel dest, int flags) {
66 dest.writeString(mCameraId);
67 mSessionConfiguration.writeToParcel(dest, flags);
68 }
69
70 /**
71 * helper for CREATOR
72 */
73 public void readFromParcel(Parcel in) {
74 mCameraId = in.readString();
75 mSessionConfiguration = SessionConfiguration.CREATOR.createFromParcel(in);
76 }
77
78 public @NonNull String getCameraId() {
79 return mCameraId;
80 }
81
82 public @NonNull SessionConfiguration getSessionConfiguration() {
83 return mSessionConfiguration;
84 }
85 }