diff options
Diffstat (limited to 'media')
-rw-r--r-- | media/java/android/media/AudioTrack.java | 19 | ||||
-rw-r--r-- | media/java/android/media/soundtrigger/OWNERS | 1 | ||||
-rw-r--r-- | media/jni/soundpool/Android.bp | 13 |
3 files changed, 23 insertions, 10 deletions
diff --git a/media/java/android/media/AudioTrack.java b/media/java/android/media/AudioTrack.java index d7ef4549ca3f..1b05c3b57256 100644 --- a/media/java/android/media/AudioTrack.java +++ b/media/java/android/media/AudioTrack.java @@ -922,12 +922,21 @@ public class AudioTrack extends PlayerBase private final int mSyncId; /** + * A special content id for {@link #TunerConfiguration(int, int)} + * indicating audio is delivered + * from an {@code AudioTrack} write, not tunneled from the tuner stack. + */ + public static final int CONTENT_ID_NONE = 0; + + /** * Constructs a TunerConfiguration instance for use in {@link AudioTrack.Builder} * * @param contentId selects the audio stream to use. * The contentId may be obtained from - * {@link android.media.tv.tuner.filter.Filter#getId()}. - * This is always a positive number. + * {@link android.media.tv.tuner.filter.Filter#getId()}, + * such obtained id is always a positive number. + * If audio is to be delivered through an {@code AudioTrack} write + * then {@code CONTENT_ID_NONE} may be used. * @param syncId selects the clock to use for synchronization * of audio with other streams such as video. * The syncId may be obtained from @@ -936,10 +945,10 @@ public class AudioTrack extends PlayerBase */ @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public TunerConfiguration( - @IntRange(from = 1) int contentId, @IntRange(from = 1)int syncId) { - if (contentId < 1) { + @IntRange(from = 0) int contentId, @IntRange(from = 1)int syncId) { + if (contentId < 0) { throw new IllegalArgumentException( - "contentId " + contentId + " must be positive"); + "contentId " + contentId + " must be positive or CONTENT_ID_NONE"); } if (syncId < 1) { throw new IllegalArgumentException("syncId " + syncId + " must be positive"); diff --git a/media/java/android/media/soundtrigger/OWNERS b/media/java/android/media/soundtrigger/OWNERS index 6a351d396836..e5d037003ac4 100644 --- a/media/java/android/media/soundtrigger/OWNERS +++ b/media/java/android/media/soundtrigger/OWNERS @@ -1 +1,2 @@ +ytai@google.com elaurent@google.com diff --git a/media/jni/soundpool/Android.bp b/media/jni/soundpool/Android.bp index 7b498e027d1c..b3406cd89046 100644 --- a/media/jni/soundpool/Android.bp +++ b/media/jni/soundpool/Android.bp @@ -45,26 +45,30 @@ tidy_errors = [ "modernize-return-braced-init-list", "modernize-shrink-to-fit", "modernize-unary-static-assert", - "modernize-use-auto", // debatable - auto can obscure type + // "modernize-use-auto", // found in StreamManager.h, debatable - auto can obscure type "modernize-use-bool-literals", "modernize-use-default-member-init", "modernize-use-emplace", "modernize-use-equals-default", "modernize-use-equals-delete", - "modernize-use-nodiscard", + // "modernize-use-nodiscard", // found in SteamManager.h "modernize-use-noexcept", "modernize-use-nullptr", "modernize-use-override", //"modernize-use-trailing-return-type", // not necessarily more readable "modernize-use-transparent-functors", "modernize-use-uncaught-exceptions", - "modernize-use-using", + //"modernize-use-using", // found in SoundManager.h "performance-*", // Remove some pedantic stylistic requirements. "-google-readability-casting", // C++ casts not always necessary and may be verbose "-google-readability-todo", // do not require TODO(info) "-google-build-using-namespace", // Reenable and fix later. + + "-google-explicit-constructor", // found in StreamManager.h + "-misc-non-private-member-variables-in-classes", // found in SoundManager.h + "-performance-unnecessary-value-param", // found in StreamManager.h ] cc_defaults { @@ -96,8 +100,7 @@ cc_defaults { tidy_checks: tidy_errors, tidy_checks_as_errors: tidy_errors, tidy_flags: [ - "-format-style='file'", - "--header-filter='frameworks/base/media/jni/soundpool'", + "-format-style=file", ], } |