blob: ce46e3da0cb4600c333e0e27b746dbd4de9a2bce (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/fake_bluetooth_le_advertisement_service_provider.h"
#include "chromeos/dbus/fake_bluetooth_le_advertising_manager_client.h"
namespace chromeos {
FakeBluetoothLEAdvertisementServiceProvider::
FakeBluetoothLEAdvertisementServiceProvider(
const dbus::ObjectPath& object_path,
Delegate* delegate)
: delegate_(delegate) {
object_path_ = object_path;
VLOG(1) << "Creating Bluetooth Advertisement: " << object_path_.value();
FakeBluetoothLEAdvertisingManagerClient*
fake_bluetooth_profile_manager_client =
static_cast<FakeBluetoothLEAdvertisingManagerClient*>(
DBusThreadManager::Get()
->GetBluetoothLEAdvertisingManagerClient());
fake_bluetooth_profile_manager_client->RegisterAdvertisementServiceProvider(
this);
}
FakeBluetoothLEAdvertisementServiceProvider::
~FakeBluetoothLEAdvertisementServiceProvider() {
VLOG(1) << "Cleaning up Bluetooth Advertisement: " << object_path_.value();
FakeBluetoothLEAdvertisingManagerClient*
fake_bluetooth_profile_manager_client =
static_cast<FakeBluetoothLEAdvertisingManagerClient*>(
DBusThreadManager::Get()
->GetBluetoothLEAdvertisingManagerClient());
fake_bluetooth_profile_manager_client->UnregisterAdvertisementServiceProvider(
this);
}
void FakeBluetoothLEAdvertisementServiceProvider::Release() {
VLOG(1) << object_path_.value() << ": Release";
delegate_->Released();
}
} // namespace chromeos
|