From 254351a6a784cf9deca8e89fed70287073efb163 Mon Sep 17 00:00:00 2001 From: Marin Shalamanov Date: Mon, 8 Mar 2021 19:27:53 +0100 Subject: [PATCH] Update device info on Display.getDeviceProductInfo() Each getter of the Display class should first call updateDisplayInfoLocked(). Test: presubmit Bug: 179775994 Change-Id: I4df9945cd030296da0e170411af8c66c89f57adf --- core/java/android/view/Display.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/java/android/view/Display.java b/core/java/android/view/Display.java index d11136ec98222..d484f4d47e990 100644 --- a/core/java/android/view/Display.java +++ b/core/java/android/view/Display.java @@ -1203,7 +1203,10 @@ public final class Display { */ @Nullable public DeviceProductInfo getDeviceProductInfo() { - return mDisplayInfo.deviceProductInfo; + synchronized (mLock) { + updateDisplayInfoLocked(); + return mDisplayInfo.deviceProductInfo; + } } /**