diff options
author | 2020-09-21 18:03:27 +0000 | |
---|---|---|
committer | 2020-09-21 18:04:59 +0000 | |
commit | 9514b203cf79a988f45908d63ca6c9223fca4a12 (patch) | |
tree | d88b0dfc3ddd9d69abcce777f9b43c2055dfe0bd /libs/binder/ProcessState.cpp | |
parent | 41a4c36712b23aff58d9305e4191dc18d143f6bd (diff) |
Reland "libbinder: ignore CallRestriction for magic 0 cmd"
This reverts commit 41a4c36712b23aff58d9305e4191dc18d143f6bd.
This fixes the CallRestriction issue, but removes the added test
which has problems in another context and will be fixed separately.
Reason for revert: refix b/167302413
Testing issue will be handled separately in b/168942807.
Fixes: 167302413
Change-Id: Iedc1ff73d086c973bfcab511ace26d0ec2291040
Diffstat (limited to 'libs/binder/ProcessState.cpp')
-rw-r--r-- | libs/binder/ProcessState.cpp | 10 |
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; } |