910e62b5创建于 1月15日历史提交
// Copyright 2025 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/android/jni_android.h"
#include "chrome/browser/autocomplete/aim_eligibility_service_factory.h"
#include "chrome/browser/flags/android/chrome_feature_list.h"
#include "chrome/browser/profiles/profile.h"
#include "components/omnibox/browser/aim_eligibility_service.h"
#include "components/omnibox/browser/omnibox_prefs.h"

// Must come after all headers that specialize FromJniType() / ToJniType().
#include "chrome/browser/composeplate/android/jni_headers/ComposeplateUtils_jni.h"

// static
static jboolean JNI_ComposeplateUtils_IsAimEntrypointEligible(
    JNIEnv* env,
    Profile* profile) {
  DCHECK(profile);
  return AimEligibilityService::GenericKillSwitchFeatureCheck(
      AimEligibilityServiceFactory::GetForProfile(profile),
      chrome::android::kAndroidComposeplateAllLocales,
      chrome::android::kAndroidComposeplate);
}

// static
static jboolean JNI_ComposeplateUtils_IsAimEntrypointLFFEligible(
    JNIEnv* env,
    Profile* profile) {
  DCHECK(profile);
  return AimEligibilityService::GenericKillSwitchFeatureCheck(
      AimEligibilityServiceFactory::GetForProfile(profile),
      chrome::android::kAndroidComposeplateLFFAllLocales,
      chrome::android::kAndroidComposeplateLFF);
}

DEFINE_JNI(ComposeplateUtils)