Moved the UNIX IPC related code into a new ipc/unix subdirectory.
Added new namespace levels for unix and binder that mimic the
directory structure.
Change-Id: I58954d0c3dd1a6fe9c141c3122d42530385265f6
gatt_server.cpp \
hal/bluetooth_interface.cpp \
ipc/ipc_handler.cpp \
- ipc/ipc_handler_unix.cpp \
ipc/ipc_manager.cpp \
- ipc/unix_ipc_host.cpp \
+ ipc/unix/ipc_handler_unix.cpp \
+ ipc/unix/unix_ipc_host.cpp \
logging_helpers.cpp \
settings.cpp \
util/atomic_string.cpp \
using android::String16;
namespace ipc {
+namespace binder {
IPCHandlerBinder::IPCHandlerBinder(
bluetooth::Adapter* adapter,
delegate()->OnIPCHandlerStarted(IPCManager::TYPE_BINDER);
}
+} // namespace binder
} // namespace ipc
#include "service/ipc/ipc_manager.h"
namespace ipc {
+namespace binder {
// Implements a Binder based IPCHandler.
class IPCHandlerBinder : public IPCHandler {
DISALLOW_COPY_AND_ASSIGN(IPCHandlerBinder);
};
+} // namespace binder
} // namespace ipc
#include "service/ipc/ipc_manager.h"
#include "service/ipc/binder/ipc_handler_binder.h"
-#include "service/ipc/ipc_handler_unix.h"
+#include "service/ipc/unix/ipc_handler_unix.h"
namespace ipc {
return false;
}
- unix_handler_ = new IPCHandlerUnix(adapter_, delegate);
+ unix_handler_ = new unix::IPCHandlerUnix(adapter_, delegate);
if (!unix_handler_->Run()) {
unix_handler_ = nullptr;
return false;
return false;
}
- binder_handler_ = new IPCHandlerBinder(adapter_, delegate);
+ binder_handler_ = new binder::IPCHandlerBinder(adapter_, delegate);
if (!binder_handler_->Run()) {
binder_handler_ = nullptr;
return false;
// limitations under the License.
//
-#include "service/ipc/ipc_handler_unix.h"
+#include "service/ipc/unix/ipc_handler_unix.h"
#include <sys/socket.h>
#include <sys/un.h>
#include "osi/include/socket_utils/sockets.h"
#include "service/daemon.h"
-#include "service/ipc/unix_ipc_host.h"
+#include "service/ipc/unix/unix_ipc_host.h"
#include "service/settings.h"
namespace ipc {
+namespace unix {
IPCHandlerUnix::IPCHandlerUnix(bluetooth::Adapter* adapter,
IPCManager::Delegate* delegate)
delegate()->OnIPCHandlerStopped(IPCManager::TYPE_UNIX);
}
+} // namespace unix
} // namespace ipc
} // namespace base
namespace ipc {
+namespace unix {
// Implements a UNIX domain-socket based IPCHandler
class IPCHandlerUnix : public IPCHandler {
DISALLOW_COPY_AND_ASSIGN(IPCHandlerUnix);
};
+} // namespace unix
} // namespace ipc
#define LOG_TAG "bt_bluetooth_host"
-#include "service/ipc/unix_ipc_host.h"
+#include "service/ipc/unix/unix_ipc_host.h"
#include <errno.h>
#include <stdio.h>
} // namespace
namespace ipc {
+namespace unix {
UnixIPCHost::UnixIPCHost(int sockfd, Adapter* adapter)
: adapter_(adapter), pfds_(1, {sockfd, POLLIN, 0}) {}
return true;
}
+} // namespace unix
} // namespace ipc
} // namespace bluetooth
namespace ipc {
+namespace unix {
// This implements a single threaded event loop which dispatches
// reads from a set of FDs (pfds_) to a set of handlers.
gatt_servers_;
};
+} // namespace unix
} // namespace ipc
// unit tests for host.
namespace ipc {
+namespace binder {
IPCHandlerBinder::IPCHandlerBinder(
bluetooth::Adapter* adapter,
// Stub
}
-} // namespace
+} // namespace binder
+} // namespace ipc