Merge pull request #2066 from iBotPeaches/issue-2045

Support for SDK_Q shorthand
This commit is contained in:
Connor Tumbleson 2019-04-24 19:56:15 -04:00 committed by GitHub
commit 73ac0d96fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 0 deletions

View File

@ -633,6 +633,8 @@ final public class AndrolibResources {
return ResConfigFlags.SDK_OREO; return ResConfigFlags.SDK_OREO;
case "P": case "P":
return ResConfigFlags.SDK_P; return ResConfigFlags.SDK_P;
case "Q":
return ResConfigFlags.SDK_Q;
default: default:
return Integer.parseInt(sdkVersion); return Integer.parseInt(sdkVersion);
} }

View File

@ -538,6 +538,10 @@ public class ResConfigFlags {
public final static byte SDK_OREO_MR1 = 27; public final static byte SDK_OREO_MR1 = 27;
public final static byte SDK_P = 28; public final static byte SDK_P = 28;
// AOSP has this as 10,000 for dev purposes.
// platform_frameworks_base/commit/ad5b4ba2a2dda066dbefec4195b86747e3d7d225#diff-b2b93844110603a7b050476c83c1ee3a
public final static int SDK_Q = 10000;
public final static byte ORIENTATION_ANY = 0; public final static byte ORIENTATION_ANY = 0;
public final static byte ORIENTATION_PORT = 1; public final static byte ORIENTATION_PORT = 1;
public final static byte ORIENTATION_LAND = 2; public final static byte ORIENTATION_LAND = 2;

View File

@ -86,4 +86,15 @@ public class InvalidSdkBoundingTest extends BaseTest {
androlibResources.setSdkInfo(sdkInfo); androlibResources.setSdkInfo(sdkInfo);
assertEquals("26", androlibResources.checkTargetSdkVersionBounds()); assertEquals("26", androlibResources.checkTargetSdkVersionBounds());
} }
@Test
public void checkForSdkQInsaneTestValue() {
AndrolibResources androlibResources = new AndrolibResources();
Map<String, String> sdkInfo = new LinkedHashMap<>();
sdkInfo.put("targetSdkVersion", "Q");
androlibResources.setSdkInfo(sdkInfo);
assertEquals("10000", androlibResources.checkTargetSdkVersionBounds());
}
} }