Initial netd binder interface.
In this change:
1. AIDL files for a new, android.net.INetd service, and
corresponding implementation using generated code. For now the
interface is just a prototype: it only has one trivial method.
2. Permission checking code to check for CONNECTIVITY_INTERNAL.
3. Add a Big Netd Lock and provide a wrapper that makes it easy
to ensure that it is taken by every CommandListener command.
Bug: 27239233
Change-Id: I448d0ac233edd0e351a7fe7f13901fb6871683a2
diff --git a/server/NetdNativeService.h b/server/NetdNativeService.h
new file mode 100644
index 0000000..6ca4432
--- /dev/null
+++ b/server/NetdNativeService.h
@@ -0,0 +1,36 @@
+/**
+ * Copyright (c) 2016, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _NETD_NATIVE_SERVICE_H_
+#define _NETD_NATIVE_SERVICE_H_
+
+#include <binder/BinderService.h>
+
+#include "android/net/BnNetd.h"
+
+namespace android {
+namespace net {
+
+class NetdNativeService : public BinderService<NetdNativeService>, public BnNetd {
+ public:
+ static char const* getServiceName() { return "android.net.INetd"; }
+ binder::Status isAlive(bool *alive) override;
+};
+
+} // namespace net
+} // namespace android
+
+#endif // _NETD_NATIVE_SERVICE_H_