From 574c8d439ae7bc49d6134eb0ce9139c59b148c34 Mon Sep 17 00:00:00 2001 From: Etan Cohen Date: Mon, 11 Nov 2019 10:13:30 -0800 Subject: [AWARE] Allow setPMK API Allowing configuration of the PMK is required for any PK-based protocols which operate OOB. Bug: 143956273 Test: atest android.net.wifi.aware Test: test com.android.server.wifi.aware Test: ACTS DataPathTest:test_ib_solicited_active_pmk_specific Test: CtsVerifier Change-Id: I7ed84d7f97b1889fbbda92f3bf5203e2f2540b54 --- .../aware/WifiAwareDataPathStateManagerTest.java | 40 ---------------------- 1 file changed, 40 deletions(-) (limited to 'tests') 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; } @@ -276,43 +273,6 @@ public class WifiAwareDataPathStateManagerTest extends WifiBaseTest { verifyNoMoreInteractions(mMockNative, mMockNwMgt); } - /** - * 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. */ -- cgit v1.2.3