Merge changes from topic "libbinder-bitness-header" into stage-aosp-master am: baa900adda

am: a879c6860a

Change-Id: Ia5fb1eb1aa622c23078b8311c4faf208e80569e3
This commit is contained in:
Steven Moreland
2019-07-31 14:04:15 -07:00
committed by android-build-merger

View File

@@ -43,8 +43,8 @@ public class ParcelTest {
// WorkSource can be updated.
p.writeInterfaceToken(INTERFACE_TOKEN_1);
assertEquals(true, p.replaceCallingWorkSourceUid(WORK_SOURCE_1));
assertEquals(WORK_SOURCE_1, p.readCallingWorkSourceUid());
assertEquals(true, p.replaceCallingWorkSourceUid(WORK_SOURCE_2));
assertEquals(WORK_SOURCE_2, p.readCallingWorkSourceUid());
// WorkSource can be updated to unset value.
assertEquals(true, p.replaceCallingWorkSourceUid(Binder.UNSET_WORKSOURCE));
@@ -56,18 +56,16 @@ public class ParcelTest {
@Test
public void testCallingWorkSourceUidAfterEnforce() {
Parcel p = Parcel.obtain();
// Write headers manually so that we do not invoke #writeInterfaceToken.
p.writeInt(1); // strict mode header
p.writeInt(WORK_SOURCE_1); // worksource header.
p.writeString(INTERFACE_TOKEN_1); // interface token.
p.writeInterfaceToken(INTERFACE_TOKEN_1);
assertEquals(true, p.replaceCallingWorkSourceUid(WORK_SOURCE_1));
p.setDataPosition(0);
p.enforceInterface(INTERFACE_TOKEN_1);
assertEquals(WORK_SOURCE_1, p.readCallingWorkSourceUid());
// WorkSource can be updated.
assertEquals(true, p.replaceCallingWorkSourceUid(WORK_SOURCE_1));
assertEquals(WORK_SOURCE_1, p.readCallingWorkSourceUid());
assertEquals(true, p.replaceCallingWorkSourceUid(WORK_SOURCE_2));
assertEquals(WORK_SOURCE_2, p.readCallingWorkSourceUid());
p.recycle();
}