From 385ee5393d5790b0c1a38f9aab7bec51b9d0caf1 Mon Sep 17 00:00:00 2001 From: Felipe Leme Date: Wed, 7 Mar 2018 09:56:41 -0800 Subject: [PATCH] DO NOT MERGE - Disable warning on blocking one-way call from autofill server. This behavior existed since autofill was introduced on O and it won't be fixed on P, so there's no point on warning. In fact, the warning is often a red herring for other issues, not to mention a big logcat spammer. Bug: 35708678 Test: manual verification looking at logcat Change-Id: I40be4ce25abc5b097ea67e5cb34bb9c4237f0826 --- .../java/android/app/assist/AssistStructure.java | 16 ++++++++++++++++ .../com/android/server/autofill/Session.java | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/core/java/android/app/assist/AssistStructure.java b/core/java/android/app/assist/AssistStructure.java index ef41b10640cb2..d568662409d7a 100644 --- a/core/java/android/app/assist/AssistStructure.java +++ b/core/java/android/app/assist/AssistStructure.java @@ -2237,6 +2237,22 @@ public class AssistStructure implements Parcelable { return mWindowNodes.get(index); } + // TODO(b/35708678): temporary method that disable one-way warning flag on binder. + /** @hide */ + public void ensureDataForAutofill() { + if (mHaveData) { + return; + } + mHaveData = true; + Binder.allowBlocking(mReceiveChannel); + try { + ParcelTransferReader reader = new ParcelTransferReader(mReceiveChannel); + reader.go(); + } finally { + Binder.defaultBlocking(mReceiveChannel); + } + } + /** @hide */ public void ensureData() { if (mHaveData) { diff --git a/services/autofill/java/com/android/server/autofill/Session.java b/services/autofill/java/com/android/server/autofill/Session.java index bcfe1b6eb1f39..d0c35e6a8321f 100644 --- a/services/autofill/java/com/android/server/autofill/Session.java +++ b/services/autofill/java/com/android/server/autofill/Session.java @@ -251,7 +251,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState // change AssistStructure so it provides a "one-way" writeToParcel() method that // sends all the data try { - structure.ensureData(); + structure.ensureDataForAutofill(); } catch (RuntimeException e) { wtf(e, "Exception lazy loading assist structure for %s: %s", structure.getActivityComponent(), e);