diff options
author | Steven Moreland <smoreland@google.com> | 2019-09-18 12:04:22 -0700 |
---|---|---|
committer | Steven Moreland <smoreland@google.com> | 2019-09-18 12:10:08 -0700 |
commit | 23c28f5e21a6749e4df8e11eaa3c70f12fa9c616 (patch) | |
tree | 8231f7989f0791346ad96f305814e8116012cf39 /transport/HidlTransportSupport.cpp | |
parent | 520ecd4ec151a369a15d1ef9267c2cce1268393f (diff) | |
download | libhidl-23c28f5e21a6749e4df8e11eaa3c70f12fa9c616.tar.gz |
Hide IBase static maps.
Because sizeof(IBase) can't be changed, we have a couple of maps to
store data about IBase. Hiding these maps internally inside libhidl* so
that we can more easily remove them in the future if necessary.
Fixes: 122472540
Test: hidl_test, checking logs
Change-Id: Ic722a9fd1f406cf03abb072015078fc7192066ce
Diffstat (limited to 'transport/HidlTransportSupport.cpp')
-rw-r--r-- | transport/HidlTransportSupport.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/transport/HidlTransportSupport.cpp b/transport/HidlTransportSupport.cpp index b433b70..e645cd0 100644 --- a/transport/HidlTransportSupport.cpp +++ b/transport/HidlTransportSupport.cpp @@ -13,13 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include <hidl/HidlBinderSupport.h> #include <hidl/HidlTransportSupport.h> -#include <hidl/Static.h> + +#include <hidl/HidlBinderSupport.h> +#include "InternalStatic.h" #include <android-base/logging.h> #include <android/hidl/manager/1.0/IServiceManager.h> +#include <linux/sched.h> + namespace android { namespace hardware { @@ -92,6 +95,10 @@ bool setMinSchedulerPolicy(const sp<IBase>& service, int policy, int priority) { return true; } +SchedPrio getMinSchedulerPolicy(const sp<IBase>& service) { + return details::gServicePrioMap->get(service, {SCHED_NORMAL, 0}); +} + bool setRequestingSid(const sp<IBase>& service, bool requesting) { if (service->isRemote()) { LOG(ERROR) << "Can't set requesting sid on remote service."; @@ -108,6 +115,10 @@ bool setRequestingSid(const sp<IBase>& service, bool requesting) { return true; } +bool getRequestingSid(const sp<IBase>& service) { + return details::gServiceSidMap->get(service.get(), false); +} + bool interfacesEqual(const sp<IBase>& left, const sp<IBase>& right) { if (left == nullptr || right == nullptr || !left->isRemote() || !right->isRemote()) { return left == right; |