Temporary stop-gap for Chrome target SDK issue.

The Chrome team was planning to provide a new prebuilt SDK last week
which returned to targeting the official R SDK level, but other
challenges prevented them from doing so.

They still intend to land an updated prebuilt which targets R, but
to unblock testing this change makes that change on their behalf;
when we see a very specific Chrome version code we force the target
SDK back to R.  This code will safely become a no-op during their
next prebuilt, which should have a different version code.

Bug: 183905675
Test: manual
Change-Id: I211e7550f489294f90d8729b518ec9a70a37ec96
This commit is contained in:
Jeff Sharkey
2021-03-29 18:52:29 -06:00
parent 4d139ff936
commit c6be9fe470

View File

@@ -2799,7 +2799,15 @@ public class ParsingPackageUtils {
}
}
@SuppressWarnings("AndroidFrameworkCompatChange")
private void convertSplitPermissions(ParsingPackage pkg) {
// STOPSHIP(b/183905675): REMOVE THIS TERRIBLE, HORRIBLE, NO GOOD, VERY BAD HACK
if ("com.android.chrome".equals(pkg.getPackageName())
&& pkg.getVersionCode() <= 445500399
&& pkg.getTargetSdkVersion() > Build.VERSION_CODES.R) {
pkg.setTargetSdkVersion(Build.VERSION_CODES.R);
}
final int listSize = mSplitPermissionInfos.size();
for (int is = 0; is < listSize; is++) {
final PermissionManager.SplitPermissionInfo spi = mSplitPermissionInfos.get(is);