[automerger skipped] Merge "DO NOT MERGE - Merge PPRL.190305.001 into master"
am: 88fdd29aae -s ours
am skip reason: subject contains skip directive
Change-Id: I626e50760b644d0627baf8101ea568e7e778202a
diff --git a/transport/HidlTransportSupport.cpp b/transport/HidlTransportSupport.cpp
index 311504d..db70438 100644
--- a/transport/HidlTransportSupport.cpp
+++ b/transport/HidlTransportSupport.cpp
@@ -44,9 +44,7 @@
// TODO(b/122472540): only store one data item per object
template <typename V>
-static void pruneMapLocked(ConcurrentMap<wp<::android::hidl::base::V1_0::IBase>, V>& map) {
- using ::android::hidl::base::V1_0::IBase;
-
+static void pruneMapLocked(ConcurrentMap<wp<IBase>, V>& map) {
std::vector<wp<IBase>> toDelete;
for (const auto& kv : map) {
if (kv.first.promote() == nullptr) {
@@ -58,8 +56,7 @@
}
}
-bool setMinSchedulerPolicy(const sp<::android::hidl::base::V1_0::IBase>& service,
- int policy, int priority) {
+bool setMinSchedulerPolicy(const sp<IBase>& service, int policy, int priority) {
if (service->isRemote()) {
LOG(ERROR) << "Can't set scheduler policy on remote service.";
return false;
@@ -88,27 +85,16 @@
// Due to ABI considerations, IBase cannot have a destructor to clean this up.
// So, because this API is so infrequently used, (expected to be usually only
// one time for a process, but it can be more), we are cleaning it up here.
- // TODO(b/37794345): if ever we update the HIDL ABI for launches in an Android
- // release in the meta-version sense, we should remove this.
std::unique_lock<std::mutex> lock = details::gServicePrioMap.lock();
-
- std::vector<wp<IBase>> toDelete;
- for (const auto& kv : details::gServicePrioMap) {
- if (kv.first.promote() == nullptr) {
- toDelete.push_back(kv.first);
- }
- }
- for (const auto& k : toDelete) {
- details::gServicePrioMap.eraseLocked(k);
- }
+ pruneMapLocked(details::gServicePrioMap);
details::gServicePrioMap.setLocked(service, {policy, priority});
return true;
}
-bool setRequestingSid(const sp<::android::hidl::base::V1_0::IBase>& service, bool requesting) {
+bool setRequestingSid(const sp<IBase>& service, bool requesting) {
if (service->isRemote()) {
- ALOGE("Can't set requesting sid on remote service.");
+ LOG(ERROR) << "Can't set requesting sid on remote service.";
return false;
}
diff --git a/transport/include/hidl/HidlTransportSupport.h b/transport/include/hidl/HidlTransportSupport.h
index d29a3e4..a132bfa 100644
--- a/transport/include/hidl/HidlTransportSupport.h
+++ b/transport/include/hidl/HidlTransportSupport.h
@@ -85,14 +85,6 @@
int policy, int priority);
/**
- * Returns whether two interfaces represent the same interface. References to interfaces in the same
- * process will always be equivalent. However, in order to compare a service that is a proxy to a
- * different process, its underlying structure may have to be checked.
- */
-bool interfacesEqual(const sp<::android::hidl::base::V1_0::IBase>& left,
- const sp<::android::hidl::base::V1_0::IBase>& right);
-
-/**
* Sets whether or not this object should request security contexts to be populatd for incoming
* calls (e.g. with getCallingSid).
*
@@ -104,6 +96,14 @@
*/
bool setRequestingSid(const sp<::android::hidl::base::V1_0::IBase>& service, bool requesting);
+/**
+ * Returns whether two interfaces represent the same interface. References to interfaces in the same
+ * process will always be equivalent. However, in order to compare a service that is a proxy to a
+ * different process, its underlying structure may have to be checked.
+ */
+bool interfacesEqual(const sp<::android::hidl::base::V1_0::IBase>& left,
+ const sp<::android::hidl::base::V1_0::IBase>& right);
+
namespace details {
// Return PID on userdebug / eng builds and IServiceManager::PidConstant::NO_PID on user builds.