Revert "Add gServiceSidMap."

This reverts commit a13980d4fc8f7099174c6662808dfd70b6ec6b39.

Reason for revert: Breaks QCOM prebuilts.

Bug: 122551831
Bug: 121035042
Change-Id: I792c5bcb6c8d5b613277c001da36965f7a29af69
Test: reverting stops cnd crashing on crosshatch
(cherry picked from commit b9074decfac036b5b354aafd50b05ad3b8f3ba69)
diff --git a/transport/HidlTransportSupport.cpp b/transport/HidlTransportSupport.cpp
index db70438..c9937f1 100644
--- a/transport/HidlTransportSupport.cpp
+++ b/transport/HidlTransportSupport.cpp
@@ -42,20 +42,6 @@
     return handleBinderPoll();
 }
 
-// TODO(b/122472540): only store one data item per object
-template <typename V>
-static void pruneMapLocked(ConcurrentMap<wp<IBase>, V>& map) {
-    std::vector<wp<IBase>> toDelete;
-    for (const auto& kv : map) {
-        if (kv.first.promote() == nullptr) {
-            toDelete.push_back(kv.first);
-        }
-    }
-    for (const auto& k : toDelete) {
-        map.eraseLocked(k);
-    }
-}
-
 bool setMinSchedulerPolicy(const sp<IBase>& service, int policy, int priority) {
     if (service->isRemote()) {
         LOG(ERROR) << "Can't set scheduler policy on remote service.";
@@ -85,25 +71,20 @@
     // 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();
-    pruneMapLocked(details::gServicePrioMap);
-    details::gServicePrioMap.setLocked(service, {policy, priority});
 
-    return true;
-}
-
-bool setRequestingSid(const sp<IBase>& service, bool requesting) {
-    if (service->isRemote()) {
-        LOG(ERROR) << "Can't set requesting sid on remote service.";
-        return false;
+    std::vector<wp<IBase>> toDelete;
+    for (const auto& kv : details::gServicePrioMap) {
+        if (kv.first.promote() == nullptr) {
+            toDelete.push_back(kv.first);
+        }
     }
-
-    // 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.
-    std::unique_lock<std::mutex> lock = details::gServiceSidMap.lock();
-    pruneMapLocked(details::gServiceSidMap);
-    details::gServiceSidMap.setLocked(service, requesting);
+    for (const auto& k : toDelete) {
+        details::gServicePrioMap.eraseLocked(k);
+    }
+    details::gServicePrioMap.setLocked(service, {policy, priority});
 
     return true;
 }
diff --git a/transport/Static.cpp b/transport/Static.cpp
index 0bbd48d..45ae27c 100644
--- a/transport/Static.cpp
+++ b/transport/Static.cpp
@@ -33,9 +33,7 @@
 ConcurrentMap<const ::android::hidl::base::V1_0::IBase*, wp<::android::hardware::BHwBinder>>
     gBnMap{};
 
-// TODO(b/122472540): replace with single, hidden map
 ConcurrentMap<wp<::android::hidl::base::V1_0::IBase>, SchedPrio> gServicePrioMap{};
-ConcurrentMap<wp<::android::hidl::base::V1_0::IBase>, bool> gServiceSidMap{};
 
 // Deprecated; kept for ABI compatibility. Use getBsConstructorMap.
 BsConstructorMap gBsConstructorMap{};
diff --git a/transport/include/hidl/ConcurrentMap.h b/transport/include/hidl/ConcurrentMap.h
index 1b06dfd..54c1a32 100644
--- a/transport/include/hidl/ConcurrentMap.h
+++ b/transport/include/hidl/ConcurrentMap.h
@@ -67,7 +67,6 @@
     std::unique_lock<std::mutex> lock() { return std::unique_lock<std::mutex>(mMutex); }
 
     void setLocked(K&& k, V&& v) { mMap[std::forward<K>(k)] = std::forward<V>(v); }
-    void setLocked(K&& k, const V& v) { mMap[std::forward<K>(k)] = v; }
 
     const V& getLocked(const K& k, const V& def) const {
         const_iterator iter = mMap.find(k);
diff --git a/transport/include/hidl/HidlTransportSupport.h b/transport/include/hidl/HidlTransportSupport.h
index a132bfa..69f3291 100644
--- a/transport/include/hidl/HidlTransportSupport.h
+++ b/transport/include/hidl/HidlTransportSupport.h
@@ -85,18 +85,6 @@
                            int policy, int priority);
 
 /**
- * Sets whether or not this object should request security contexts to be populatd for incoming
- * calls (e.g. with getCallingSid).
- *
- * This method MUST be called before passing this service to another process
- * and/or registering it with registerAsService().
- *
- * @param service the service to set the policy for
- * @param requesting whether or not to request sid (default is false)
- */
-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.
diff --git a/transport/include/hidl/Static.h b/transport/include/hidl/Static.h
index cc711b7..b50c173 100644
--- a/transport/include/hidl/Static.h
+++ b/transport/include/hidl/Static.h
@@ -38,7 +38,6 @@
 };
 
 extern ConcurrentMap<wp<::android::hidl::base::V1_0::IBase>, SchedPrio> gServicePrioMap;
-extern ConcurrentMap<wp<::android::hidl::base::V1_0::IBase>, bool> gServiceSidMap;
 
 // For HidlBinderSupport and autogenerated code
 extern ConcurrentMap<const ::android::hidl::base::V1_0::IBase*, wp<::android::hardware::BHwBinder>>