Loading api/current.txt +3 −0 Original line number Diff line number Diff line Loading @@ -25054,6 +25054,7 @@ package android.media { field public static final String KEY_FRAME_RATE = "frame-rate"; field public static final String KEY_GRID_COLUMNS = "grid-cols"; field public static final String KEY_GRID_ROWS = "grid-rows"; field public static final String KEY_HAPTIC_CHANNEL_COUNT = "haptic-channel-count"; field public static final String KEY_HDR10_PLUS_INFO = "hdr10-plus-info"; field public static final String KEY_HDR_STATIC_INFO = "hdr-static-info"; field public static final String KEY_HEIGHT = "height"; Loading Loading @@ -26344,6 +26345,8 @@ package android.media { method public android.net.Uri getRingtoneUri(int); method public boolean getStopPreviousRingtone(); method public static android.net.Uri getValidRingtoneUri(android.content.Context); method public boolean hasHapticChannels(int); method public static boolean hasHapticChannels(@NonNull android.net.Uri); method public int inferStreamType(); method public static boolean isDefault(android.net.Uri); method @Nullable public static android.content.res.AssetFileDescriptor openDefaultRingtoneUri(@NonNull android.content.Context, @NonNull android.net.Uri) throws java.io.FileNotFoundException; media/java/android/media/AudioManager.java +15 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ import android.media.session.MediaController; import android.media.session.MediaSession; import android.media.session.MediaSessionLegacyHelper; import android.media.session.MediaSessionManager; import android.net.Uri; import android.os.Binder; import android.os.Build; import android.os.Handler; Loading Loading @@ -5441,6 +5442,20 @@ public class AudioManager { sAudioAudioVolumeGroupChangedHandler.unregisterListener(callback); } /** * Return if an asset contains haptic channels or not. * @param uri the {@link Uri} of the asset. * @return true if the assert contains haptic channels. * @hide */ public static boolean hasHapticChannels(Uri uri) { try { return getService().hasHapticChannels(uri); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } //--------------------------------------------------------- // Inner classes //-------------------- Loading media/java/android/media/IAudioService.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ import android.media.audiopolicy.AudioProductStrategies; import android.media.audiopolicy.AudioVolumeGroups; import android.media.audiopolicy.IAudioPolicyCallback; import android.media.projection.IMediaProjection; import android.net.Uri; /** * {@hide} Loading Loading @@ -250,6 +251,8 @@ interface IAudioService { int removeUidDeviceAffinity(in IAudioPolicyCallback pcb, in int uid); boolean hasHapticChannels(in Uri uri); // WARNING: read warning at top of file, new methods that need to be used by native // code via IAudioManager.h need to be added to the top section. } media/java/android/media/MediaFormat.java +6 −0 Original line number Diff line number Diff line Loading @@ -874,6 +874,12 @@ public final class MediaFormat { */ public static final String KEY_IS_FORCED_SUBTITLE = "is-forced-subtitle"; /** * A key describing the number of haptic channels in an audio format. * The associated value is an integer. */ public static final String KEY_HAPTIC_CHANNEL_COUNT = "haptic-channel-count"; /** @hide */ public static final String KEY_IS_TIMED_TEXT = "is-timed-text"; Loading media/java/android/media/RingtoneManager.java +22 −0 Original line number Diff line number Diff line Loading @@ -1097,6 +1097,28 @@ public class RingtoneManager { return afd; } /** * Returns if the {@link Ringtone} at the given position in the * {@link Cursor} contains haptic channels. * * @param position The position (in the {@link Cursor}) of the ringtone. * @return true if the ringtone contains haptic channels. */ public boolean hasHapticChannels(int position) { return hasHapticChannels(getRingtoneUri(position)); } /** * Returns if the {@link Ringtone} from a given sound URI contains * haptic channels or not. * * @param ringtoneUri The {@link Uri} of a sound or ringtone. * @return true if the ringtone contains haptic channels. */ public static boolean hasHapticChannels(@NonNull Uri ringtoneUri) { return AudioManager.hasHapticChannels(ringtoneUri); } /** * Creates a {@link android.media.MediaScannerConnection} to scan a ringtone file and add its * information to the internal database. Loading Loading
api/current.txt +3 −0 Original line number Diff line number Diff line Loading @@ -25054,6 +25054,7 @@ package android.media { field public static final String KEY_FRAME_RATE = "frame-rate"; field public static final String KEY_GRID_COLUMNS = "grid-cols"; field public static final String KEY_GRID_ROWS = "grid-rows"; field public static final String KEY_HAPTIC_CHANNEL_COUNT = "haptic-channel-count"; field public static final String KEY_HDR10_PLUS_INFO = "hdr10-plus-info"; field public static final String KEY_HDR_STATIC_INFO = "hdr-static-info"; field public static final String KEY_HEIGHT = "height"; Loading Loading @@ -26344,6 +26345,8 @@ package android.media { method public android.net.Uri getRingtoneUri(int); method public boolean getStopPreviousRingtone(); method public static android.net.Uri getValidRingtoneUri(android.content.Context); method public boolean hasHapticChannels(int); method public static boolean hasHapticChannels(@NonNull android.net.Uri); method public int inferStreamType(); method public static boolean isDefault(android.net.Uri); method @Nullable public static android.content.res.AssetFileDescriptor openDefaultRingtoneUri(@NonNull android.content.Context, @NonNull android.net.Uri) throws java.io.FileNotFoundException;
media/java/android/media/AudioManager.java +15 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ import android.media.session.MediaController; import android.media.session.MediaSession; import android.media.session.MediaSessionLegacyHelper; import android.media.session.MediaSessionManager; import android.net.Uri; import android.os.Binder; import android.os.Build; import android.os.Handler; Loading Loading @@ -5441,6 +5442,20 @@ public class AudioManager { sAudioAudioVolumeGroupChangedHandler.unregisterListener(callback); } /** * Return if an asset contains haptic channels or not. * @param uri the {@link Uri} of the asset. * @return true if the assert contains haptic channels. * @hide */ public static boolean hasHapticChannels(Uri uri) { try { return getService().hasHapticChannels(uri); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } //--------------------------------------------------------- // Inner classes //-------------------- Loading
media/java/android/media/IAudioService.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ import android.media.audiopolicy.AudioProductStrategies; import android.media.audiopolicy.AudioVolumeGroups; import android.media.audiopolicy.IAudioPolicyCallback; import android.media.projection.IMediaProjection; import android.net.Uri; /** * {@hide} Loading Loading @@ -250,6 +251,8 @@ interface IAudioService { int removeUidDeviceAffinity(in IAudioPolicyCallback pcb, in int uid); boolean hasHapticChannels(in Uri uri); // WARNING: read warning at top of file, new methods that need to be used by native // code via IAudioManager.h need to be added to the top section. }
media/java/android/media/MediaFormat.java +6 −0 Original line number Diff line number Diff line Loading @@ -874,6 +874,12 @@ public final class MediaFormat { */ public static final String KEY_IS_FORCED_SUBTITLE = "is-forced-subtitle"; /** * A key describing the number of haptic channels in an audio format. * The associated value is an integer. */ public static final String KEY_HAPTIC_CHANNEL_COUNT = "haptic-channel-count"; /** @hide */ public static final String KEY_IS_TIMED_TEXT = "is-timed-text"; Loading
media/java/android/media/RingtoneManager.java +22 −0 Original line number Diff line number Diff line Loading @@ -1097,6 +1097,28 @@ public class RingtoneManager { return afd; } /** * Returns if the {@link Ringtone} at the given position in the * {@link Cursor} contains haptic channels. * * @param position The position (in the {@link Cursor}) of the ringtone. * @return true if the ringtone contains haptic channels. */ public boolean hasHapticChannels(int position) { return hasHapticChannels(getRingtoneUri(position)); } /** * Returns if the {@link Ringtone} from a given sound URI contains * haptic channels or not. * * @param ringtoneUri The {@link Uri} of a sound or ringtone. * @return true if the ringtone contains haptic channels. */ public static boolean hasHapticChannels(@NonNull Uri ringtoneUri) { return AudioManager.hasHapticChannels(ringtoneUri); } /** * Creates a {@link android.media.MediaScannerConnection} to scan a ringtone file and add its * information to the internal database. Loading