Merge "[Jetpack] Read display_featuers from core res"
This commit is contained in:
committed by
Android (Google) Code Review
commit
edcc760f96
@@ -4418,4 +4418,7 @@
|
||||
|
||||
<!-- Component names of the services which will keep critical code path warm -->
|
||||
<string-array name="config_keep_warming_services" translatable="false" />
|
||||
|
||||
<!-- WindowsManager JetPack display features -->
|
||||
<string name="config_display_features" translatable="false" />
|
||||
</resources>
|
||||
|
||||
@@ -4067,4 +4067,5 @@
|
||||
<java-symbol type="dimen" name="config_defaultBinderHeavyHitterAutoSamplerThreshold" />
|
||||
|
||||
<java-symbol type="array" name="config_keep_warming_services" />
|
||||
<java-symbol type="string" name="config_display_features" />
|
||||
</resources>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user