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

Commit 573de14b authored by Jiabin Huang's avatar Jiabin Huang Committed by Android (Google) Code Review
Browse files

Merge "Add RingtoneManager.hasHapticChannels(Context, Uri)."

parents b476f8b5 0def6d1b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -23217,6 +23217,7 @@ package android.media {
    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 static boolean hasHapticChannels(@NonNull android.content.Context, @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;
+13 −1
Original line number Diff line number Diff line
@@ -1059,7 +1059,8 @@ public class RingtoneManager {
     * haptic channels or not. As this function doesn't has a context
     * to resolve the uri, the result may be wrong if the uri cannot be
     * resolved correctly.
     * Use {@link #hasHapticChannels(int)} instead when possible.
     * Use {@link #hasHapticChannels(int)} or {@link #hasHapticChannels(Context, Uri)}
     * instead when possible.
     *
     * @param ringtoneUri The {@link Uri} of a sound or ringtone.
     * @return true if the ringtone contains haptic channels.
@@ -1068,6 +1069,17 @@ public class RingtoneManager {
        return AudioManager.hasHapticChannels(null, ringtoneUri);
    }

    /**
     * Returns if the {@link Ringtone} from a given sound URI contains haptics channels or not.
     *
     * @param context the {@link android.content.Context} to use when resolving the Uri.
     * @param ringtoneUri the {@link Uri} of a sound or ringtone.
     * @return true if the ringtone contains haptic channels.
     */
    public static boolean hasHapticChannels(@NonNull Context context, @NonNull Uri ringtoneUri) {
        return AudioManager.hasHapticChannels(context, ringtoneUri);
    }

    /**
     * Attempts to create a context for the given user.
     *