Fix app compat dashboard from settings app

Fix an issue due to recent changes tha made the settings app
accidentally categorize non sdk gated changes as targetSdk > -1.

The recent changes made target sdk changes have a '>=' condition instead
of strictly '>', so address that issue as well.

Bug: 172043600
Test: open App Compatibility Changes option in Developer Options
Change-Id: Ic5ee203c5a82ac982164304e3ae399947a39e058
This commit is contained in:
Andrei Onea
2020-10-30 16:26:39 +00:00
committed by Andrei-Valentin Onea
parent 7e65d7f6fc
commit b0a6dd680e
2 changed files with 2 additions and 2 deletions

View File

@@ -11313,7 +11313,7 @@
<!-- Title for default disabled app compat changes category [CHAR LIMIT=50] -->
<string name="platform_compat_default_disabled_title">Default disabled changes</string>
<!-- Title for target SDK gated app compat changes category (do not translate 'targetSdkVersion') [CHAR LIMIT=50] -->
<string name="platform_compat_target_sdk_title">Enabled for targetSdkVersion &gt; <xliff:g id="number" example="29">%d</xliff:g></string>
<string name="platform_compat_target_sdk_title">Enabled for targetSdkVersion &gt;= <xliff:g id="number" example="29">%d</xliff:g></string>
<!-- Title for the dialog shown when no debuggable apps are available [CHAR LIMIT=30] -->
<string name="platform_compat_dialog_title_no_apps">No apps available</string>
<!-- Explanatory text shown when no debuggable apps are available [CHAR LIMIT=NONE] -->

View File

@@ -149,7 +149,7 @@ public class PlatformCompatDashboard extends DashboardFragment {
final List<CompatibilityChangeInfo> disabledChanges = new ArrayList<>();
final Map<Integer, List<CompatibilityChangeInfo>> targetSdkChanges = new TreeMap<>();
for (CompatibilityChangeInfo change : mChanges) {
if (change.getEnableSinceTargetSdk() != 0) {
if (change.getEnableSinceTargetSdk() > 0) {
List<CompatibilityChangeInfo> sdkChanges;
if (!targetSdkChanges.containsKey(change.getEnableSinceTargetSdk())) {
sdkChanges = new ArrayList<>();