package tv.ouya.console.internal;

import android.os.Bundle;
import android.os.RemoteException;
import android.util.Log;
import org.json.JSONException;
import org.json.JSONObject;
import tv.ouya.console.api.GamerInfo;
import tv.ouya.console.api.OuyaResponseListener;

public class GamerInfoListenerBinder
  extends IStringListener.Stub
{
  private static final String LOG_TAG = "GamerInfoListenerBinder";
  private ListenerBinderHelper<GamerInfo> binderHelper;
  
  public GamerInfoListenerBinder(OuyaResponseListener<GamerInfo> paramOuyaResponseListener)
  {
    this.binderHelper = new ListenerBinderHelper(paramOuyaResponseListener);
  }
  
  public void onCancel()
    throws RemoteException
  {
    this.binderHelper.onCancel();
  }
  
  public void onFailure(int paramInt, String paramString, Bundle paramBundle)
    throws RemoteException
  {
    this.binderHelper.onFailure(paramInt, paramString, paramBundle);
  }
  
  public void onSuccess(String paramString)
    throws RemoteException
  {
    try
    {
      paramString = new JSONObject(paramString).getJSONObject("gamer");
      paramString = new GamerInfo(paramString.optString("uuid", ""), paramString.optString("username", ""));
      this.binderHelper.onSuccess(paramString);
      return;
    }
    catch (JSONException paramString)
    {
      Log.e("GamerInfoListenerBinder", "Exception parsing result: " + paramString);
    }
  }
}


/* Location:              /home/enzo/Documents/hacking/malwares/viking-horde/classes.jar!/tv/ouya/console/internal/GamerInfoListenerBinder.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */