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

Commit 20f124b2 authored by Adrian Roos's avatar Adrian Roos Committed by Android (Google) Code Review
Browse files

Merge changes from topics "ringtone-flag-revert", "ringtone-local-revert",...

Merge changes from topics "ringtone-flag-revert", "ringtone-local-revert", "ringtone-vibration-revert" into main

* changes:
  Remove SoundPicker2
  Revert "Add the haptics team to SoundPicker OWNERS."
  Revert "Add the haptics team to Ringtone OWNERS."
  Revert "Factor out ringtone local vs remote playback into separate implementations."
  Revert "Create a Builder for Ringtone, add unit tests."
  Revert "Remove bad finalizer from Ringtone."
  Revert "Add support for VibrationEffect and audio-coupled vibrations to Ringtone."
  Revert "Support vibration-only via Ringtone player."
  Revert "Add back the older Ringtone implementation to allow flag control."
  Revert "Create haptic vibration library"
  Revert "Add new extras and categories to the RingtoneManager class."
  Revert "Add a flag to enable RingtoneV2"
parents 1a4620a9 93fe4a8f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -24706,6 +24706,7 @@ package android.media {
  }
  public class Ringtone {
    method protected void finalize();
    method public android.media.AudioAttributes getAudioAttributes();
    method @Deprecated public int getStreamType();
    method public String getTitle(android.content.Context);
+18 −26
Original line number Diff line number Diff line
@@ -33,7 +33,6 @@ import android.os.vibrator.PrimitiveSegment;
import android.os.vibrator.RampSegment;
import android.os.vibrator.StepSegment;
import android.os.vibrator.VibrationEffectSegment;
import android.util.Log;
import android.util.MathUtils;

import com.android.internal.util.Preconditions;
@@ -54,7 +53,6 @@ import java.util.StringJoiner;
 * <p>These effects may be any number of things, from single shot vibrations to complex waveforms.
 */
public abstract class VibrationEffect implements Parcelable {
    private static final String TAG = "VibrationEffect";
    // Stevens' coefficient to scale the perceived vibration intensity.
    private static final float SCALE_GAMMA = 0.65f;
    // If a vibration is playing for longer than 1s, it's probably not haptic feedback
@@ -397,13 +395,12 @@ public abstract class VibrationEffect implements Parcelable {
            return null;
        }

        try {
        final ContentResolver cr = context.getContentResolver();
        Uri uncanonicalUri = cr.uncanonicalize(uri);
        if (uncanonicalUri == null) {
            // If we already had an uncanonical URI, it's possible we'll get null back here. In
                // this case, just use the URI as passed in since it wasn't canonicalized in the
                // first place.
            // this case, just use the URI as passed in since it wasn't canonicalized in the first
            // place.
            uncanonicalUri = uri;
        }

@@ -419,11 +416,6 @@ public abstract class VibrationEffect implements Parcelable {
                return get(RINGTONES[i]);
            }
        }
        } catch (Exception e) {
            // Don't give unexpected exceptions to callers if the Uri's ContentProvider is
            // misbehaving - it's very unlikely to be mapped in that case anyway.
            Log.e(TAG, "Exception getting default vibration for Uri " + uri, e);
        }
        return null;
    }

+0 −7
Original line number Diff line number Diff line
@@ -14,13 +14,6 @@ flag {
    bug: "241918098"
}

flag {
    namespace: "haptics"
    name: "haptics_customization_ringtone_v2_enabled"
    description: "Enables the usage of the new RingtoneV2 class"
    bug: "241918098"
}

flag {
    namespace: "haptics"
    name: "enable_vibration_serialization_apis"
+0 −11
Original line number Diff line number Diff line
@@ -38,17 +38,6 @@
      ],
      "file_patterns": ["(?i)drm|crypto"]
    },
    {
      "file_patterns": [
        "[^/]*(Ringtone)[^/]*\\.java"
      ],
      "name": "MediaRingtoneTests",
      "options": [
        {"exclude-annotation": "androidx.test.filters.LargeTest"},
        {"exclude-annotation": "androidx.test.filters.FlakyTest"},
        {"exclude-annotation": "org.junit.Ignore"}
      ]
    },
    {
      "file_patterns": [
        "[^/]*(LoudnessCodec)[^/]*\\.java"
+3 −15
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@ import android.media.VolumeShaper;
import android.net.Uri;
import android.os.ParcelFileDescriptor;
import android.os.UserHandle;
import android.os.VibrationEffect;

/**
 * @hide
@@ -30,24 +29,13 @@ interface IRingtonePlayer {
    /** Used for Ringtone.java playback */
    @UnsupportedAppUsage
    oneway void play(IBinder token, in Uri uri, in AudioAttributes aa, float volume, boolean looping);
    oneway void stop(IBinder token);
    boolean isPlaying(IBinder token);

    // RingtoneV1
    oneway void playWithVolumeShaping(IBinder token, in Uri uri, in AudioAttributes aa,
        float volume, boolean looping, in @nullable VolumeShaper.Configuration volumeShaperConfig);
    oneway void stop(IBinder token);
    boolean isPlaying(IBinder token);
    oneway void setPlaybackProperties(IBinder token, float volume, boolean looping,
        boolean hapticGeneratorEnabled);

    // RingtoneV2
    oneway void playRemoteRingtone(IBinder token, in Uri uri, in AudioAttributes aa,
        boolean useExactAudioAttributes, int enabledMedia, in @nullable VibrationEffect ve,
        float volume, boolean looping, boolean hapticGeneratorEnabled,
        in @nullable VolumeShaper.Configuration volumeShaperConfig);
    oneway void setLooping(IBinder token, boolean looping);
    oneway void setVolume(IBinder token, float volume);
    oneway void setHapticGeneratorEnabled(IBinder token, boolean hapticGeneratorEnabled);

    /** Used for Notification sound playback. */
    oneway void playAsync(in Uri uri, in UserHandle user, boolean looping, in AudioAttributes aa, float volume);
    oneway void stopAsync();
Loading