// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.


// This file is autogenerated by
//     third_party/jni_zero/jni_generator.py
// For
//     android/net/connectivity/org/chromium/net/NetworkActiveNotifier

#ifndef android_net_connectivity_org_chromium_net_NetworkActiveNotifier_JNI
#define android_net_connectivity_org_chromium_net_NetworkActiveNotifier_JNI

#include <jni.h>

#include "third_party/jni_zero/jni_export.h"
#include "third_party/jni_zero/jni_zero_helper.h"


// Step 1: Forward declarations.

JNI_ZERO_COMPONENT_BUILD_EXPORT extern const char
    kClassPath_android_net_connectivity_org_chromium_net_NetworkActiveNotifier[];
const char kClassPath_android_net_connectivity_org_chromium_net_NetworkActiveNotifier[] =
    "android/net/connectivity/org/chromium/net/NetworkActiveNotifier";
// Leaking this jclass as we cannot use LazyInstance from some threads.
JNI_ZERO_COMPONENT_BUILD_EXPORT std::atomic<jclass>
    g_android_net_connectivity_org_chromium_net_NetworkActiveNotifier_clazz(nullptr);
#ifndef android_net_connectivity_org_chromium_net_NetworkActiveNotifier_clazz_defined
#define android_net_connectivity_org_chromium_net_NetworkActiveNotifier_clazz_defined
inline jclass android_net_connectivity_org_chromium_net_NetworkActiveNotifier_clazz(JNIEnv* env) {
  return base::android::LazyGetClass(env,
      kClassPath_android_net_connectivity_org_chromium_net_NetworkActiveNotifier,
      &g_android_net_connectivity_org_chromium_net_NetworkActiveNotifier_clazz);
}
#endif


// Step 2: Constants (optional).


// Step 3: Method stubs.
namespace net {

JNI_BOUNDARY_EXPORT void Java_android_net_connectivity_J_N_MxPcGW8_1(
    JNIEnv* env,
    jclass jcaller,
    jlong nativePtr) {
  NetworkChangeNotifierDelegateAndroid* native =
      reinterpret_cast<NetworkChangeNotifierDelegateAndroid*>(nativePtr);
  CHECK_NATIVE_PTR(env, jcaller, native, "NotifyOfDefaultNetworkActive");
  return native->NotifyOfDefaultNetworkActive(env);
}


static std::atomic<jmethodID>
    g_android_net_connectivity_org_chromium_net_NetworkActiveNotifier_build1(nullptr);
static base::android::ScopedJavaLocalRef<jobject> Java_NetworkActiveNotifier_build(JNIEnv* env,
    jlong nativeNetworkActiveNotifier) {
  jclass clazz = android_net_connectivity_org_chromium_net_NetworkActiveNotifier_clazz(env);
  CHECK_CLAZZ(env, clazz,
      android_net_connectivity_org_chromium_net_NetworkActiveNotifier_clazz(env), nullptr);

  jni_generator::JniJavaCallContextChecked call_context;
  call_context.Init<
      base::android::MethodID::TYPE_STATIC>(
          env,
          clazz,
          "build",
          "(J)Landroid/net/connectivity/org/chromium/net/NetworkActiveNotifier;",
          &g_android_net_connectivity_org_chromium_net_NetworkActiveNotifier_build1);

  jobject ret =
      env->CallStaticObjectMethod(clazz,
          call_context.base.method_id, nativeNetworkActiveNotifier);
  return base::android::ScopedJavaLocalRef<jobject>(env, ret);
}

static std::atomic<jmethodID>
    g_android_net_connectivity_org_chromium_net_NetworkActiveNotifier_disableNotifications0(nullptr);
static void Java_NetworkActiveNotifier_disableNotifications(JNIEnv* env, const
    base::android::JavaRef<jobject>& obj) {
  jclass clazz = android_net_connectivity_org_chromium_net_NetworkActiveNotifier_clazz(env);
  CHECK_CLAZZ(env, obj.obj(),
      android_net_connectivity_org_chromium_net_NetworkActiveNotifier_clazz(env));

  jni_generator::JniJavaCallContextChecked call_context;
  call_context.Init<
      base::android::MethodID::TYPE_INSTANCE>(
          env,
          clazz,
          "disableNotifications",
          "()V",
          &g_android_net_connectivity_org_chromium_net_NetworkActiveNotifier_disableNotifications0);

     env->CallVoidMethod(obj.obj(),
          call_context.base.method_id);
}

static std::atomic<jmethodID>
    g_android_net_connectivity_org_chromium_net_NetworkActiveNotifier_enableNotifications0(nullptr);
static void Java_NetworkActiveNotifier_enableNotifications(JNIEnv* env, const
    base::android::JavaRef<jobject>& obj) {
  jclass clazz = android_net_connectivity_org_chromium_net_NetworkActiveNotifier_clazz(env);
  CHECK_CLAZZ(env, obj.obj(),
      android_net_connectivity_org_chromium_net_NetworkActiveNotifier_clazz(env));

  jni_generator::JniJavaCallContextChecked call_context;
  call_context.Init<
      base::android::MethodID::TYPE_INSTANCE>(
          env,
          clazz,
          "enableNotifications",
          "()V",
          &g_android_net_connectivity_org_chromium_net_NetworkActiveNotifier_enableNotifications0);

     env->CallVoidMethod(obj.obj(),
          call_context.base.method_id);
}

static std::atomic<jmethodID>
    g_android_net_connectivity_org_chromium_net_NetworkActiveNotifier_fakeDefaultNetworkActive0(nullptr);
static void Java_NetworkActiveNotifier_fakeDefaultNetworkActive(JNIEnv* env, const
    base::android::JavaRef<jobject>& obj) {
  jclass clazz = android_net_connectivity_org_chromium_net_NetworkActiveNotifier_clazz(env);
  CHECK_CLAZZ(env, obj.obj(),
      android_net_connectivity_org_chromium_net_NetworkActiveNotifier_clazz(env));

  jni_generator::JniJavaCallContextChecked call_context;
  call_context.Init<
      base::android::MethodID::TYPE_INSTANCE>(
          env,
          clazz,
          "fakeDefaultNetworkActive",
          "()V",
&g_android_net_connectivity_org_chromium_net_NetworkActiveNotifier_fakeDefaultNetworkActive0);

     env->CallVoidMethod(obj.obj(),
          call_context.base.method_id);
}

static std::atomic<jmethodID>
    g_android_net_connectivity_org_chromium_net_NetworkActiveNotifier_isDefaultNetworkActive0(nullptr);
static jboolean Java_NetworkActiveNotifier_isDefaultNetworkActive(JNIEnv* env, const
    base::android::JavaRef<jobject>& obj) {
  jclass clazz = android_net_connectivity_org_chromium_net_NetworkActiveNotifier_clazz(env);
  CHECK_CLAZZ(env, obj.obj(),
      android_net_connectivity_org_chromium_net_NetworkActiveNotifier_clazz(env), false);

  jni_generator::JniJavaCallContextChecked call_context;
  call_context.Init<
      base::android::MethodID::TYPE_INSTANCE>(
          env,
          clazz,
          "isDefaultNetworkActive",
          "()Z",
&g_android_net_connectivity_org_chromium_net_NetworkActiveNotifier_isDefaultNetworkActive0);

  jboolean ret =
      env->CallBooleanMethod(obj.obj(),
          call_context.base.method_id);
  return ret;
}

}  // namespace net

#endif  // android_net_connectivity_org_chromium_net_NetworkActiveNotifier_JNI
