Class ShadowMediaActionSound

java.lang.Object
org.robolectric.shadows.ShadowMediaActionSound

@Implements(android.media.MediaActionSound.class) public class ShadowMediaActionSound extends Object
A shadow implementation of MediaActionSound.
  • Constructor Details

    • ShadowMediaActionSound

      public ShadowMediaActionSound()
  • Method Details

    • getPlayCount

      public static int getPlayCount(int soundName)
      Get the number of times a sound has been played.
    • setMustPlayShutterSound

      public static void setMustPlayShutterSound(boolean mustPlayShutterSound)
      Sets the value returned by MediaActionSound.mustPlayShutterSound().
    • reset

      @Resetter public static void reset()
    • play

      @Implementation protected void play(int soundName)
      Instrumented call to MediaActionSound.play(int)
    • mustPlayShutterSound

      @Implementation(minSdk=33) protected static boolean mustPlayShutterSound()