Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 13e49c60 authored by Arman Uguray's avatar Arman Uguray
Browse files

service: Move UNIX IPC code into ipc/unix/

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
parent 7a05ae5a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -25,9 +25,9 @@ btserviceCommonSrc := \
	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 \
+2 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ using android::status_t;
using android::String16;

namespace ipc {
namespace binder {

IPCHandlerBinder::IPCHandlerBinder(
    bluetooth::Adapter* adapter,
@@ -79,4 +80,5 @@ void IPCHandlerBinder::NotifyStarted() {
    delegate()->OnIPCHandlerStarted(IPCManager::TYPE_BINDER);
}

}  // namespace binder
}  // namespace ipc
+2 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include "service/ipc/ipc_manager.h"

namespace ipc {
namespace binder {

// Implements a Binder based IPCHandler.
class IPCHandlerBinder : public IPCHandler {
@@ -43,4 +44,5 @@ class IPCHandlerBinder : public IPCHandler {
  DISALLOW_COPY_AND_ASSIGN(IPCHandlerBinder);
};

}  // namespace binder
}  // namespace ipc
+3 −3
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
#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 {

@@ -43,7 +43,7 @@ bool IPCManager::Start(Type type, Delegate* delegate) {
      return false;
    }

    unix_handler_ = new IPCHandlerUnix(adapter_, delegate);
    unix_handler_ = new unix::IPCHandlerUnix(adapter_, delegate);
    if (!unix_handler_->Run()) {
      unix_handler_ = nullptr;
      return false;
@@ -56,7 +56,7 @@ bool IPCManager::Start(Type type, Delegate* delegate) {
      return false;
    }

    binder_handler_ = new IPCHandlerBinder(adapter_, delegate);
    binder_handler_ = new binder::IPCHandlerBinder(adapter_, delegate);
    if (!binder_handler_->Run()) {
      binder_handler_ = nullptr;
      return false;
+4 −2
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
//  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>
@@ -23,10 +23,11 @@

#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)
@@ -212,4 +213,5 @@ void IPCHandlerUnix::NotifyStoppedOnCurrentThread() {
    delegate()->OnIPCHandlerStopped(IPCManager::TYPE_UNIX);
}

}  // namespace unix
}  // namespace ipc
Loading