summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi Li <dualli@google.com>2022-12-07 21:51:19 -0800
committerCarlos Llamas <cmllamas@google.com>2024-02-03 15:46:20 +0000
commit5006d0b4fdcf660c8fb73f97d317cdbe6b1aa6b6 (patch)
treefcc676b17012e01c78777167c561e58cecf7a9d9
parentecdacd1e9a5aa894c522e7143567c3700eca6080 (diff)
downloadlibhwbinder-5006d0b4fdcf660c8fb73f97d317cdbe6b1aa6b6.tar.gz
Support BR_TRANSACTION_PENDING_FROZEN
When an async binder transaction is sent to a frozen process, the kernel binder driver returns BR_TRANSACTION_PENDING_FROZEN. This tells the user space app that pending async binder transaction won't be processed until the target process is unfrozen at an unspecified time in the future. Generally all binder transactions to frozen processes should be avoided to prevent the kernel async binder buffer from running out. Bug: 253913841 Test: freeze process and check logcat Change-Id: Ie0191b0b3b6b0a4a8481f27f3b0e64e4c1279cb5 [cmllamas: picked from libbinder, fixed merge conflicts] Signed-off-by: Carlos Llamas <cmllamas@google.com>
-rw-r--r--IPCThreadState.cpp4
-rw-r--r--binder_kernel.h5
2 files changed, 9 insertions, 0 deletions
diff --git a/IPCThreadState.cpp b/IPCThreadState.cpp
index 2084a81..40e399b 100644
--- a/IPCThreadState.cpp
+++ b/IPCThreadState.cpp
@@ -812,6 +812,10 @@ status_t IPCThreadState::waitForResponse(Parcel *reply, status_t *acquireResult)
if (!reply && !acquireResult) goto finish;
break;
+ case BR_TRANSACTION_PENDING_FROZEN:
+ ALOGW("Sending oneway calls to frozen process.");
+ goto finish;
+
case BR_DEAD_REPLY:
err = DEAD_OBJECT;
goto finish;
diff --git a/binder_kernel.h b/binder_kernel.h
index 2695f51..648bab4 100644
--- a/binder_kernel.h
+++ b/binder_kernel.h
@@ -39,4 +39,9 @@
#define BINDER_ENABLE_ONEWAY_SPAM_DETECTION _IOW('b', 16, __u32)
#endif //BINDER_ENABLE_ONEWAY_SPAM_DETECTION
+#ifndef BR_TRANSACTION_PENDING_FROZEN
+// Temporary definition of BR_TRANSACTION_PENDING_FROZEN until UAPI binder.h includes it.
+#define BR_TRANSACTION_PENDING_FROZEN _IO('r', 20)
+#endif // BR_TRANSACTION_PENDING_FROZEN
+
#endif // ANDROID_HARDWARE_BINDER_KERNEL_H