VolumeProviderCompat.java 2.44 KB
package android.support.v4.media;

import android.media.VolumeProvider;
import android.os.Build.VERSION;
import android.support.annotation.RestrictTo;
import java.lang.annotation.Annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

public abstract class VolumeProviderCompat
{
  public static final int VOLUME_CONTROL_ABSOLUTE = 2;
  public static final int VOLUME_CONTROL_FIXED = 0;
  public static final int VOLUME_CONTROL_RELATIVE = 1;
  private final int a;
  private final int b;
  private int c;
  private Callback d;
  private Object e;
  
  public VolumeProviderCompat(int paramInt1, int paramInt2, int paramInt3)
  {
    this.a = paramInt1;
    this.b = paramInt2;
    this.c = paramInt3;
  }
  
  public final int getCurrentVolume()
  {
    return this.c;
  }
  
  public final int getMaxVolume()
  {
    return this.b;
  }
  
  public final int getVolumeControl()
  {
    return this.a;
  }
  
  public Object getVolumeProvider()
  {
    if ((this.e != null) || (Build.VERSION.SDK_INT < 21)) {
      return this.e;
    }
    this.e = new VolumeProviderCompatApi21.1(this.a, this.b, this.c, new VolumeProviderCompatApi21.Delegate()
    {
      public final void onAdjustVolume(int paramAnonymousInt)
      {
        VolumeProviderCompat.this.onAdjustVolume(paramAnonymousInt);
      }
      
      public final void onSetVolumeTo(int paramAnonymousInt)
      {
        VolumeProviderCompat.this.onSetVolumeTo(paramAnonymousInt);
      }
    });
    return this.e;
  }
  
  public void onAdjustVolume(int paramInt) {}
  
  public void onSetVolumeTo(int paramInt) {}
  
  public void setCallback(Callback paramCallback)
  {
    this.d = paramCallback;
  }
  
  public final void setCurrentVolume(int paramInt)
  {
    this.c = paramInt;
    Object localObject = getVolumeProvider();
    if (localObject != null) {
      ((VolumeProvider)localObject).setCurrentVolume(paramInt);
    }
    if (this.d != null) {
      this.d.onVolumeChanged(this);
    }
  }
  
  public static abstract class Callback
  {
    public abstract void onVolumeChanged(VolumeProviderCompat paramVolumeProviderCompat);
  }
  
  @Retention(RetentionPolicy.SOURCE)
  @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP})
  public static @interface ControlType {}
}


/* Location:              /home/merong/decompile/hackery-dex2jar.jar!/android/support/v4/media/VolumeProviderCompat.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */