mirror of
https://github.com/electron/electron.git
synced 2026-01-28 16:58:21 -05:00
initialize bluetooth for linux
This commit is contained in:
@@ -48,6 +48,11 @@
|
||||
#include "ui/gfx/platform_font_win.h"
|
||||
#endif
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
#include "device/bluetooth/bluetooth_adapter_factory.h"
|
||||
#include "device/bluetooth/dbus/dbus_bluez_manager_wrapper_linux.h"
|
||||
#endif
|
||||
|
||||
using content::BrowserThread;
|
||||
|
||||
namespace brightray {
|
||||
@@ -219,6 +224,9 @@ void BrowserMainParts::PostMainMessageLoopStart() {
|
||||
// if X exits before us.
|
||||
ui::SetX11ErrorHandlers(BrowserX11ErrorHandler, BrowserX11IOErrorHandler);
|
||||
#endif
|
||||
#if defined(OS_LINUX)
|
||||
bluez::DBusBluezManagerWrapperLinux::Initialize();
|
||||
#endif
|
||||
}
|
||||
|
||||
void BrowserMainParts::PostMainMessageLoopRun() {
|
||||
@@ -244,4 +252,11 @@ int BrowserMainParts::PreCreateThreads() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void BrowserMainParts::PostDestroyThreads() {
|
||||
#if defined(OS_LINUX)
|
||||
device::BluetoothAdapterFactory::Shutdown();
|
||||
bluez::DBusBluezManagerWrapperLinux::Shutdown();
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace brightray
|
||||
|
||||
@@ -45,6 +45,7 @@ class BrowserMainParts : public content::BrowserMainParts {
|
||||
void PostMainMessageLoopStart() override;
|
||||
void PostMainMessageLoopRun() override;
|
||||
int PreCreateThreads() override;
|
||||
void PostDestroyThreads() override;
|
||||
|
||||
private:
|
||||
#if defined(OS_MACOSX)
|
||||
|
||||
Reference in New Issue
Block a user