public CustomEventInterstitialAdapter(
      MoPubInterstitial moPubInterstitial, String className, String jsonParams) {
    mHandler = new Handler();
    mServerExtras = new HashMap<String, String>();
    mLocalExtras = new HashMap<String, Object>();
    mContext = moPubInterstitial.getActivity();
    mTimeout =
        new Runnable() {
          @Override
          public void run() {
            Log.d("MoPub", "Third-party network timed out.");
            onInterstitialFailed(NETWORK_TIMEOUT);
            invalidate();
          }
        };

    Log.d("MoPub", "Attempting to invoke custom event: " + className);
    try {
      mCustomEventInterstitial = CustomEventInterstitialFactory.create(className);
    } catch (Exception exception) {
      Log.d("MoPub", "Couldn't locate or instantiate custom event: " + className + ".");
      if (mCustomEventInterstitialAdapterListener != null)
        mCustomEventInterstitialAdapterListener.onCustomEventInterstitialFailed(ADAPTER_NOT_FOUND);
    }

    // Attempt to load the JSON extras into mServerExtras.
    try {
      mServerExtras = Utils.jsonStringToMap(jsonParams);
    } catch (Exception exception) {
      Log.d("MoPub", "Failed to create Map from JSON: " + jsonParams);
    }

    mLocalExtras = moPubInterstitial.getLocalExtras();
    if (moPubInterstitial.getLocation() != null)
      mLocalExtras.put("location", moPubInterstitial.getLocation());
  }