| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.service.voice; |
| 18 |
|
| 19 |
import android.annotation.IntDef; |
| 20 |
import android.annotation.SystemApi; |
| 21 |
import android.os.Parcelable; |
| 22 |
|
| 23 |
import com.android.internal.util.DataClass; |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
@DataClass( |
| 31 |
genConstructor = false, |
| 32 |
genBuilder = true, |
| 33 |
genEqualsHashCode = true, |
| 34 |
genHiddenConstDefs = true, |
| 35 |
genParcelable = true, |
| 36 |
genToString = true |
| 37 |
) |
| 38 |
@SystemApi |
| 39 |
public final class HotwordRejectedResult implements Parcelable { |
| 40 |
|
| 41 |
|
| 42 |
public static final int CONFIDENCE_LEVEL_NONE = 0; |
| 43 |
|
| 44 |
|
| 45 |
public static final int CONFIDENCE_LEVEL_LOW = 1; |
| 46 |
|
| 47 |
|
| 48 |
public static final int CONFIDENCE_LEVEL_MEDIUM = 2; |
| 49 |
|
| 50 |
|
| 51 |
public static final int CONFIDENCE_LEVEL_HIGH = 3; |
| 52 |
|
| 53 |
|
| 54 |
@IntDef(prefix = {"CONFIDENCE_LEVEL_"}, value = { |
| 55 |
CONFIDENCE_LEVEL_NONE, |
| 56 |
CONFIDENCE_LEVEL_LOW, |
| 57 |
CONFIDENCE_LEVEL_MEDIUM, |
| 58 |
CONFIDENCE_LEVEL_HIGH |
| 59 |
}) |
| 60 |
@interface HotwordConfidenceLevelValue { |
| 61 |
} |
| 62 |
|
| 63 |
|
| 64 |
@HotwordConfidenceLevelValue |
| 65 |
private final int mConfidenceLevel; |
| 66 |
private static int defaultConfidenceLevel() { |
| 67 |
return CONFIDENCE_LEVEL_NONE; |
| 68 |
} |
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
@IntDef(prefix = "CONFIDENCE_LEVEL_", value = { |
| 87 |
CONFIDENCE_LEVEL_NONE, |
| 88 |
CONFIDENCE_LEVEL_LOW, |
| 89 |
CONFIDENCE_LEVEL_MEDIUM, |
| 90 |
CONFIDENCE_LEVEL_HIGH |
| 91 |
}) |
| 92 |
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) |
| 93 |
@DataClass.Generated.Member |
| 94 |
public @interface ConfidenceLevel {} |
| 95 |
|
| 96 |
|
| 97 |
@DataClass.Generated.Member |
| 98 |
public static String confidenceLevelToString(@ConfidenceLevel int value) { |
| 99 |
switch (value) { |
| 100 |
case CONFIDENCE_LEVEL_NONE: |
| 101 |
return "CONFIDENCE_LEVEL_NONE"; |
| 102 |
case CONFIDENCE_LEVEL_LOW: |
| 103 |
return "CONFIDENCE_LEVEL_LOW"; |
| 104 |
case CONFIDENCE_LEVEL_MEDIUM: |
| 105 |
return "CONFIDENCE_LEVEL_MEDIUM"; |
| 106 |
case CONFIDENCE_LEVEL_HIGH: |
| 107 |
return "CONFIDENCE_LEVEL_HIGH"; |
| 108 |
default: return Integer.toHexString(value); |
| 109 |
} |
| 110 |
} |
| 111 |
|
| 112 |
@DataClass.Generated.Member |
| 113 |
HotwordRejectedResult( |
| 114 |
@HotwordConfidenceLevelValue int confidenceLevel) { |
| 115 |
this.mConfidenceLevel = confidenceLevel; |
| 116 |
com.android.internal.util.AnnotationValidations.validate( |
| 117 |
HotwordConfidenceLevelValue.class, null, mConfidenceLevel); |
| 118 |
|
| 119 |
|
| 120 |
} |
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
@DataClass.Generated.Member |
| 126 |
public @HotwordConfidenceLevelValue int getConfidenceLevel() { |
| 127 |
return mConfidenceLevel; |
| 128 |
} |
| 129 |
|
| 130 |
@Override |
| 131 |
@DataClass.Generated.Member |
| 132 |
public String toString() { |
| 133 |
|
| 134 |
|
| 135 |
|
| 136 |
return "HotwordRejectedResult { " + |
| 137 |
"confidenceLevel = " + mConfidenceLevel + |
| 138 |
" }"; |
| 139 |
} |
| 140 |
|
| 141 |
@Override |
| 142 |
@DataClass.Generated.Member |
| 143 |
public boolean equals(@android.annotation.Nullable Object o) { |
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
if (this == o) return true; |
| 149 |
if (o == null || getClass() != o.getClass()) return false; |
| 150 |
@SuppressWarnings("unchecked") |
| 151 |
HotwordRejectedResult that = (HotwordRejectedResult) o; |
| 152 |
|
| 153 |
return true |
| 154 |
&& mConfidenceLevel == that.mConfidenceLevel; |
| 155 |
} |
| 156 |
|
| 157 |
@Override |
| 158 |
@DataClass.Generated.Member |
| 159 |
public int hashCode() { |
| 160 |
|
| 161 |
|
| 162 |
|
| 163 |
int _hash = 1; |
| 164 |
_hash = 31 * _hash + mConfidenceLevel; |
| 165 |
return _hash; |
| 166 |
} |
| 167 |
|
| 168 |
@Override |
| 169 |
@DataClass.Generated.Member |
| 170 |
public void writeToParcel(@android.annotation.NonNull android.os.Parcel dest, int flags) { |
| 171 |
|
| 172 |
|
| 173 |
|
| 174 |
dest.writeInt(mConfidenceLevel); |
| 175 |
} |
| 176 |
|
| 177 |
@Override |
| 178 |
@DataClass.Generated.Member |
| 179 |
public int describeContents() { return 0; } |
| 180 |
|
| 181 |
|
| 182 |
@SuppressWarnings({"unchecked", "RedundantCast"}) |
| 183 |
@DataClass.Generated.Member |
| 184 |
HotwordRejectedResult(@android.annotation.NonNull android.os.Parcel in) { |
| 185 |
|
| 186 |
|
| 187 |
|
| 188 |
int confidenceLevel = in.readInt(); |
| 189 |
|
| 190 |
this.mConfidenceLevel = confidenceLevel; |
| 191 |
com.android.internal.util.AnnotationValidations.validate( |
| 192 |
HotwordConfidenceLevelValue.class, null, mConfidenceLevel); |
| 193 |
|
| 194 |
|
| 195 |
} |
| 196 |
|
| 197 |
@DataClass.Generated.Member |
| 198 |
public static final @android.annotation.NonNull Parcelable.Creator<HotwordRejectedResult> CREATOR |
| 199 |
= new Parcelable.Creator<HotwordRejectedResult>() { |
| 200 |
@Override |
| 201 |
public HotwordRejectedResult[] newArray(int size) { |
| 202 |
return new HotwordRejectedResult[size]; |
| 203 |
} |
| 204 |
|
| 205 |
@Override |
| 206 |
public HotwordRejectedResult createFromParcel(@android.annotation.NonNull android.os.Parcel in) { |
| 207 |
return new HotwordRejectedResult(in); |
| 208 |
} |
| 209 |
}; |
| 210 |
|
| 211 |
|
| 212 |
|
| 213 |
|
| 214 |
@SuppressWarnings("WeakerAccess") |
| 215 |
@DataClass.Generated.Member |
| 216 |
public static final class Builder { |
| 217 |
|
| 218 |
private @HotwordConfidenceLevelValue int mConfidenceLevel; |
| 219 |
|
| 220 |
private long mBuilderFieldsSet = 0L; |
| 221 |
|
| 222 |
public Builder() { |
| 223 |
} |
| 224 |
|
| 225 |
|
| 226 |
|
| 227 |
|
| 228 |
@DataClass.Generated.Member |
| 229 |
public @android.annotation.NonNull Builder setConfidenceLevel(@HotwordConfidenceLevelValue int value) { |
| 230 |
checkNotUsed(); |
| 231 |
mBuilderFieldsSet |= 0x1; |
| 232 |
mConfidenceLevel = value; |
| 233 |
return this; |
| 234 |
} |
| 235 |
|
| 236 |
|
| 237 |
public @android.annotation.NonNull HotwordRejectedResult build() { |
| 238 |
checkNotUsed(); |
| 239 |
mBuilderFieldsSet |= 0x2; |
| 240 |
|
| 241 |
if ((mBuilderFieldsSet & 0x1) == 0) { |
| 242 |
mConfidenceLevel = defaultConfidenceLevel(); |
| 243 |
} |
| 244 |
HotwordRejectedResult o = new HotwordRejectedResult( |
| 245 |
mConfidenceLevel); |
| 246 |
return o; |
| 247 |
} |
| 248 |
|
| 249 |
private void checkNotUsed() { |
| 250 |
if ((mBuilderFieldsSet & 0x2) != 0) { |
| 251 |
throw new IllegalStateException( |
| 252 |
"This Builder should not be reused. Use a new Builder instance instead"); |
| 253 |
} |
| 254 |
} |
| 255 |
} |
| 256 |
|
| 257 |
@DataClass.Generated( |
| 258 |
time = 1621961370106L, |
| 259 |
codegenVersion = "1.0.23", |
| 260 |
sourceFile = "frameworks/base/core/java/android/service/voice/HotwordRejectedResult.java", |
| 261 |
inputSignatures = "public static final int CONFIDENCE_LEVEL_NONE\npublic static final int CONFIDENCE_LEVEL_LOW\npublic static final int CONFIDENCE_LEVEL_MEDIUM\npublic static final int CONFIDENCE_LEVEL_HIGH\nprivate final @android.service.voice.HotwordRejectedResult.HotwordConfidenceLevelValue int mConfidenceLevel\nprivate static int defaultConfidenceLevel()\nclass HotwordRejectedResult extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genConstructor=false, genBuilder=true, genEqualsHashCode=true, genHiddenConstDefs=true, genParcelable=true, genToString=true)") |
| 262 |
@Deprecated |
| 263 |
private void __metadata() {} |
| 264 |
|
| 265 |
|
| 266 |
|
| 267 |
|
| 268 |
|
| 269 |
} |