blob: 9dcbba0301060629a3ee12934b274de4fe440314 [file] [log] [blame]
// Copyright 2020 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/feature_map.h"
#include "base/feature_list.h"
#include "base/no_destructor.h"
#include "device/fido/features.h"
#include "services/device/public/cpp/device_features.h"
#include "services/device/public/java/device_feature_list_jni/DeviceFeatureMap_jni.h"
namespace features {
namespace {
// Array of features exposed through the Java DeviceFeatureMap API. Entries in
// this array may either refer to features defined in
// services/device/public/cpp/device_features.h or in other locations in the
// code base.
const base::Feature* const kFeaturesExposedToJava[] = {
&device::kWebAuthnAndroidCredMan,
&device::kWebAuthnAndroidFidoJson,
&device::kWebAuthnHybridLinkWithoutNotifications,
&kGenericSensorExtraClasses,
};
// static
base::android::FeatureMap* GetFeatureMap() {
static base::NoDestructor<base::android::FeatureMap> kFeatureMap(std::vector(
std::begin(kFeaturesExposedToJava), std::end(kFeaturesExposedToJava)));
return kFeatureMap.get();
}
} // namespace
static jlong JNI_DeviceFeatureMap_GetNativeMap(JNIEnv* env) {
return reinterpret_cast<jlong>(GetFeatureMap());
}
} // namespace features