cmsdk: Create api level 3, cantaloupe.

Change-Id: I5cefacf1196261b071ce2c3561f18ebaf74de604
This commit is contained in:
Adnan Begovic 2015-09-29 11:40:29 -07:00
parent 05d0129478
commit 38e8b11ea7
3 changed files with 12 additions and 5 deletions

View File

@ -235,7 +235,8 @@ LOCAL_DROIDDOC_OPTIONS := \
-hdf sdk.rel.id $(cmplat_docs_docs_SDK_REL_ID) \
-hdf sdk.preview 0 \
-since $(CM_SRC_API_DIR)/1.txt 1 \
-since $(CM_SRC_API_DIR)/2.txt 2
-since $(CM_SRC_API_DIR)/2.txt 2 \
-since $(CM_SRC_API_DIR)/3.txt 3
$(full_target): $(cm_framework_built) $(gen)
include $(BUILD_DROIDDOC)

View File

@ -36,7 +36,7 @@ public class Build {
* {@link CM_VERSION_CODES}
* @hide
*/
public static final int PARCELABLE_VERSION = CM_VERSION_CODES.BOYSENBERRY;
public static final int PARCELABLE_VERSION = CM_VERSION_CODES.CANTALOUPE;
private static final SparseArray<String> sdkMap;
static
@ -44,6 +44,7 @@ public class Build {
sdkMap = new SparseArray<String>();
sdkMap.put(CM_VERSION_CODES.APRICOT, "Apricot");
sdkMap.put(CM_VERSION_CODES.BOYSENBERRY, "Boysenberry");
sdkMap.put(CM_VERSION_CODES.CANTALOUPE, "Cantaloupe");
}
/** Various version strings. */
@ -105,6 +106,11 @@ public class Build {
* </ul>
*/
public static final int BOYSENBERRY = 2;
/**
* TODO: Pending Q1 release
*/
public static final int CANTALOUPE = 3;
}
/**

View File

@ -38,20 +38,20 @@ public class BuildTest extends AndroidTestCase {
@SmallTest
public void testSdkApiLevelCurrent() {
assertEquals(Build.CM_VERSION_CODES.BOYSENBERRY, Build.CM_VERSION.SDK_INT);
assertEquals(Build.CM_VERSION_CODES.CANTALOUPE, Build.CM_VERSION.SDK_INT);
}
@SmallTest
public void testSdkApiLevelCanMatch() {
String apiName = Build.getNameForSDKInt(Build.CM_VERSION.SDK_INT);
assertNotNull(apiName);
assertEquals(Build.getNameForSDKInt(Build.CM_VERSION_CODES.BOYSENBERRY), apiName);
assertEquals(Build.getNameForSDKInt(Build.CM_VERSION_CODES.CANTALOUPE), apiName);
}
@SmallTest
public void testSdkApiLevelSkippedIfGreaterThanAllowed() {
int i = 0;
if (Build.CM_VERSION.SDK_INT > Build.CM_VERSION_CODES.BOYSENBERRY + 1) {
if (Build.CM_VERSION.SDK_INT > Build.CM_VERSION_CODES.CANTALOUPE + 1) {
i++;
}
assertEquals(0, i);