Merge "Address comments and final cleanup from refcounting integration"

am: 3dcee3120b

Change-Id: Ie0bc2b81e09ee874ef848905bb486967a857c6d1
This commit is contained in:
Benedict Wong 2018-01-22 23:57:28 +00:00 • committed by android-build-merger
commit 9b1dfec3de

View file

@ -166,6 +166,7 @@ public class IpSecServiceTest {
mIpSecService.closeUdpEncapsulationSocket(udpEncapResp.resourceId);
udpEncapResp.fileDescriptor.close();
// Verify quota and RefcountedResource objects cleaned up
IpSecService.UserRecord userRecord =
mIpSecService.mUserResourceTracker.getUserRecord(Os.getuid());
assertEquals(0, userRecord.mSocketQuotaTracker.mCurrent);
@ -179,10 +180,8 @@ public class IpSecServiceTest {
@Test
public void testUdpEncapsulationSocketBinderDeath() throws Exception {
int localport = findUnusedPort();
IpSecUdpEncapResponse udpEncapResp =
mIpSecService.openUdpEncapsulationSocket(localport, new Binder());
mIpSecService.openUdpEncapsulationSocket(0, new Binder());
IpSecService.UserRecord userRecord =
mIpSecService.mUserResourceTracker.getUserRecord(Os.getuid());
@ -192,6 +191,7 @@ public class IpSecServiceTest {
refcountedRecord.binderDied();
// Verify quota and RefcountedResource objects cleaned up
assertEquals(0, userRecord.mSocketQuotaTracker.mCurrent);
try {
userRecord.mEncapSocketRecords.getRefcountedResourceOrThrow(udpEncapResp.resourceId);