Add android.hidl.token@1.0::ITokenManager impl.
For now, this service will be part of hwservicemanager because it is
also for registration and unregistration of services. There are a couple
main differences between IServiceManager and ITokenManager:
- IServiceManager keeps strong references to interfaces, but ITokenManager
keeps week references.
- IServiceManager receives the token (name) of an interface, but
ITokenManager creates and returns tokens to things registering
themselves.
Test: hidl_test passes:
make hidl_test hwservicemanager -j64 && adb sync && phone-kill
hwservicemanager && adb shell ./data/nativetest64/hidl_test/hidl_test64
(where phone-kill kills a process on my phone. hwservicemanager will
automatically restart)
Bug: 33058559
Change-Id: I09741aa99edb7c2c97ffc057c7ff71d9d9dabc02
diff --git a/Android.bp b/Android.bp
index 6cebe6a..60ae9a4 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,3 +1,17 @@
+// 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.
+
cc_binary {
name: "hwservicemanager",
init_rc: [
@@ -7,6 +21,7 @@
"HidlService.cpp",
"ServiceManager.cpp",
"service.cpp",
+ "TokenManager.cpp",
],
cflags: [
"-Wall",
@@ -14,13 +29,14 @@
"-Werror",
],
shared_libs: [
+ "android.hidl.token@1.0",
"libbase",
+ "libcutils",
"libhidlbase",
- "libhidltransport",
+ "libhidltransport", // TODO(b/33276472#6) includes android.hidl.manager@1.0
+ "libhwbinder",
"liblog",
"libselinux",
- "libhwbinder",
- "libcutils",
"libutils",
],
export_shared_lib_headers: [