Skip to content
Commit aa1a911d authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

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
parent 964631d1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment