[Thread] add ot-daemon to com.android.tethering
ot-daemon is a dependency of the new Thread feature. This commit
add the ot-daemon binary and init rc file to the Tethering module.
Note that the ot-daemon service is default disabled and versioned
init rc file is used to ensure that this service won't be started
before Android U.
This is expected to increase the size of "com.android.tethering.capex"
by around 400 KB.
Manual verification:
1. on Android T (33) CF device, the ot-daemon service is not started
after device boots; It reports service not found error when trying
to start the ot-daemon service with adb shell command "start
ot-daemon"
2. on Android U (34) CF device, the ot-daemon service is not started
after device boots; It can be started with shell comamnd "start
ot-daemon" but then failed because of missing sepolicy rules as
expected
Test: see above manual verification note
Bug: 296211911
Change-Id: I222e2bbcc2ad0be2beec9f5f3406e7144d314370
diff --git a/thread/apex/Android.bp b/thread/apex/Android.bp
new file mode 100644
index 0000000..28854f2
--- /dev/null
+++ b/thread/apex/Android.bp
@@ -0,0 +1,29 @@
+//
+// Copyright (C) 2023 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.
+//
+
+package {
+ default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+// Versioned ot-daemon init file which will be processed by the system on 34+ devices.
+// See https://android.googlesource.com/platform/system/core/+/HEAD/init/README.md#versioned-rc-files-within-apexs
+// for details of versioned rc files.
+prebuilt_etc {
+ name: "ot-daemon.init.34rc",
+ src: "ot-daemon.34rc",
+ filename: "init.34rc",
+ installable: false,
+}