diff options
author | Etan Cohen <etancohen@google.com> | 2019-11-15 01:12:36 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-11-15 01:12:36 +0000 |
commit | 7a15de6f7b85ed4b48bbdac1210cd641ea4541b7 (patch) | |
tree | d000503a6bcc75f02f5f2969c9a1f3d249f60b0c /tests | |
parent | ffd6b66f5614e93fcf4e48fbffd8544871f0c0ed (diff) | |
parent | 574c8d439ae7bc49d6134eb0ce9139c59b148c34 (diff) |
Merge "[AWARE] Allow setPMK API"
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/aware/WifiAwareDataPathStateManagerTest.java | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareDataPathStateManagerTest.java b/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareDataPathStateManagerTest.java index a488baf2a..29e782d16 100644 --- a/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareDataPathStateManagerTest.java +++ b/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareDataPathStateManagerTest.java @@ -181,9 +181,6 @@ public class WifiAwareDataPathStateManagerTest extends WifiBaseTest { when(mMockPowerManager.isDeviceIdleMode()).thenReturn(false); when(mMockPowerManager.isInteractive()).thenReturn(true); - when(mPermissionsWrapperMock.getUidPermission(eq(Manifest.permission.CONNECTIVITY_INTERNAL), - anyInt())).thenReturn(PackageManager.PERMISSION_GRANTED); - mDut.mDataPathMgr.mNwService = mMockNwMgt; mDut.mDataPathMgr.mNiWrapper = mMockNetworkInterface; } @@ -277,43 +274,6 @@ public class WifiAwareDataPathStateManagerTest extends WifiBaseTest { } /** - * Validate that trying to specify a PMK without permission results in failure. - */ - @Test - public void testDataPathPmkWithoutPermission() throws Exception { - final int clientId = 123; - final byte pubSubId = 55; - final byte[] pmk = "01234567890123456789012345678901".getBytes(); - final int requestorId = 1341234; - final byte[] peerDiscoveryMac = HexEncoding.decode("000102030405".toCharArray(), false); - - InOrder inOrder = inOrder(mMockNative, mMockCm, mMockCallback, mMockSessionCallback); - InOrder inOrderM = inOrder(mAwareMetricsMock); - - when(mPermissionsWrapperMock.getUidPermission(eq(Manifest.permission.CONNECTIVITY_INTERNAL), - anyInt())).thenReturn(PackageManager.PERMISSION_DENIED); - - // (0) initialize - DataPathEndPointInfo res = initDataPathEndPoint(true, clientId, pubSubId, requestorId, - peerDiscoveryMac, inOrder, inOrderM, false); - - // (1) request network - NetworkRequest nr = getSessionNetworkRequest(clientId, res.mSessionId, res.mPeerHandle, pmk, - null, false, 0); - - Message reqNetworkMsg = Message.obtain(); - reqNetworkMsg.what = NetworkFactory.CMD_REQUEST_NETWORK; - reqNetworkMsg.obj = nr; - reqNetworkMsg.arg1 = 0; - res.mMessenger.send(reqNetworkMsg); - mMockLooper.dispatchAll(); - - // failure: no interactions with native manager - verifyUnfullfillableDispatched(res.mReverseMessenger); - verifyNoMoreInteractions(mMockNative, mMockCm, mAwareMetricsMock, mMockNwMgt); - } - - /** * Validate that trying to specify port info on subscriber results in failure. */ @Test |