summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorAndrea Ambu <andreaambu@google.com>2021-04-29 17:05:49 +0100
committerAndrea Ambu <andreaambu@google.com>2021-05-05 10:24:51 +0100
commitc3f72bcf3d970a8b5c306195ed5510523f2ed63c (patch)
tree9c0f92bcb7cbd047a73d9e87ba6a073431911b10 /core/java/android
parentb2de16f23fd39ad3fdb540e92a02f219597aa1f5 (diff)
hotword: Fix inconsistent @NonNull and API comment
- setMediaSyncEvent does not need to accept any @Nullable param. - getMediaSyncEvent return @Nullable. This CL manually define the getter to allow for the @Nullable/@NotNull and doc asymmetry. Bug: 186469575 Fix: 186469575 Test: CtsVoiceInteractionTestCases Change-Id: Icc0b6282e6ee13c8fcaa7dea763a39c430e66644
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/service/voice/HotwordDetectedResult.java32
1 files changed, 14 insertions, 18 deletions
diff --git a/core/java/android/service/voice/HotwordDetectedResult.java b/core/java/android/service/voice/HotwordDetectedResult.java
index e50de1c30ba0..ee82c374691b 100644
--- a/core/java/android/service/voice/HotwordDetectedResult.java
+++ b/core/java/android/service/voice/HotwordDetectedResult.java
@@ -57,8 +57,6 @@ public final class HotwordDetectedResult implements Parcelable {
* A {@code MediaSyncEvent} that allows the {@link HotwordDetector} to recapture the audio
* that contains the hotword trigger. This must be obtained using
* {@link android.media.AudioRecord#shareAudioHistory(String, long)}.
- * <p>
- * This can be {@code null} if reprocessing the hotword trigger isn't required.
*/
@Nullable
private MediaSyncEvent mMediaSyncEvent = null;
@@ -150,6 +148,18 @@ public final class HotwordDetectedResult implements Parcelable {
return 50;
}
+ /**
+ * A {@code MediaSyncEvent} that allows the {@link HotwordDetector} to recapture the audio
+ * that contains the hotword trigger. This must be obtained using
+ * {@link android.media.AudioRecord#shareAudioHistory(String, long)}.
+ * <p>
+ * This can be {@code null} if reprocessing the hotword trigger isn't required.
+ */
+ // Suppress codegen to make javadoc consistent. Getter returns @Nullable, setter accepts
+ // @NonNull only, and by default codegen would use the same javadoc on both.
+ public @Nullable MediaSyncEvent getMediaSyncEvent() {
+ return mMediaSyncEvent;
+ }
// Code below generated by codegen v1.0.23.
@@ -198,18 +208,6 @@ public final class HotwordDetectedResult implements Parcelable {
}
/**
- * A {@code MediaSyncEvent} that allows the {@link HotwordDetector} to recapture the audio
- * that contains the hotword trigger. This must be obtained using
- * {@link android.media.AudioRecord#shareAudioHistory(String, long)}.
- * <p>
- * This can be {@code null} if reprocessing the hotword trigger isn't required.
- */
- @DataClass.Generated.Member
- public @Nullable MediaSyncEvent getMediaSyncEvent() {
- return mMediaSyncEvent;
- }
-
- /**
* Byte offset in the audio stream when the trigger event happened.
*/
@DataClass.Generated.Member
@@ -425,8 +423,6 @@ public final class HotwordDetectedResult implements Parcelable {
* A {@code MediaSyncEvent} that allows the {@link HotwordDetector} to recapture the audio
* that contains the hotword trigger. This must be obtained using
* {@link android.media.AudioRecord#shareAudioHistory(String, long)}.
- * <p>
- * This can be {@code null} if reprocessing the hotword trigger isn't required.
*/
@DataClass.Generated.Member
public @NonNull Builder setMediaSyncEvent(@NonNull MediaSyncEvent value) {
@@ -555,10 +551,10 @@ public final class HotwordDetectedResult implements Parcelable {
}
@DataClass.Generated(
- time = 1619059352684L,
+ time = 1620133603958L,
codegenVersion = "1.0.23",
sourceFile = "frameworks/base/core/java/android/service/voice/HotwordDetectedResult.java",
- inputSignatures = "public static final int BYTE_OFFSET_UNSET\nprivate final @android.service.voice.HotwordDetector.HotwordConfidenceLevelValue int mConfidenceLevel\nprivate @android.annotation.Nullable android.media.MediaSyncEvent mMediaSyncEvent\nprivate final int mByteOffset\nprivate final int mScore\nprivate final int mPersonalizedScore\nprivate final int mHotwordPhraseId\nprivate final @android.annotation.NonNull android.os.PersistableBundle mExtras\nprivate static int defaultConfidenceLevel()\nprivate static int defaultByteOffset()\nprivate static int defaultScore()\nprivate static int defaultPersonalizedScore()\npublic static int getMaxScore()\nprivate static int defaultHotwordPhraseId()\npublic static int getMaxHotwordPhraseId()\nprivate static android.os.PersistableBundle defaultExtras()\npublic static int getMaxBundleSize()\nclass HotwordDetectedResult 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)")
+ inputSignatures = "public static final int BYTE_OFFSET_UNSET\nprivate final @android.service.voice.HotwordDetector.HotwordConfidenceLevelValue int mConfidenceLevel\nprivate @android.annotation.Nullable android.media.MediaSyncEvent mMediaSyncEvent\nprivate final int mByteOffset\nprivate final int mScore\nprivate final int mPersonalizedScore\nprivate final int mHotwordPhraseId\nprivate final @android.annotation.NonNull android.os.PersistableBundle mExtras\nprivate static int defaultConfidenceLevel()\nprivate static int defaultByteOffset()\nprivate static int defaultScore()\nprivate static int defaultPersonalizedScore()\npublic static int getMaxScore()\nprivate static int defaultHotwordPhraseId()\npublic static int getMaxHotwordPhraseId()\nprivate static android.os.PersistableBundle defaultExtras()\npublic static int getMaxBundleSize()\npublic @android.annotation.Nullable android.media.MediaSyncEvent getMediaSyncEvent()\nclass HotwordDetectedResult 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)")
@Deprecated
private void __metadata() {}