Enforce ACCESS_NETWORK_STATE to getAvailableInterfaces()

getAvailableInterfaces() will return available ethernet
interfaces which are the information about networks. So it should
enforce ACCESS_NETWORK_STATE permission check to ensure the
applications are allowed to access the information.

Bug: 174573778
Test: TetheringTests
Test: CtsTetheringTest
Change-Id: I7aaa5225d56f2feecc51ba263489ed0ce02fd651
This commit is contained in:
paulhu
2021-03-30 10:55:37 +08:00
committed by Paul Hu
parent 40246d7fb4
commit 3056b7418b

View File

@@ -87,6 +87,8 @@ public class EthernetServiceImpl extends IEthernetManager.Stub {
@Override @Override
public String[] getAvailableInterfaces() throws RemoteException { public String[] getAvailableInterfaces() throws RemoteException {
enforceAccessPermission();
return mTracker.getInterfaces(checkUseRestrictedNetworksPermission()); return mTracker.getInterfaces(checkUseRestrictedNetworksPermission());
} }