Initial Binder interface for installd.
Define an AIDL for installd, starting with a single method. Publish
that interface for the system to start using. We'll circle back and
migrate more methods in future CLs.
Migrating installd to Binder will allow us to get rid of one of
the few lingering text-based command protocols, improving system
maintainability and security.
Test: builds, boots
Bug: 13758960, 30944031
Change-Id: Icdb5320082567e0355d8f76f413f01cfacf0fb99
diff --git a/cmds/installd/installd.cpp b/cmds/installd/installd.cpp
index c81a339..332bc5e 100644
--- a/cmds/installd/installd.cpp
+++ b/cmds/installd/installd.cpp
@@ -30,6 +30,8 @@
#include <cutils/sockets.h>
#include <private/android_filesystem_config.h>
+#include <InstalldNativeService.h>
+
#include <commands.h>
#include <globals.h>
#include <installd_constants.h>
@@ -705,7 +707,7 @@
char buf[BUFFER_MAX];
struct sockaddr addr;
socklen_t alen;
- int lsocket, s;
+ int lsocket, s, ret;
int selinux_enabled = (is_selinux_enabled() > 0);
setenv("ANDROID_LOG_TAGS", "*:v", 1);
@@ -732,6 +734,11 @@
exit(1);
}
+ if ((ret = InstalldNativeService::start()) != android::OK) {
+ ALOGE("Unable to start InstalldNativeService: %d", ret);
+ exit(1);
+ }
+
lsocket = android_get_control_socket(SOCKET_PATH);
if (lsocket < 0) {
ALOGE("Failed to get socket from environment: %s\n", strerror(errno));