From 5655d7b5d809d52fed82831b93ef8e2083dd1d1f Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Tue, 15 Sep 2020 15:33:09 +0100 Subject: [PATCH] [Jetpack] Read display_featuers from core res - Introduced config_display_feautres in core res Bug: 168610278 Test: Manual Change-Id: Iee8114bd79d947c2ca28d379587da6c184de686c --- core/res/res/values/config.xml | 3 +++ core/res/res/values/symbols.xml | 1 + .../androidx/window/sidecar/SettingsSidecarImpl.java | 11 +++++++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 550162a242dc8..f23e69daf56bb 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -4411,4 +4411,7 @@ + + + diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 35ce780d34080..bd359eef87816 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -4062,4 +4062,5 @@ + diff --git a/libs/WindowManager/Jetpack/src/androidx/window/sidecar/SettingsSidecarImpl.java b/libs/WindowManager/Jetpack/src/androidx/window/sidecar/SettingsSidecarImpl.java index ca3a5112bc55f..5397302f6882a 100644 --- a/libs/WindowManager/Jetpack/src/androidx/window/sidecar/SettingsSidecarImpl.java +++ b/libs/WindowManager/Jetpack/src/androidx/window/sidecar/SettingsSidecarImpl.java @@ -37,6 +37,8 @@ import android.util.Log; import androidx.annotation.NonNull; +import com.android.internal.R; + import java.util.ArrayList; import java.util.List; import java.util.regex.Matcher; @@ -151,13 +153,18 @@ class SettingsSidecarImpl extends StubSidecar { return features; } - ContentResolver resolver = mContext.getContentResolver(); - final String displayFeaturesString = Settings.Global.getString(resolver, DISPLAY_FEATURES); if (isInMultiWindow(windowToken)) { // It is recommended not to report any display features in multi-window mode, since it // won't be possible to synchronize the display feature positions with window movement. return features; } + + ContentResolver resolver = mContext.getContentResolver(); + String displayFeaturesString = Settings.Global.getString(resolver, DISPLAY_FEATURES); + if (TextUtils.isEmpty(displayFeaturesString)) { + displayFeaturesString = mContext.getResources().getString( + R.string.config_display_features); + } if (TextUtils.isEmpty(displayFeaturesString)) { return features; }