Update Policy Listener API naming.
This CL changes the policy listener API to be
VcnNetworkPolicyChangeListener (it was previously
VcnNetworkPolicyListener) per API Council guidance.
This CL also requires permission NETWORK_FACTORY for removing registered
policy listeners.
Bug: 181562364
Test: atest FrameworksVcnTests
Change-Id: I026eaefa62d8f64b9180fc182a7cf0605d83bf97
Merged-In: I026eaefa62d8f64b9180fc182a7cf0605d83bf97
(cherry picked from commit a96ec13821)
This commit is contained in:
@@ -593,6 +593,16 @@ public class VcnManagementServiceTest {
|
||||
mVcnMgmtSvc.removeVcnUnderlyingNetworkPolicyListener(mMockPolicyListener);
|
||||
}
|
||||
|
||||
@Test(expected = SecurityException.class)
|
||||
public void testRemoveVcnUnderlyingNetworkPolicyListenerInvalidPermission() {
|
||||
doThrow(new SecurityException())
|
||||
.when(mMockContext)
|
||||
.enforceCallingOrSelfPermission(
|
||||
eq(android.Manifest.permission.NETWORK_FACTORY), any());
|
||||
|
||||
mVcnMgmtSvc.removeVcnUnderlyingNetworkPolicyListener(mMockPolicyListener);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRemoveVcnUnderlyingNetworkPolicyListenerNeverRegistered() {
|
||||
mVcnMgmtSvc.removeVcnUnderlyingNetworkPolicyListener(mMockPolicyListener);
|
||||
|
||||
Reference in New Issue
Block a user