From b470718b9fc2030d933e370d4205d0834a63af0f Mon Sep 17 00:00:00 2001 From: Soonil Nagarkar Date: Tue, 2 Apr 2019 20:50:02 -0700 Subject: [PATCH] Deprecate runOnBinderBlocking() Test: n/a Change-Id: I15520cd005737f88d8281e112c0e90a06b3a79e6 --- services/core/java/com/android/server/ServiceWatcher.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/services/core/java/com/android/server/ServiceWatcher.java b/services/core/java/com/android/server/ServiceWatcher.java index a5a515f93e757..e3dc3b7a98484 100644 --- a/services/core/java/com/android/server/ServiceWatcher.java +++ b/services/core/java/com/android/server/ServiceWatcher.java @@ -382,7 +382,13 @@ public class ServiceWatcher implements ServiceConnection { /** * Runs the given function synchronously if currently connected, and returns the default value * if not currently connected or if any exception is thrown. + * + * @deprecated Using this function is an indication that your AIDL API is broken. Calls from + * system server to outside MUST be one-way, and so cannot return any result, and this + * method should not be needed or used. Use a separate callback interface to allow outside + * components to return results back to the system server. */ + @Deprecated public final T runOnBinderBlocking(BlockingBinderRunner runner, T defaultValue) { try { return runOnHandlerBlocking(() -> {