Fix broken target SDK checks.
Consider an app targeting the final API 28, but running on an older build where "P" is still API 10000. Those apps need to be treated as legacy apps. In general, the logical pattern that should be used when enforcing target SDK behaviors is below. For applying behavior to legacy apps: // BROKEN if (targetSdkVersion <= Build.VERSION_CODES.N_MR1) { // CORRECT if (targetSdkVersion < Build.VERSION_CODES.O) { For applying behavior to new apps: // BROKEN if (targetSdkVersion > Build.VERSION_CODES.N_MR1) { // CORRECT if (targetSdkVersion >= Build.VERSION_CODES.O) { Bug: 77865751 Test: builds, boots Change-Id: Ia83bd446a940751d51a6542c7a5b9cca174c5296
Loading
Please register or sign in to comment