DisplayController should deep compare mPerDisplayBounds

- In CHANGE_SUPPORTED_BOUNDS check, it uses Map.equals, but as the value is a primitive array WindowBounds[], equals check does not deep compare the arrays and may result in false negative
- One example is when fontScale changes, DisplayController re-create bounds from WindowManagerProxy, result in new WindowBounds[] created, and the shallow compare results in unexpected CHANGE_SUPPORTED_BOUNDS

Fix: 282736623
Test: DisplayControllerTest
Change-Id: I3897595c58559192b951ecfee7c9f62a07dafe1f
This commit is contained in:
Alex Chau
2023-05-15 17:14:39 +01:00
parent fb51c85cae
commit 7af659da9e
8 changed files with 202 additions and 32 deletions

View File

@@ -131,7 +131,8 @@ public class MainThreadInitializedObject<T> {
* Find a cached object from mObjectMap if we have already created one. If not, generate
* an object using the provider.
*/
private <T> T getObject(MainThreadInitializedObject<T> object, ObjectProvider<T> provider) {
protected <T> T getObject(MainThreadInitializedObject<T> object,
ObjectProvider<T> provider) {
synchronized (mDestroyLock) {
if (mDestroyed) {
Log.e(TAG, "Static object access with a destroyed context");