Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c564d5e5 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "AudioManager: annotate legacy callback registrations"

parents 3a9f1e91 1ec66182
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -23803,9 +23803,9 @@ package android.media {
    method public void loadSoundEffects();
    method public void loadSoundEffects();
    method public void playSoundEffect(int);
    method public void playSoundEffect(int);
    method public void playSoundEffect(int, float);
    method public void playSoundEffect(int, float);
    method public void registerAudioDeviceCallback(android.media.AudioDeviceCallback, android.os.Handler);
    method public void registerAudioDeviceCallback(android.media.AudioDeviceCallback, @Nullable android.os.Handler);
    method public void registerAudioPlaybackCallback(@NonNull android.media.AudioManager.AudioPlaybackCallback, android.os.Handler);
    method public void registerAudioPlaybackCallback(@NonNull android.media.AudioManager.AudioPlaybackCallback, @Nullable android.os.Handler);
    method public void registerAudioRecordingCallback(@NonNull android.media.AudioManager.AudioRecordingCallback, android.os.Handler);
    method public void registerAudioRecordingCallback(@NonNull android.media.AudioManager.AudioRecordingCallback, @Nullable android.os.Handler);
    method @Deprecated public void registerMediaButtonEventReceiver(android.content.ComponentName);
    method @Deprecated public void registerMediaButtonEventReceiver(android.content.ComponentName);
    method @Deprecated public void registerMediaButtonEventReceiver(android.app.PendingIntent);
    method @Deprecated public void registerMediaButtonEventReceiver(android.app.PendingIntent);
    method @Deprecated public void registerRemoteControlClient(android.media.RemoteControlClient);
    method @Deprecated public void registerRemoteControlClient(android.media.RemoteControlClient);
+5 −3
Original line number Original line Diff line number Diff line
@@ -3645,7 +3645,8 @@ public class AudioManager {
     * the callback. If <code>null</code>, the {@link Handler} associated with the main
     * the callback. If <code>null</code>, the {@link Handler} associated with the main
     * {@link Looper} will be used.
     * {@link Looper} will be used.
     */
     */
    public void registerAudioPlaybackCallback(@NonNull AudioPlaybackCallback cb, Handler handler)
    public void registerAudioPlaybackCallback(@NonNull AudioPlaybackCallback cb,
                                              @Nullable Handler handler)
    {
    {
        if (cb == null) {
        if (cb == null) {
            throw new IllegalArgumentException("Illegal null AudioPlaybackCallback argument");
            throw new IllegalArgumentException("Illegal null AudioPlaybackCallback argument");
@@ -3834,7 +3835,8 @@ public class AudioManager {
     * the callback. If <code>null</code>, the {@link Handler} associated with the main
     * the callback. If <code>null</code>, the {@link Handler} associated with the main
     * {@link Looper} will be used.
     * {@link Looper} will be used.
     */
     */
    public void registerAudioRecordingCallback(@NonNull AudioRecordingCallback cb, Handler handler)
    public void registerAudioRecordingCallback(@NonNull AudioRecordingCallback cb,
                                               @Nullable Handler handler)
    {
    {
        if (cb == null) {
        if (cb == null) {
            throw new IllegalArgumentException("Illegal null AudioRecordingCallback argument");
            throw new IllegalArgumentException("Illegal null AudioRecordingCallback argument");
@@ -5172,7 +5174,7 @@ public class AudioManager {
     * {@link Looper} will be used.
     * {@link Looper} will be used.
     */
     */
    public void registerAudioDeviceCallback(AudioDeviceCallback callback,
    public void registerAudioDeviceCallback(AudioDeviceCallback callback,
            android.os.Handler handler) {
            @Nullable Handler handler) {
        synchronized (mDeviceCallbacks) {
        synchronized (mDeviceCallbacks) {
            if (callback != null && !mDeviceCallbacks.containsKey(callback)) {
            if (callback != null && !mDeviceCallbacks.containsKey(callback)) {
                if (mDeviceCallbacks.size() == 0) {
                if (mDeviceCallbacks.size() == 0) {