Index: device/bluetooth/BUILD.gn |
diff --git a/device/bluetooth/BUILD.gn b/device/bluetooth/BUILD.gn |
index 04f46ae71e739f5a42985ed2ca8035bec920f4d8..3de71320584d768944bddf11e9c811681e1d7760 100644 |
--- a/device/bluetooth/BUILD.gn |
+++ b/device/bluetooth/BUILD.gn |
@@ -4,6 +4,10 @@ |
import("//tools/grit/grit_rule.gni") |
+if (is_android) { |
+ import("//build/config/android/rules.gni") # For generate_jni(). |
+} |
+ |
config("bluetooth_config") { |
if (is_win) { |
ldflags = [ |
@@ -19,6 +23,8 @@ config("bluetooth_config") { |
component("bluetooth") { |
sources = [ |
+ "android/bluetooth_jni_registrar.cc", |
+ "android/bluetooth_jni_registrar.h", |
"bluetooth_adapter.cc", |
"bluetooth_adapter.h", |
"bluetooth_adapter_android.cc", |
@@ -123,9 +129,11 @@ component("bluetooth") { |
"//ui/base", |
] |
- if (is_win) { |
- libs = [ "setupapi.lib" ] |
- } else if (is_chromeos) { |
+ if (is_android) { |
+ deps += [ ":bluetooth_jni" ] |
+ } |
+ |
+ if (is_chromeos) { |
deps += [ |
"//chromeos", |
"//dbus", |
@@ -135,6 +143,10 @@ component("bluetooth") { |
if (is_mac) { |
libs = [ "IOBluetooth.framework" ] |
} |
+ |
+ if (is_win) { |
+ libs = [ "setupapi.lib" ] |
+ } |
} |
grit("strings") { |
@@ -228,3 +240,12 @@ static_library("mocks") { |
"//testing/gmock", |
] |
} |
+ |
+if (is_android) { |
+ generate_jni("bluetooth_jni") { |
+ sources = [ |
+ "android/java/src/org/chromium/device/bluetooth/BluetoothAdapter.java", |
+ ] |
+ jni_package = "bluetooth" |
+ } |
+} |