elabadysayed | b2575f9 | 2024-07-22 16:49:39 | [diff] [blame] | 1 | // Copyright 2024 The Chromium Authors |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include <string> |
| 6 | |
| 7 | #include "base/android/feature_map.h" |
| 8 | #include "base/base_jni/BaseFeatureMap_jni.h" |
| 9 | #include "base/feature_list.h" |
| 10 | #include "base/features.h" |
| 11 | #include "base/no_destructor.h" |
| 12 | |
| 13 | namespace base::android { |
| 14 | |
| 15 | namespace { |
| 16 | // Array of features exposed through the Java BaseFeatureMap API. Entries in |
| 17 | // this array may either refer to features defined in //base features. |
| 18 | const base::Feature* const kFeaturesExposedToJava[] = { |
Shintaro Kawamura | 1ec1f49 | 2025-03-27 02:09:51 | [diff] [blame] | 19 | &features::kBackgroundNotPerceptibleBinding, |
elabadysayed | b2575f9 | 2024-07-22 16:49:39 | [diff] [blame] | 20 | &features::kPostPowerMonitorBroadcastReceiverInitToBackground, |
elabadysayed | 65d3c88 | 2024-07-30 18:36:20 | [diff] [blame] | 21 | &features::kPostGetMyMemoryStateToBackground, |
Shintaro Kawamura | 0bff6b5 | 2025-05-07 04:26:39 | [diff] [blame] | 22 | &features::kUseSharedRebindServiceConnection, |
elabadysayed | b2575f9 | 2024-07-22 16:49:39 | [diff] [blame] | 23 | }; |
| 24 | |
| 25 | // static |
| 26 | base::android::FeatureMap* GetFeatureMap() { |
David Benjamin | abf93ed | 2025-01-29 22:09:03 | [diff] [blame] | 27 | static base::NoDestructor<base::android::FeatureMap> kFeatureMap( |
| 28 | kFeaturesExposedToJava); |
elabadysayed | b2575f9 | 2024-07-22 16:49:39 | [diff] [blame] | 29 | return kFeatureMap.get(); |
| 30 | } |
| 31 | |
| 32 | } // namespace |
| 33 | |
| 34 | static jlong JNI_BaseFeatureMap_GetNativeMap(JNIEnv* env) { |
| 35 | return reinterpret_cast<jlong>(GetFeatureMap()); |
| 36 | } |
| 37 | |
| 38 | } // namespace base::android |