WifiConfigManagerNew: Check UID belongs to foreground user

Add a utility method to check if the provided UID belongs to either the
current foreground user or if the SysUI. This is used to check the UID
of the app in all the methods invoked from public WifiManager API's.

This utility method is used to validate the following methods:
1. addOrUpdateNetwork
2. removeNetwork
3. enableNetwork
4. disableNetwork
5. checkAndUpdateLastConnectUid

While there,
a. Add the missing |uid| parameter in |removeNetwork| &
|removeNetworkInternal|. We need to check both if the the uid belongs to
the current user and that the uid has enough permission to delete the
network.
b. Setup the user profiles for the default user in the setup for each test.

BUG: 30891063
Change-Id: Ia03490c9dce7722b8d046a324004448e911257b6
TEST: Added a Unit test.
3 files changed
tree: d1da8b62c4a8997fe1e8f1db52fe505321fc4af3
  1. libwifi_hal/
  2. libwifi_system/
  3. service/
  4. tests/