• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package org.robolectric.shadows;
2 
3 import android.media.audiofx.AudioEffect;
4 import java.util.ArrayList;
5 import java.util.List;
6 import org.robolectric.annotation.Implementation;
7 import org.robolectric.annotation.Implements;
8 import org.robolectric.annotation.Resetter;
9 
10 @Implements(AudioEffect.class)
11 public class ShadowAudioEffect {
12 
13   private static List<AudioEffect.Descriptor> DESCRIPTORS = new ArrayList<>();
14 
addEffect(AudioEffect.Descriptor descriptor)15   public static void addEffect(AudioEffect.Descriptor descriptor) {
16     DESCRIPTORS.add(descriptor);
17   }
18 
19   @Implementation
queryEffects()20   protected static AudioEffect.Descriptor[] queryEffects() {
21     return DESCRIPTORS.toArray(new AudioEffect.Descriptor[DESCRIPTORS.size()]);
22   }
23 
24   @Resetter
reset()25   public static void reset() {
26     DESCRIPTORS.clear();
27   }
28 }
29