diff options
author | Etan Cohen <etancohen@google.com> | 2017-07-25 14:57:39 -0700 |
---|---|---|
committer | Etan Cohen <etancohen@google.com> | 2017-07-26 16:31:31 -0700 |
commit | 32559d8738dfe5b8aa3c22a82303ef56e2e0241c (patch) | |
tree | aad8abadbabb13d763faddf7768f115a6ea96306 /tests | |
parent | 2dac1a3ddd414b17a8d95b6edaccbab64cc3800f (diff) |
[RTT] Add cleanup on app death
Add a binder death listener to register for app death and execute
cleanup code.
This is a replacement for the death listener added to the AsyncChannel
which caused a memory leak in apps.
Bug: 37443149
Test: verified using test app ResponderToolActivity
Change-Id: I90b28fcb2d7d61cf40807960c3bf56a262b595b9
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/RttServiceTest.java | 2 | ||||
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/aware/WifiAwareRttStateManagerTest.java | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/RttServiceTest.java b/tests/wifitests/src/com/android/server/wifi/RttServiceTest.java index 689ade80a..b2b40e226 100644 --- a/tests/wifitests/src/com/android/server/wifi/RttServiceTest.java +++ b/tests/wifitests/src/com/android/server/wifi/RttServiceTest.java @@ -100,7 +100,7 @@ public class RttServiceTest { // Create and connect a bi-directional async channel. private BidirectionalAsyncChannel connectChannel(Handler handler) { BidirectionalAsyncChannel channel = new BidirectionalAsyncChannel(); - channel.connect(mLooper.getLooper(), mRttServiceImpl.getMessenger(), + channel.connect(mLooper.getLooper(), mRttServiceImpl.getMessenger(null, new int[1]), handler); mLooper.dispatchAll(); channel.assertConnected(); diff --git a/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareRttStateManagerTest.java b/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareRttStateManagerTest.java index 616e68c0c..3df62f35d 100644 --- a/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareRttStateManagerTest.java +++ b/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareRttStateManagerTest.java @@ -74,7 +74,7 @@ public class WifiAwareRttStateManagerTest { mTestLooper = new TestLooper(); BidirectionalAsyncChannelServer server = new BidirectionalAsyncChannelServer( mMockContext, mTestLooper.getLooper(), mMockHandler); - when(mMockRttService.getMessenger()).thenReturn(server.getMessenger()); + when(mMockRttService.getMessenger(null, new int[1])).thenReturn(server.getMessenger()); mDut.startWithRttService(mMockContext, mTestLooper.getLooper(), mMockRttService); } |