summaryrefslogtreecommitdiff
path: root/libs/binder/ProcessState.cpp
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2020-09-22 22:39:52 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2020-09-22 22:39:52 +0000
commite88af87183ac5734fa2064f474c9969be38d9a44 (patch)
tree48d1ffd0659f16fe016f452fbf0601f1ff5b7517 /libs/binder/ProcessState.cpp
parente8996bd9d0ab217035994b179f930ae7680c1f12 (diff)
parentd4c28086bcbaffde7dd5a662ab9d5ab068097a84 (diff)
Merge "Reland "libbinder: ignore CallRestriction for magic 0 cmd"" am: d4c28086bc
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1433351 Change-Id: I1e907c2fed596506e5250be65d9bbe77a3e294ee
Diffstat (limited to 'libs/binder/ProcessState.cpp')
-rw-r--r--libs/binder/ProcessState.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/libs/binder/ProcessState.cpp b/libs/binder/ProcessState.cpp
index a53056560e..83ca687519 100644
--- a/libs/binder/ProcessState.cpp
+++ b/libs/binder/ProcessState.cpp
@@ -282,9 +282,17 @@ sp<IBinder> ProcessState::getStrongProxyForHandle(int32_t handle)
// a driver API to get a handle to the context manager with
// proper reference counting.
+ IPCThreadState* ipc = IPCThreadState::self();
+
+ CallRestriction originalCallRestriction = ipc->getCallRestriction();
+ ipc->setCallRestriction(CallRestriction::NONE);
+
Parcel data;
- status_t status = IPCThreadState::self()->transact(
+ status_t status = ipc->transact(
0, IBinder::PING_TRANSACTION, data, nullptr, 0);
+
+ ipc->setCallRestriction(originalCallRestriction);
+
if (status == DEAD_OBJECT)
return nullptr;
}