Fix isAtLeastS failed on SCV2 and master

Bug: 196388694
Change-Id: Ia86664ee875d428c4b98d48e9aa0218ea4d94009
Test: manual
(cherry picked from commit 3f46e5ff56)
This commit is contained in:
Edgar Wang
2021-08-17 02:56:42 +00:00
parent c85de8cf77
commit 9017382b77

View File

@@ -52,9 +52,9 @@ public final class BuildCompatUtils {
}
return (VERSION.CODENAME.equals("REL") && VERSION.SDK_INT >= 31)
|| (VERSION.CODENAME.length() == 1
&& VERSION.CODENAME.compareTo("S") >= 0
&& VERSION.CODENAME.compareTo("Z") <= 0);
|| (VERSION.CODENAME.length() >= 1
&& VERSION.CODENAME.toUpperCase().charAt(0) >= 'S'
&& VERSION.CODENAME.toUpperCase().charAt(0) <= 'Z');
}
private BuildCompatUtils() {}