Merge "Address comments and final cleanup from refcounting integration" am: 3dcee3120b
am: 9b1dfec3de
Change-Id: I7ed4a6bb90f3cf3ed5fd0e6ad20b033e588a4c90
This commit is contained in:
@@ -166,6 +166,7 @@ public class IpSecServiceTest {
|
|||||||
mIpSecService.closeUdpEncapsulationSocket(udpEncapResp.resourceId);
|
mIpSecService.closeUdpEncapsulationSocket(udpEncapResp.resourceId);
|
||||||
udpEncapResp.fileDescriptor.close();
|
udpEncapResp.fileDescriptor.close();
|
||||||
|
|
||||||
|
// Verify quota and RefcountedResource objects cleaned up
|
||||||
IpSecService.UserRecord userRecord =
|
IpSecService.UserRecord userRecord =
|
||||||
mIpSecService.mUserResourceTracker.getUserRecord(Os.getuid());
|
mIpSecService.mUserResourceTracker.getUserRecord(Os.getuid());
|
||||||
assertEquals(0, userRecord.mSocketQuotaTracker.mCurrent);
|
assertEquals(0, userRecord.mSocketQuotaTracker.mCurrent);
|
||||||
@@ -179,10 +180,8 @@ public class IpSecServiceTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUdpEncapsulationSocketBinderDeath() throws Exception {
|
public void testUdpEncapsulationSocketBinderDeath() throws Exception {
|
||||||
int localport = findUnusedPort();
|
|
||||||
|
|
||||||
IpSecUdpEncapResponse udpEncapResp =
|
IpSecUdpEncapResponse udpEncapResp =
|
||||||
mIpSecService.openUdpEncapsulationSocket(localport, new Binder());
|
mIpSecService.openUdpEncapsulationSocket(0, new Binder());
|
||||||
|
|
||||||
IpSecService.UserRecord userRecord =
|
IpSecService.UserRecord userRecord =
|
||||||
mIpSecService.mUserResourceTracker.getUserRecord(Os.getuid());
|
mIpSecService.mUserResourceTracker.getUserRecord(Os.getuid());
|
||||||
@@ -192,6 +191,7 @@ public class IpSecServiceTest {
|
|||||||
|
|
||||||
refcountedRecord.binderDied();
|
refcountedRecord.binderDied();
|
||||||
|
|
||||||
|
// Verify quota and RefcountedResource objects cleaned up
|
||||||
assertEquals(0, userRecord.mSocketQuotaTracker.mCurrent);
|
assertEquals(0, userRecord.mSocketQuotaTracker.mCurrent);
|
||||||
try {
|
try {
|
||||||
userRecord.mEncapSocketRecords.getRefcountedResourceOrThrow(udpEncapResp.resourceId);
|
userRecord.mEncapSocketRecords.getRefcountedResourceOrThrow(udpEncapResp.resourceId);
|
||||||
|
|||||||
Reference in New Issue
Block a user