From 302092af9e57e8a703e890741b3385d7694a0048 Mon Sep 17 00:00:00 2001 From: Alan Viverette Date: Wed, 13 Nov 2019 15:27:11 +0000 Subject: [PATCH] Add explicit note that LayoutInflater is not thread-safe Bug: 143353100 Change-Id: I8ac72ba3db9ebb707ab071bc7f9c56888c15d18c Test: n/a docs only --- core/java/android/view/LayoutInflater.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/java/android/view/LayoutInflater.java b/core/java/android/view/LayoutInflater.java index 1fc7f0e36095a..75862e01d41c9 100644 --- a/core/java/android/view/LayoutInflater.java +++ b/core/java/android/view/LayoutInflater.java @@ -62,19 +62,20 @@ import java.util.Objects; * {@link Context#getSystemService} to retrieve a standard LayoutInflater instance * that is already hooked up to the current context and correctly configured * for the device you are running on. - * *

* To create a new LayoutInflater with an additional {@link Factory} for your * own views, you can use {@link #cloneInContext} to clone an existing * ViewFactory, and then call {@link #setFactory} on it to include your * Factory. - * *

* For performance reasons, view inflation relies heavily on pre-processing of * XML files that is done at build time. Therefore, it is not currently possible * to use LayoutInflater with an XmlPullParser over a plain XML file at runtime; * it only works with an XmlPullParser returned from a compiled resource * (R.something file.) + *

+ * Note: This class is not thread-safe and a given + * instance should only be accessed by a single thread. */ @SystemService(Context.LAYOUT_INFLATER_SERVICE) public abstract class LayoutInflater {