1 package com.netease.nimlib.sdk.msg.model;
3 import android.os.Parcel;
4 import android.os.Parcelable;
6 import androidx.annotation.Nullable;
8 import org.json.JSONException;
9 import org.json.JSONObject;
11 import java.io.Serializable;
24 private final boolean captureModel;
25 private final boolean captureManufacturer;
26 private final boolean captureBrand;
29 this.captureModel = captureModel;
30 this.captureManufacturer = captureManufacturer;
31 this.captureBrand = captureBrand;
49 return captureManufacturer;
62 captureModel = in.readInt() > 0;
63 captureManufacturer = in.readInt() > 0;
64 captureBrand = in.readInt() > 0;
74 dest.writeInt(captureModel ? 1 : 0);
75 dest.writeInt(captureManufacturer ? 1 : 0);
76 dest.writeInt(captureBrand ? 1 : 0);
79 public static final Creator<CaptureDeviceInfoConfig>
CREATOR =
new Creator<CaptureDeviceInfoConfig>() {
92 JSONObject
object =
new JSONObject();
94 object.putOpt(KEY_CAPTURE_MODEL, captureModel);
95 object.putOpt(KEY_CAPTURE_MANUFACTURER, captureManufacturer);
96 object.putOpt(KEY_CAPTURE_BRAND, captureBrand);
97 }
catch (JSONException e) {
104 if (
object == null) {
108 final boolean captureModel =
object.optBoolean(KEY_CAPTURE_MODEL,
false);
109 final boolean captureManufacturer =
object.optBoolean(KEY_CAPTURE_MANUFACTURER,
false);
110 final boolean captureBrand =
object.optBoolean(KEY_CAPTURE_BRAND,
false);
static final Creator< CaptureDeviceInfoConfig > CREATOR
CaptureDeviceInfoConfig(Parcel in)
static final String KEY_CAPTURE_BRAND
void writeToParcel(Parcel dest, int flags)
static CaptureDeviceInfoConfig fromJson(@Nullable JSONObject object)
boolean isCaptureBrand()
是否获取品牌信息。
static final String KEY_CAPTURE_MANUFACTURER
boolean isCaptureManufacturer()
是否获取制造商信息。
CaptureDeviceInfoConfig(boolean captureModel, boolean captureManufacturer, boolean captureBrand)
boolean isCaptureModel()
是否获取产品型号
static final String KEY_CAPTURE_MODEL