WifiNetworkSuggestion/WifiNetworkSpecifier: Pass package name
Use the package name from WifiNetworkSpecifier/WifiNetworkSuggestion
instead of using PackageManager.getNameForUid() which cannot
differentiate apps sharing UID.
Functional changes (only in WifiNetworkFactory):
a) Verify the uid/package name passed in the request using app-ops
manager.
b) Use the package name in the request everywhere instead of
getNameForUid.
WifiNetworkSuggestionsManager already uses the package name of the app
passed in via addNetworkSuggestionsManager. So, no changes necessary
there.
Rest of the changes are mostly in unit tests to add the new packageName
param in the constructor of these objects.
Bug: 123078593
Test: ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Test: act.py -c wifi_manager.config -tb dut-name -tc WifiNetworkRequestTest
Test: act.py -c wifi_manager.config -tb dut-name -tc
WifiNetworkSuggestionTest
Test: New CtsVerifier tests for network request.
Change-Id: Id7c9a954606f97dbba935cb259dd488ac19d7c62
10 files changed