// Path: packages/google_mobile_ads/android/src/main/java/io/flutter/plugins/googlemobileads/FlutterAd.java
// abstract static class FlutterOverlayAd extends FlutterAd {
//   abstract void show();
// 
//   abstract void setImmersiveMode(boolean immersiveModeEnabled);
// 
//   FlutterOverlayAd(int adId) {
//     super(adId);
//   }
// }


import android.content.Context;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import com.google.android.gms.ads.AdSize;
import com.google.android.gms.ads.MobileAds;
import com.google.android.gms.ads.RequestConfiguration;
import com.google.android.gms.ads.initialization.InitializationStatus;
import com.google.android.gms.ads.initialization.OnInitializationCompleteListener;
import com.google.android.gms.ads.nativead.NativeAd;
import com.google.android.gms.ads.nativead.NativeAdView;
import io.flutter.embedding.engine.FlutterEngine;
import io.flutter.embedding.engine.plugins.FlutterPlugin;
import io.flutter.embedding.engine.plugins.activity.ActivityAware;
import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
import io.flutter.plugin.common.MethodChannel.Result;
import io.flutter.plugin.common.StandardMethodCodec;
import io.flutter.plugins.googlemobileads.FlutterAd.FlutterOverlayAd;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
        // Internal init. This is necessary to cleanup state on hot restart.
        instanceManager.disposeAllAds();
        result.success(null);
        break;

      case "MobileAds#initialize":
        flutterMobileAds.initialize(context, new FlutterInitializationListener(result));
        break;
      case "MobileAds#getRequestConfiguration":
        result.success(flutterMobileAds.getRequestConfiguration());
        break;
      case "MobileAds#updateRequestConfiguration":
        RequestConfiguration.Builder builder = MobileAds.getRequestConfiguration().toBuilder();
        String maxAdContentRating = call.argument("maxAdContentRating");
        Integer tagForChildDirectedTreatment = call.argument("tagForChildDirectedTreatment");
        Integer tagForUnderAgeOfConsent = call.argument("tagForUnderAgeOfConsent");
        List<String> testDeviceIds = call.argument("testDeviceIds");
        if (maxAdContentRating != null) {
          builder.setMaxAdContentRating(maxAdContentRating);
        }
        if (tagForChildDirectedTreatment != null) {
          builder.setTagForChildDirectedTreatment(tagForChildDirectedTreatment);
        }
        if (tagForUnderAgeOfConsent != null) {
          builder.setTagForUnderAgeOfConsent(tagForUnderAgeOfConsent);
        }
        if (testDeviceIds != null) {
          builder.setTestDeviceIds(testDeviceIds);
        }
        MobileAds.setRequestConfiguration(builder.build());
// Path: packages/google_mobile_ads/android/src/main/java/io/flutter/plugins/googlemobileads/FlutterAd.java
// abstract static class FlutterOverlayAd extends FlutterAd {
//   abstract void show();
// 
//   abstract void setImmersiveMode(boolean immersiveModeEnabled);
// 
//   FlutterOverlayAd(int adId) {
//     super(adId);
//   }
// }


// Path: packages/google_mobile_ads/android/src/main/java/io/flutter/plugins/googlemobileads/GoogleMobileAdsPlugin.java
import android.content.Context;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import com.google.android.gms.ads.AdSize;
import com.google.android.gms.ads.MobileAds;
import com.google.android.gms.ads.RequestConfiguration;
import com.google.android.gms.ads.initialization.InitializationStatus;
import com.google.android.gms.ads.initialization.OnInitializationCompleteListener;
import com.google.android.gms.ads.nativead.NativeAd;
import com.google.android.gms.ads.nativead.NativeAdView;
import io.flutter.embedding.engine.FlutterEngine;
import io.flutter.embedding.engine.plugins.FlutterPlugin;
import io.flutter.embedding.engine.plugins.activity.ActivityAware;
import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
import io.flutter.plugin.common.MethodChannel.Result;
import io.flutter.plugin.common.StandardMethodCodec;
import io.flutter.plugins.googlemobileads.FlutterAd.FlutterOverlayAd;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

        // Internal init. This is necessary to cleanup state on hot restart.
        instanceManager.disposeAllAds();
        result.success(null);
        break;

      case "MobileAds#initialize":
        flutterMobileAds.initialize(context, new FlutterInitializationListener(result));
        break;
      case "MobileAds#getRequestConfiguration":
        result.success(flutterMobileAds.getRequestConfiguration());
        break;
      case "MobileAds#updateRequestConfiguration":
        RequestConfiguration.Builder builder = MobileAds.getRequestConfiguration().toBuilder();
        String maxAdContentRating = call.argument("maxAdContentRating");
        Integer tagForChildDirectedTreatment = call.argument("tagForChildDirectedTreatment");
        Integer tagForUnderAgeOfConsent = call.argument("tagForUnderAgeOfConsent");
        List<String> testDeviceIds = call.argument("testDeviceIds");
        if (maxAdContentRating != null) {
          builder.setMaxAdContentRating(maxAdContentRating);
        }
        if (tagForChildDirectedTreatment != null) {
          builder.setTagForChildDirectedTreatment(tagForChildDirectedTreatment);
        }
        if (tagForUnderAgeOfConsent != null) {
          builder.setTagForUnderAgeOfConsent(tagForUnderAgeOfConsent);
        }
        if (testDeviceIds != null) {
          builder.setTestDeviceIds(testDeviceIds);
        }
        MobileAds.setRequestConfiguration(builder.build());
        result.success(null);