API: Clean up redundant and ineffective usages of SystemApi and TestApi

Everything that is marked SystemApi or TestApi, but not @hide is still
part of the public SDK, it is therefore not sound to have that combination.

In the future, specifing such a combination will be considered an error
to prevent inadvertently exposing SystemApi and TestApi as public API.

Bug: 115333477
Change-Id: Ibd5d6a22862fdbc1e20a1cb3925280f5a682edea
Test: METALAVA_PREPEND_ARGS="--error UnhiddenSystemApi" m checkapi
Exempt-From-Owner-Approval: API cleanup
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 1dd42b8..27dad51 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -1368,7 +1368,7 @@
     <!-- ================================== -->
     <eat-comment />
 
-    <!-- @SystemApi Allows an application (Phone) to send a request to other applications
+    <!-- Allows an application (Phone) to send a request to other applications
          to handle the respond-via-message action during incoming calls.
          <p>Not for use by third-party applications. -->
     <permission android:name="android.permission.SEND_RESPOND_VIA_MESSAGE"
@@ -1452,7 +1452,7 @@
         android:description="@string/permdesc_accessLocationExtraCommands"
         android:protectionLevel="normal" />
 
-    <!-- @SystemApi Allows an application to install a location provider into the Location Manager.
+    <!-- Allows an application to install a location provider into the Location Manager.
     <p>Not for use by third-party applications. -->
     <permission android:name="android.permission.INSTALL_LOCATION_PROVIDER"
         android:protectionLevel="signature|privileged" />
@@ -1463,7 +1463,7 @@
     <permission android:name="android.permission.HDMI_CEC"
         android:protectionLevel="signature|privileged|vendorPrivileged" />
 
-    <!-- @SystemApi Allows an application to use location features in hardware,
+    <!-- Allows an application to use location features in hardware,
          such as the geofencing api.
          <p>Not for use by third-party applications. -->
     <permission android:name="android.permission.LOCATION_HARDWARE"
@@ -1658,7 +1658,7 @@
         android:label="@string/permlab_bluetoothAdmin"
         android:protectionLevel="normal" />
 
-    <!-- @SystemApi Allows applications to pair bluetooth devices without user interaction, and to
+    <!-- Allows applications to pair bluetooth devices without user interaction, and to
          allow or disallow phonebook access or message access.
          This is not available to third party applications. -->
     <permission android:name="android.permission.BLUETOOTH_PRIVILEGED"
@@ -1749,7 +1749,7 @@
         android:usageInfoRequired="true" />
     <uses-permission android:name="android.permission.GET_ACCOUNTS"/>
 
-    <!-- @SystemApi Allows applications to call into AccountAuthenticators.
+    <!-- Allows applications to call into AccountAuthenticators.
     <p>Not for use by third-party applications. -->
     <permission android:name="android.permission.ACCOUNT_MANAGER"
         android:protectionLevel="signature" />
@@ -1928,7 +1928,7 @@
     <!-- =========================================== -->
     <eat-comment />
 
-    <!-- @SystemApi Allows modification of the telephony state - power on, mmi, etc.
+    <!-- Allows modification of the telephony state - power on, mmi, etc.
          Does not include placing calls.
          <p>Not for use by third-party applications. -->
     <permission android:name="android.permission.MODIFY_PHONE_STATE"
@@ -2365,7 +2365,7 @@
     <!-- ============================================ -->
     <eat-comment />
 
-    <!-- @SystemApi Allows applications to set the system time.
+    <!-- Allows applications to set the system time.
     <p>Not for use by third-party applications. -->
     <permission android:name="android.permission.SET_TIME"
         android:protectionLevel="signature|privileged" />
@@ -2455,7 +2455,7 @@
     <permission android:name="android.permission.SET_SCREEN_COMPATIBILITY"
         android:protectionLevel="signature" />
 
-    <!-- @SystemApi @TestApi Allows an application to modify the current configuration, such
+    <!-- Allows an application to modify the current configuration, such
          as locale. -->
     <permission android:name="android.permission.CHANGE_CONFIGURATION"
         android:protectionLevel="signature|privileged|development" />
@@ -2477,7 +2477,7 @@
         android:description="@string/permdesc_writeSettings"
         android:protectionLevel="signature|preinstalled|appop|pre23" />
 
-    <!-- @SystemApi Allows an application to modify the Google service map.
+    <!-- Allows an application to modify the Google service map.
     <p>Not for use by third-party applications. -->
     <permission android:name="android.permission.WRITE_GSERVICES"
         android:protectionLevel="signature|privileged" />
@@ -2493,7 +2493,7 @@
     <permission android:name="android.permission.RETRIEVE_WINDOW_CONTENT"
         android:protectionLevel="signature|privileged" />
 
-    <!-- @SystemApi Modify the global animation scaling factor.
+    <!-- Modify the global animation scaling factor.
     <p>Not for use by third-party applications. -->
     <permission android:name="android.permission.SET_ANIMATION_SCALE"
         android:protectionLevel="signature|privileged|development" />
@@ -2548,12 +2548,12 @@
         android:description="@string/permdesc_broadcastSticky"
         android:protectionLevel="normal" />
 
-    <!-- @SystemApi Allows mounting and unmounting file systems for removable storage.
+    <!-- Allows mounting and unmounting file systems for removable storage.
     <p>Not for use by third-party applications.-->
     <permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"
         android:protectionLevel="signature|privileged" />
 
-    <!-- @SystemApi Allows formatting file systems for removable storage.
+    <!-- Allows formatting file systems for removable storage.
     <p>Not for use by third-party applications. -->
     <permission android:name="android.permission.MOUNT_FORMAT_FILESYSTEMS"
         android:protectionLevel="signature|privileged" />
@@ -2587,7 +2587,7 @@
     <permission android:name="android.permission.ASEC_RENAME"
         android:protectionLevel="signature" />
 
-    <!-- @SystemApi Allows applications to write the apn settings and read sensitive fields of
+    <!-- Allows applications to write the apn settings and read sensitive fields of
          an existing apn settings like user and password.
     <p>Not for use by third-party applications. -->
     <permission android:name="android.permission.WRITE_APN_SETTINGS"
@@ -2688,40 +2688,40 @@
     <!-- ========================================= -->
     <eat-comment />
 
-    <!-- @SystemApi Allows an application to read or write the secure system settings.
+    <!-- Allows an application to read or write the secure system settings.
     <p>Not for use by third-party applications. -->
     <permission android:name="android.permission.WRITE_SECURE_SETTINGS"
         android:protectionLevel="signature|privileged|development" />
 
-    <!-- @SystemApi Allows an application to retrieve state dump information from system services.
+    <!-- Allows an application to retrieve state dump information from system services.
     <p>Not for use by third-party applications. -->
     <permission android:name="android.permission.DUMP"
         android:protectionLevel="signature|privileged|development" />
 
-    <!-- @SystemApi Allows an application to read the low-level system log files.
+    <!-- Allows an application to read the low-level system log files.
     <p>Not for use by third-party applications, because
     Log entries can contain the user's private information. -->
     <permission android:name="android.permission.READ_LOGS"
         android:protectionLevel="signature|privileged|development" />
 
-    <!-- @SystemApi Configure an application for debugging.
+    <!-- Configure an application for debugging.
     <p>Not for use by third-party applications. -->
     <permission android:name="android.permission.SET_DEBUG_APP"
         android:protectionLevel="signature|privileged|development" />
 
-    <!-- @SystemApi Allows an application to set the maximum number of (not needed)
+    <!-- Allows an application to set the maximum number of (not needed)
          application processes that can be running.
          <p>Not for use by third-party applications. -->
     <permission android:name="android.permission.SET_PROCESS_LIMIT"
         android:protectionLevel="signature|privileged|development" />
 
-    <!-- @SystemApi Allows an application to control whether activities are immediately
+    <!-- Allows an application to control whether activities are immediately
          finished when put in the background.
          <p>Not for use by third-party applications. -->
     <permission android:name="android.permission.SET_ALWAYS_FINISH"
         android:protectionLevel="signature|privileged|development" />
 
-    <!-- @SystemApi Allow an application to request that a signal be sent to all persistent processes.
+    <!-- Allow an application to request that a signal be sent to all persistent processes.
     <p>Not for use by third-party applications. -->
     <permission android:name="android.permission.SIGNAL_PERSISTENT_PROCESSES"
         android:protectionLevel="signature|privileged|development" />
@@ -2731,7 +2731,7 @@
     <!-- ==================================== -->
     <eat-comment />
 
-    <!-- @SystemApi Allows access to the list of accounts in the Accounts Service. -->
+    <!-- Allows access to the list of accounts in the Accounts Service. -->
     <permission android:name="android.permission.GET_ACCOUNTS_PRIVILEGED"
         android:protectionLevel="signature|privileged" />
 
@@ -2740,12 +2740,12 @@
     <permission android:name="android.permission.GET_PASSWORD"
         android:protectionLevel="signature" />
 
-    <!-- @SystemApi Allows applications to RW to diagnostic resources.
+    <!-- Allows applications to RW to diagnostic resources.
     <p>Not for use by third-party applications. -->
     <permission android:name="android.permission.DIAGNOSTIC"
         android:protectionLevel="signature" />
 
-    <!-- @SystemApi Allows an application to open, close, or disable the status bar
+    <!-- Allows an application to open, close, or disable the status bar
          and its icons.
          <p>Not for use by third-party applications. -->
     <permission android:name="android.permission.STATUS_BAR"
@@ -2770,7 +2770,7 @@
     <permission android:name="android.permission.FORCE_BACK"
         android:protectionLevel="signature" />
 
-    <!-- @SystemApi Allows an application to update device statistics.
+    <!-- Allows an application to update device statistics.
     <p>Not for use by third-party applications. -->
     <permission android:name="android.permission.UPDATE_DEVICE_STATS"
         android:protectionLevel="signature|privileged" />
@@ -3217,7 +3217,7 @@
         android:description="@string/permdesc_requestDeletePackages"
         android:protectionLevel="normal" />
 
-    <!-- @SystemApi Allows an application to install packages.
+    <!-- Allows an application to install packages.
     <p>Not for use by third-party applications. -->
     <permission android:name="android.permission.INSTALL_PACKAGES"
       android:protectionLevel="signature|privileged" />
@@ -3290,7 +3290,7 @@
     <permission android:name="android.permission.FORCE_PERSISTABLE_URI_PERMISSIONS"
         android:protectionLevel="signature" />
 
-    <!-- @SystemApi Old permission for deleting an app's cache files, no longer used,
+    <!-- Old permission for deleting an app's cache files, no longer used,
          but signals for us to quietly ignore calls instead of throwing an exception. -->
     <permission android:name="android.permission.DELETE_CACHE_FILES"
         android:protectionLevel="signature|privileged" />
@@ -3300,7 +3300,7 @@
     <permission android:name="android.permission.INTERNAL_DELETE_CACHE_FILES"
         android:protectionLevel="signature" />
 
-    <!-- @SystemApi Allows an application to delete packages.
+    <!-- Allows an application to delete packages.
          <p>Not for use by third-party applications.
          <p>Starting in {@link android.os.Build.VERSION_CODES#N}, user confirmation is requested
          when the application deleting the package is not the same application that installed the
@@ -3313,7 +3313,7 @@
     <permission android:name="android.permission.MOVE_PACKAGE"
         android:protectionLevel="signature|privileged" />
 
-    <!-- @SystemApi Allows an application to change whether an application component (other than its own) is
+    <!-- Allows an application to change whether an application component (other than its own) is
          enabled or not.
          <p>Not for use by third-party applications. -->
     <permission android:name="android.permission.CHANGE_COMPONENT_ENABLED_STATE"
@@ -3436,7 +3436,7 @@
         android:protectionLevel="signature|privileged" />
     <uses-permission android:name="android.permission.CONTROL_VPN" />
 
-    <!-- @SystemApi Allows an application to capture audio output.
+    <!-- Allows an application to capture audio output.
          <p>Not for use by third-party applications.</p> -->
     <permission android:name="android.permission.CAPTURE_AUDIO_OUTPUT"
         android:protectionLevel="signature|privileged" />
@@ -3474,7 +3474,7 @@
     <permission android:name="android.permission.CAPTURE_SECURE_VIDEO_OUTPUT"
         android:protectionLevel="signature|privileged" />
 
-    <!-- @SystemApi Allows an application to know what content is playing and control its playback.
+    <!-- Allows an application to know what content is playing and control its playback.
          <p>Not for use by third-party applications due to privacy of media consumption</p>  -->
     <permission android:name="android.permission.MEDIA_CONTENT_CONTROL"
         android:protectionLevel="signature|privileged" />
@@ -3501,7 +3501,7 @@
     <permission android:name="android.permission.BRICK"
         android:protectionLevel="signature" />
 
-    <!-- @SystemApi Required to be able to reboot the device.
+    <!-- Required to be able to reboot the device.
     <p>Not for use by third-party applications. -->
     <permission android:name="android.permission.REBOOT"
         android:protectionLevel="signature|privileged" />
@@ -3562,11 +3562,11 @@
     <permission android:name="android.permission.BROADCAST_NETWORK_PRIVILEGED"
         android:protectionLevel="signature|privileged" />
 
-    <!-- @SystemApi Not for use by third-party applications. -->
+    <!-- Not for use by third-party applications. -->
     <permission android:name="android.permission.MASTER_CLEAR"
         android:protectionLevel="signature|privileged" />
 
-    <!-- @SystemApi Allows an application to call any phone number, including emergency
+    <!-- Allows an application to call any phone number, including emergency
          numbers, without going through the Dialer user interface for the user
          to confirm the call being placed.
          <p>Not for use by third-party applications. -->
@@ -3581,19 +3581,19 @@
     <permission android:name="android.permission.PERFORM_SIM_ACTIVATION"
         android:protectionLevel="signature|privileged" />
 
-    <!-- @SystemApi Allows enabling/disabling location update notifications from
+    <!-- Allows enabling/disabling location update notifications from
          the radio.
          <p>Not for use by third-party applications. -->
     <permission android:name="android.permission.CONTROL_LOCATION_UPDATES"
         android:protectionLevel="signature|privileged" />
 
-    <!-- @SystemApi Allows read/write access to the "properties" table in the checkin
+    <!-- Allows read/write access to the "properties" table in the checkin
          database, to change values that get uploaded.
          <p>Not for use by third-party applications. -->
     <permission android:name="android.permission.ACCESS_CHECKIN_PROPERTIES"
         android:protectionLevel="signature|privileged" />
 
-    <!-- @SystemApi Allows an application to collect component usage
+    <!-- Allows an application to collect component usage
          statistics
          <p>Declaring the permission implies intention to use the API and the user of the
          device can grant permission through the Settings application. -->
@@ -3626,7 +3626,7 @@
         android:description="@string/permdesc_requestIgnoreBatteryOptimizations"
         android:protectionLevel="normal" />
 
-    <!-- @SystemApi Allows an application to collect battery statistics -->
+    <!-- Allows an application to collect battery statistics -->
     <permission android:name="android.permission.BATTERY_STATS"
         android:protectionLevel="signature|privileged|development" />
 
@@ -3655,12 +3655,12 @@
     <permission android:name="android.permission.CONFIRM_FULL_BACKUP"
         android:protectionLevel="signature" />
 
-    <!-- @SystemApi Must be required by a {@link android.widget.RemoteViewsService},
+    <!-- Must be required by a {@link android.widget.RemoteViewsService},
          to ensure that only the system can bind to it. -->
     <permission android:name="android.permission.BIND_REMOTEVIEWS"
         android:protectionLevel="signature|privileged" />
 
-    <!-- @SystemApi Allows an application to tell the AppWidget service which application
+    <!-- Allows an application to tell the AppWidget service which application
          can access AppWidget's data.  The normal user flow is that a user
          picks an AppWidget to go into a particular host, thereby giving that
          host application access to the private data from the AppWidget app.
@@ -3691,7 +3691,7 @@
     <permission android:name="android.permission.CHANGE_BACKGROUND_DATA_SETTING"
         android:protectionLevel="signature" />
 
-    <!-- @SystemApi This permission can be used on content providers to allow the global
+    <!-- This permission can be used on content providers to allow the global
          search system to access their data.  Typically it used when the
          provider has some permissions protecting it (which global search
          would not be expected to hold), and added as a read-only permission