Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8dbbd4ee authored by Steven Moreland's avatar Steven Moreland Committed by android-build-merger
Browse files

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

Merge changes from topic "libbinder-bitness-header" into stage-aosp-master am: baa900ad am: a879c686 am: 7976aee6
am: 5e5a52d1

Change-Id: Ie1cd3e70bf92d34848cddcb40d5e6b3711f7e5ad
parents a312cc53 5e5a52d1
Loading
Loading
Loading
Loading
+6 −8
Original line number Original line Diff line number Diff line
@@ -43,8 +43,8 @@ public class ParcelTest {


        // WorkSource can be updated.
        // WorkSource can be updated.
        p.writeInterfaceToken(INTERFACE_TOKEN_1);
        p.writeInterfaceToken(INTERFACE_TOKEN_1);
        assertEquals(true, p.replaceCallingWorkSourceUid(WORK_SOURCE_1));
        assertEquals(true, p.replaceCallingWorkSourceUid(WORK_SOURCE_2));
        assertEquals(WORK_SOURCE_1, p.readCallingWorkSourceUid());
        assertEquals(WORK_SOURCE_2, p.readCallingWorkSourceUid());


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


        p.enforceInterface(INTERFACE_TOKEN_1);
        p.enforceInterface(INTERFACE_TOKEN_1);
        assertEquals(WORK_SOURCE_1, p.readCallingWorkSourceUid());
        assertEquals(WORK_SOURCE_1, p.readCallingWorkSourceUid());


        // WorkSource can be updated.
        // WorkSource can be updated.
        assertEquals(true, p.replaceCallingWorkSourceUid(WORK_SOURCE_1));
        assertEquals(true, p.replaceCallingWorkSourceUid(WORK_SOURCE_2));
        assertEquals(WORK_SOURCE_1, p.readCallingWorkSourceUid());
        assertEquals(WORK_SOURCE_2, p.readCallingWorkSourceUid());


        p.recycle();
        p.recycle();
    }
    }