Merge "Fix thread-shared field evades lock acquisition reported by Coverity" am: 66fc99d578 am: 7427d997f6

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1646974

Change-Id: I6b290dc2cbb93837e74ea5040b359e72d22beab0
This commit is contained in:
John Reck
2021-03-23 20:28:06 +00:00
committed by Automerger Merge Worker

View File

@@ -1196,13 +1196,11 @@ public class Typeface {
/** @hide */ /** @hide */
public boolean isSupportedAxes(int axis) { public boolean isSupportedAxes(int axis) {
if (mSupportedAxes == null) { synchronized (this) {
synchronized (this) { if (mSupportedAxes == null) {
mSupportedAxes = nativeGetSupportedAxes(native_instance);
if (mSupportedAxes == null) { if (mSupportedAxes == null) {
mSupportedAxes = nativeGetSupportedAxes(native_instance); mSupportedAxes = EMPTY_AXES;
if (mSupportedAxes == null) {
mSupportedAxes = EMPTY_AXES;
}
} }
} }
} }