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

Commit ff2577da authored by Eric Laurent's avatar Eric Laurent
Browse files

unhide API for synchronous audio capture.

unhide MediaSyncEvent class and AudioRecord.startRecording() method with synchronization
event allowing to start audio capture upon occurence of a specific event.
So far the only event defined is playback presentation complete but more events and synchronized
playback/capture methods could be defined in the future.

Change-Id: If05fc6cd125dd9afad451727f792a3fd9e916bef
parent a46f7680
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -10743,6 +10743,7 @@ package android.media {
    method public void setRecordPositionUpdateListener(android.media.AudioRecord.OnRecordPositionUpdateListener);
    method public void setRecordPositionUpdateListener(android.media.AudioRecord.OnRecordPositionUpdateListener, android.os.Handler);
    method public void startRecording() throws java.lang.IllegalStateException;
    method public void startRecording(android.media.MediaSyncEvent) throws java.lang.IllegalStateException;
    method public void stop() throws java.lang.IllegalStateException;
    field public static final int ERROR = -1; // 0xffffffff
    field public static final int ERROR_BAD_VALUE = -2; // 0xfffffffe
@@ -11288,6 +11289,15 @@ package android.media {
    method public abstract void onScanCompleted(java.lang.String, android.net.Uri);
  }
  public class MediaSyncEvent {
    method public static android.media.MediaSyncEvent createEvent(int) throws java.lang.IllegalArgumentException;
    method public int getAudioSessionId();
    method public int getType();
    method public android.media.MediaSyncEvent setAudioSessionId(int) throws java.lang.IllegalArgumentException;
    field public static final int SYNC_EVENT_NONE = 0; // 0x0
    field public static final int SYNC_EVENT_PRESENTATION_COMPLETE = 1; // 0x1
  }
  public class RemoteControlClient {
    ctor public RemoteControlClient(android.app.PendingIntent);
    ctor public RemoteControlClient(android.app.PendingIntent, android.os.Looper);
@@ -11405,6 +11415,7 @@ package android.media {
  public class ToneGenerator {
    ctor public ToneGenerator(int, int);
    method public final int getAudioSessionId();
    method public void release();
    method public boolean startTone(int);
    method public boolean startTone(int, int);
+0 −1
Original line number Diff line number Diff line
@@ -530,7 +530,6 @@ public class AudioRecord
     * @throws IllegalStateException
     * @param syncEvent event that triggers the capture.
     * @see MediaSyncEvent
     * @hide
     */
    public void startRecording(MediaSyncEvent syncEvent)
    throws IllegalStateException {
+1 −2
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ package android.media;
 * only when the playback on a particular audio session is complete.
 * The audio session ID is retrieved from a player (e.g {@link MediaPlayer}, {@link AudioTrack} or
 * {@link ToneGenerator}) by use of the getAudioSessionId() method.
 * @hide
 */
public class MediaSyncEvent {

@@ -49,7 +48,7 @@ public class MediaSyncEvent {
     * <p>The type specifies which kind of event is monitored.
     * For instance, event {@link #SYNC_EVENT_PRESENTATION_COMPLETE} corresponds to the audio being
     * presented to the user on a particular audio session.
     * @param type the synchronization event type.
     * @param eventType the synchronization event type.
     * @return the MediaSyncEvent created.
     * @throws java.lang.IllegalArgumentException
     */
+0 −1
Original line number Diff line number Diff line
@@ -880,7 +880,6 @@ public class ToneGenerator
    *
    * @return the ID of the audio session this ToneGenerator belongs to or 0 if an error
    * occured.
    * @hide
    */
    public native final int getAudioSessionId();