From eafcdbd2298caba7ae7c6c4d10f0e2e445245216 Mon Sep 17 00:00:00 2001 From: Adnan Begovic Date: Tue, 29 Mar 2016 11:41:22 -0700 Subject: cmsdk: Create Concierge parcel handler concept. Simply, Concierge handles your parcels and makes sure they get marshalled and unmarshalled correctly when cross IPC boundaries even when there is a version mismatch between the client sdk level and the framework implementation. On incoming parcel (to be unmarshalled): ParcelInfo incomingParcelInfo = Concierge.receiveParcel(incomingParcel); int parcelableVersion = incomingParcelInfo.getParcelVersion(); // Do unmarshalling steps here iterating over every plausible version // Complete the process incomingParcelInfo.complete(); On outgoing parcel (to be marshalled): ParcelInfo outgoingParcelInfo = Concierge.prepareParcel(incomingParcel); // Do marshalling steps here iterating over every plausible version // Complete the process outgoingParcelInfo.complete(); Change-Id: I0096851e08ce25908e19e39e6bc4af344e85725e --- tests/src/org/cyanogenmod/tests/versioning/unit/BuildTest.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/src/org/cyanogenmod/tests/versioning/unit/BuildTest.java b/tests/src/org/cyanogenmod/tests/versioning/unit/BuildTest.java index 3e0be19..1922e95 100644 --- a/tests/src/org/cyanogenmod/tests/versioning/unit/BuildTest.java +++ b/tests/src/org/cyanogenmod/tests/versioning/unit/BuildTest.java @@ -20,6 +20,7 @@ import android.test.suitebuilder.annotation.SmallTest; import cyanogenmod.os.Build; import android.test.AndroidTestCase; +import cyanogenmod.os.Concierge; /** * Created by adnan on 7/14/15. @@ -38,20 +39,20 @@ public class BuildTest extends AndroidTestCase { @SmallTest public void testSdkApiLevelCurrent() { - assertEquals(Build.PARCELABLE_VERSION, Build.CM_VERSION.SDK_INT); + assertEquals(Concierge.PARCELABLE_VERSION, Build.CM_VERSION.SDK_INT); } @SmallTest public void testSdkApiLevelCanMatch() { String apiName = Build.getNameForSDKInt(Build.CM_VERSION.SDK_INT); assertNotNull(apiName); - assertEquals(Build.getNameForSDKInt(Build.PARCELABLE_VERSION), apiName); + assertEquals(Build.getNameForSDKInt(Concierge.PARCELABLE_VERSION), apiName); } @SmallTest public void testSdkApiLevelSkippedIfGreaterThanAllowed() { int i = 0; - if (Build.CM_VERSION.SDK_INT > Build.PARCELABLE_VERSION + 1) { + if (Build.CM_VERSION.SDK_INT > Concierge.PARCELABLE_VERSION + 1) { i++; } assertEquals(0, i); -- cgit v1.1