Temporarily disable unsupported sdk warning for Q

Work around to make Q dogfoodable until we have time to move the
functionality to when the app actually crashes.

Bug: 75318890
Test: see app warnings without the patch. no app warnings visible when
patch is applied. for example: flash device, launch apps from appbar:
messages, play, chrome, camera.
Change-Id: I596d4e65a276b717aefb3c390cd1172850b03068
This commit is contained in:
Siarhei Vishniakou
2018-04-05 10:35:38 -07:00
parent 947d71ad8b
commit 2830dd72e2

View File

@@ -122,15 +122,15 @@ class AppWarnings {
return; return;
} }
final int platformSdk = Build.VERSION.SDK_INT;
if (ActivityManager.isRunningInTestHarness()
|| platformSdk == Build.VERSION_CODES.CUR_DEVELOPMENT) { // TODO(b/75318890): temp. fix to get q dogfoodable. Need to move this to when the app
// Don't show warning if we are running in a test harness or the platform is currently // actually crashes.
// in development, expect if we were requested to always show it for this activity. if (/*ActivityManager.isRunningInTestHarness()
if (!mAlwaysShowUnsupportedCompileSdkWarningActivities.contains(r.realActivity)) { &&*/ !mAlwaysShowUnsupportedCompileSdkWarningActivities.contains(r.realActivity)) {
return; // Don't show warning if we are running in a test harness and we don't have to always
} // show for this activity.
return;
} }
// If the application was built against an pre-release SDK that's older than the current // If the application was built against an pre-release SDK that's older than the current
@@ -139,6 +139,7 @@ class AppWarnings {
// codenames (e.g. simultaneous pre-release development), then we're likely to run into // codenames (e.g. simultaneous pre-release development), then we're likely to run into
// compatibility issues. Warn the user and offer to check for an update. // compatibility issues. Warn the user and offer to check for an update.
final int compileSdk = r.appInfo.compileSdkVersion; final int compileSdk = r.appInfo.compileSdkVersion;
final int platformSdk = Build.VERSION.SDK_INT;
final boolean isCompileSdkPreview = !"REL".equals(r.appInfo.compileSdkVersionCodename); final boolean isCompileSdkPreview = !"REL".equals(r.appInfo.compileSdkVersionCodename);
final boolean isPlatformSdkPreview = !"REL".equals(Build.VERSION.CODENAME); final boolean isPlatformSdkPreview = !"REL".equals(Build.VERSION.CODENAME);
if ((isCompileSdkPreview && compileSdk < platformSdk) if ((isCompileSdkPreview && compileSdk < platformSdk)