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

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

Fix more audio effects auto tests

commit 672c0dc3 broke the energy probe
used by auto tests to verify that an effect is actually enabled.
The probe is based on the Visualizer which now scales the capture to maximise
the signal level: this prevents from detecting level changes between subsequent captures.
Playing sound at a lower volume moves the signal level out of the range where
scalling occurs and makes comparison possible again.

Change-Id: Ib56dec6e619c6d778dcc3ca6453091bf6136f290
parent 2359d49b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ public class MediaBassBoostTest extends ActivityInstrumentationTestCase2<MediaFr
    private String TAG = "MediaBassBoostTest";
    private final static int MIN_ENERGY_RATIO_2 = 3;
    private final static short TEST_STRENGTH = 500;
    private final static int TEST_VOLUME = 4;

    private BassBoost mBassBoost = null;
    private int mSession = -1;
@@ -192,7 +193,7 @@ public class MediaBassBoostTest extends ActivityInstrumentationTestCase2<MediaFr
        AudioManager am = (AudioManager) getActivity().getSystemService(Context.AUDIO_SERVICE);
        int volume = am.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
        am.setStreamVolume(AudioManager.STREAM_MUSIC,
                           am.getStreamMaxVolume(AudioManager.STREAM_MUSIC),
                           TEST_VOLUME,
                           0);

        try {
+2 −1
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ public class MediaEqualizerTest extends ActivityInstrumentationTestCase2<MediaFr
    private final static int MAX_BAND_LEVEL = 1500;
    private final static int TEST_FREQUENCY_MILLIHERTZ = 1000000;
    private final static int MIN_NUMBER_OF_PRESETS = 4;
    private final static int TEST_VOLUME = 4;
    private Equalizer mEqualizer = null;
    private int mSession = -1;

@@ -259,7 +260,7 @@ public class MediaEqualizerTest extends ActivityInstrumentationTestCase2<MediaFr
        AudioManager am = (AudioManager) getActivity().getSystemService(Context.AUDIO_SERVICE);
        int volume = am.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
        am.setStreamVolume(AudioManager.STREAM_MUSIC,
                           am.getStreamMaxVolume(AudioManager.STREAM_MUSIC),
                           TEST_VOLUME,
                           0);
        try {
            probe = new EnergyProbe(0);
+2 −1
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ public class MediaVirtualizerTest extends ActivityInstrumentationTestCase2<Media
    private String TAG = "MediaVirtualizerTest";
    private final static int MIN_ENERGY_RATIO_2 = 3;
    private final static short TEST_STRENGTH = 500;
    private final static int TEST_VOLUME = 4;

    private Virtualizer mVirtualizer = null;
    private int mSession = -1;
@@ -193,7 +194,7 @@ public class MediaVirtualizerTest extends ActivityInstrumentationTestCase2<Media
        AudioManager am = (AudioManager) getActivity().getSystemService(Context.AUDIO_SERVICE);
        int volume = am.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
        am.setStreamVolume(AudioManager.STREAM_MUSIC,
                           am.getStreamMaxVolume(AudioManager.STREAM_MUSIC),
                           TEST_VOLUME,
                           0);

        try {