Add COMPANION_APPROVE_WIFI_CONNECTIONS to shell permissions
1. This is a minimally scoped permission (which allows the new WiFi API's
to silently connect to a wifi network).
2. I explored writing a GTS test instead of a CTS test, with the idea being that it would run inside the Android Auto user. Unfortunately the API under test requires two permissions, MANAGE_COMPANION_DEVICES and COMPANION_APPROVE_WIFI_CONNECTIONS. Android Auto will only have COMPANION_APPROVE_WIFI_CONNECTIONS, and if I elevate to Shell privileges the test will have MANAGE_COMPANION_DEVICES, but not COMPANION_APPROVE_WIFI_CONNECTIONS. Beyond this, I've been told that it's better for us to test this API in CTS than what it is under GTS.
The addition of the permission to androis.os.shell could theoretically allow it to connect to a WiFi network using the new WiFi APIs without the user being prompted. Android R will still allow the legacy WiFi API's which also allow wifi connections without users being prompted without this permission. Android Auto requires the new API's as they better handle cases of connecting to WiFi networks with no internet access. The old API's will not always result in fallback to LTE, whereas the new ones do that.
Test: Unit test in separate change.
Change-Id: Ifd8ae6b7e53307ea8973406fdefa468dfa679bda
Bug: b/147748710
diff --git a/packages/Shell/AndroidManifest.xml b/packages/Shell/AndroidManifest.xml
index 99f8c7d..56d5de4 100644
--- a/packages/Shell/AndroidManifest.xml
+++ b/packages/Shell/AndroidManifest.xml
@@ -192,7 +192,10 @@
<uses-permission android:name="android.permission.READ_CLIPBOARD_IN_BACKGROUND" />
<!-- Permission needed to wipe the device for Test Harness Mode -->
<uses-permission android:name="android.permission.ENABLE_TEST_HARNESS_MODE" />
+
+ <!-- Permissions required to test CompanionDeviceManager teses in CTS -->
<uses-permission android:name="android.permission.MANAGE_COMPANION_DEVICES" />
+ <uses-permission android:name="android.permission.COMPANION_APPROVE_WIFI_CONNECTIONS" />
<uses-permission android:name="android.permission.MANAGE_APPOPS" />