Add @SystemApi annotation to internal permissions.

This is a first pass at annotating permissions that should not be
granted or used by to third-party apps but that may be required by
privileged system applications.  For this patch, the annotation was
only added to permissions that have a protection level of at least
system.  Signature-only permissions were left alone since they only
need to be visible to built-in components.

Change-Id: I189472028274c133793ad8e4068585c536dd7f38
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index e4cbf5f..9e5068f 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -301,7 +301,7 @@
         android:label="@string/permlab_sendSms"
         android:description="@string/permdesc_sendSms" />
 
-    <!-- Allows an application (Phone) to send a request to other applications
+    <!-- @SystemApi 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"
@@ -326,7 +326,7 @@
         android:label="@string/permlab_receiveMms"
         android:description="@string/permdesc_receiveMms" />
 
-    <!-- Allows an application to receive emergency cell broadcast messages,
+    <!-- @SystemApi Allows an application to receive emergency cell broadcast messages,
          to record or display them to the user.
          <p>Not for use by third-party applications.
          @hide Pending API council approval -->
@@ -406,10 +406,9 @@
         android:label="@string/permlab_writeContacts"
         android:description="@string/permdesc_writeContacts" />
 
-    <!-- Allows an application to execute contacts directory search.
+    <!-- @SystemApi @hide Allows an application to execute contacts directory search.
          This should only be used by ContactsProvider.
          <p>Not for use by third-party applications. -->
-    <!-- @hide -->
     <permission android:name="android.permission.BIND_DIRECTORY_SEARCH"
         android:permissionGroup="android.permission-group.PERSONAL_INFO"
         android:protectionLevel="signature|system" />
@@ -694,20 +693,20 @@
         android:label="@string/permlab_accessLocationExtraCommands"
         android:description="@string/permdesc_accessLocationExtraCommands" />
 
-    <!-- Allows an application to install a location provider into the Location Manager.
+    <!-- @SystemApi 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|system"
         android:label="@string/permlab_installLocationProvider"
         android:description="@string/permdesc_installLocationProvider" />
 
-    <!-- Allows HDMI-CEC service to access device and configuration files.
-         @hide This should only be used by HDMI-CEC service.
+    <!-- @SystemApi @hide Allows HDMI-CEC service to access device and configuration files.
+         This should only be used by HDMI-CEC service.
     -->
     <permission android:name="android.permission.HDMI_CEC"
         android:protectionLevel="signatureOrSystem" />
 
-    <!-- Allows an application to use location features in hardware,
+    <!-- @SystemApi 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"
@@ -805,7 +804,7 @@
         android:description="@string/permdesc_bluetoothAdmin"
         android:label="@string/permlab_bluetoothAdmin" />
 
-    <!-- Allows applications to pair bluetooth devices without user interaction.
+    <!-- @SystemApi Allows applications to pair bluetooth devices without user interaction.
          This is not available to third party applications. -->
     <permission android:name="android.permission.BLUETOOTH_PRIVILEGED"
         android:permissionGroup="android.permission-group.BLUETOOTH_NETWORK"
@@ -827,18 +826,18 @@
         android:description="@string/permdesc_nfc"
         android:label="@string/permlab_nfc" />
 
-    <!-- Allows an internal user to use privileged ConnectivityManager APIs.
+    <!-- @SystemApi Allows an internal user to use privileged ConnectivityManager APIs.
         @hide -->
     <permission android:name="android.permission.CONNECTIVITY_INTERNAL"
         android:permissionGroup="android.permission-group.NETWORK"
         android:protectionLevel="signature|system" />
 
-    <!-- @hide -->
+    <!-- @SystemApi @hide -->
     <permission android:name="android.permission.RECEIVE_DATA_ACTIVITY_CHANGE"
         android:permissionGroup="android.permission-group.NETWORK"
         android:protectionLevel="signature|system" />
 
-    <!-- Allows access to the loop radio (Android@Home mesh network) device.
+    <!-- @SystemApi Allows access to the loop radio (Android@Home mesh network) device.
 	@hide -->
     <permission android:name="android.permission.LOOP_RADIO"
 	android:permissionGroup="android.permission-group.NETWORK"
@@ -887,7 +886,7 @@
         android:label="@string/permlab_manageAccounts"
         android:description="@string/permdesc_manageAccounts" />
 
-    <!-- Allows applications to call into AccountAuthenticators.
+    <!-- @SystemApi Allows applications to call into AccountAuthenticators.
     <p>Not for use by third-party applications. -->
     <permission android:name="android.permission.ACCOUNT_MANAGER"
         android:permissionGroup="android.permission-group.ACCOUNTS"
@@ -978,7 +977,7 @@
         android:description="@string/permgroupdesc_hardwareControls"
         android:priority="260"/>
 
-    <!-- Allows an application to manage preferences and permissions for USB devices
+    <!-- @SystemApi Allows an application to manage preferences and permissions for USB devices
          @hide -->
     <permission android:name="android.permission.MANAGE_USB"
         android:permissionGroup="android.permission-group.HARDWARE_CONTROLS"
@@ -986,7 +985,7 @@
         android:label="@string/permlab_manageUsb"
         android:description="@string/permdesc_manageUsb" />
 
-    <!-- Allows an application to access the MTP USB kernel driver.
+    <!-- @SystemApi Allows an application to access the MTP USB kernel driver.
          For use only by the device side MTP implementation.
          @hide -->
     <permission android:name="android.permission.ACCESS_MTP"
@@ -1022,7 +1021,7 @@
         android:description="@string/permdesc_sim_communication"
         android:protectionLevel="dangerous" />
 
-    <!-- Allows TvInputService to access underlying TV input hardware such as
+    <!-- @SystemApi Allows TvInputService to access underlying TV input hardware such as
          built-in tuners and HDMI-in's.
          @hide This should only be used by OEM's TvInputService's.
     -->
@@ -1079,7 +1078,7 @@
         android:label="@string/permlab_camera"
         android:description="@string/permdesc_camera" />
 
-    <!-- Allows disabling the transmit-indicator LED that is normally on when
+    <!-- @SystemApi Allows disabling the transmit-indicator LED that is normally on when
          a camera is in use by an application.
          @hide -->
     <permission android:name="android.permission.CAMERA_DISABLE_TRANSMIT_LED"
@@ -1112,7 +1111,7 @@
         android:label="@string/permlab_processOutgoingCalls"
         android:description="@string/permdesc_processOutgoingCalls" />
 
-    <!-- Allows modification of the telephony state - power on, mmi, etc.
+    <!-- @SystemApi 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"
@@ -1144,7 +1143,7 @@
         android:label="@string/permlab_readPrecisePhoneState"
         android:description="@string/permdesc_readPrecisePhoneState" />
 
-    <!-- Allows read access to privileged phone state.
+    <!-- @SystemApi Allows read access to privileged phone state.
          @hide Used internally. -->
     <permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE"
         android:permissionGroup="android.permission-group.PHONE_CALLS"
@@ -1167,7 +1166,7 @@
         android:description="@string/permdesc_use_sip"
         android:label="@string/permlab_use_sip" />
 
-    <!-- Allows an application to request CallHandlerService implementations.
+    <!-- @SystemApi Allows an application to request CallHandlerService implementations.
          @hide -->
     <permission android:name="android.permission.BIND_CALL_SERVICE"
         android:permissionGroup="android.permission-group.PHONE_CALLS"
@@ -1233,7 +1232,7 @@
         android:description="@string/permdesc_sdcardWrite"
         android:protectionLevel="dangerous" />
 
-    <!-- Allows an application to write to internal media storage
+    <!-- @SystemApi Allows an application to write to internal media storage
          @hide  -->
     <permission android:name="android.permission.WRITE_MEDIA_STORAGE"
         android:permissionGroup="android.permission-group.STORAGE"
@@ -1283,14 +1282,15 @@
         android:description="@string/permgroupdesc_appInfo"
         android:priority="220" />
 
-    <!-- Allows an application to get information about the currently
+    <!-- @SystemApi Allows an application to get information about the currently
          or recently running tasks. -->
     <permission android:name="android.permission.GET_TASKS"
         android:permissionGroup="android.permission-group.APP_INFO"
         android:protectionLevel="signature|system"
         android:label="@string/permlab_getTasks"
         android:description="@string/permdesc_getTasks" />
-    <!-- @hide Allows an application to call APIs that allow it to do interactions
+
+    <!-- @SystemApi @hide Allows an application to call APIs that allow it to do interactions
          across the users on the device, using singleton services and
          user-targeted broadcasts.  This permission is not available to
          third party applications. -->
@@ -1309,7 +1309,7 @@
         android:label="@string/permlab_interactAcrossUsersFull"
         android:description="@string/permdesc_interactAcrossUsersFull" />
 
-    <!-- @hide Allows an application to call APIs that allow it to query and manage
+    <!-- @SystemApi @hide Allows an application to call APIs that allow it to query and manage
          users on the device. This permission is not available to
          third party applications. -->
     <permission android:name="android.permission.MANAGE_USERS"
@@ -1341,7 +1341,7 @@
         android:label="@string/permlab_removeTasks"
         android:description="@string/permdesc_removeTasks" />
 
-    <!-- @hide Allows an application to create/manage/remove stacks -->
+    <!-- @SystemApi @hide Allows an application to create/manage/remove stacks -->
     <permission android:name="android.permission.MANAGE_ACTIVITY_STACKS"
         android:permissionGroup="android.permission-group.APP_INFO"
         android:protectionLevel="signature|system"
@@ -1435,7 +1435,7 @@
         android:description="@string/permgroupdesc_systemClock"
         android:priority="140" />
 
-    <!-- Allows applications to set the system time.
+    <!-- @SystemApi 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|system"
@@ -1541,7 +1541,7 @@
         android:description="@string/permgroupdesc_systemTools"
         android:priority="100" />
 
-    <!-- @hide Change the screen compatibility mode of applications -->
+    <!-- @SystemApi @hide Change the screen compatibility mode of applications -->
     <permission android:name="android.permission.SET_SCREEN_COMPATIBILITY"
         android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
         android:protectionLevel="signature"
@@ -1555,7 +1555,7 @@
         android:description="@string/permdesc_sdcardAccessAll"
         android:protectionLevel="signature" />
 
-    <!-- Allows an application to modify the current configuration, such
+    <!-- @SystemApi Allows an application to modify the current configuration, such
          as locale. -->
     <permission android:name="android.permission.CHANGE_CONFIGURATION"
         android:permissionGroup="android.permission-group.DEVELOPMENT_TOOLS"
@@ -1570,14 +1570,14 @@
         android:label="@string/permlab_writeSettings"
         android:description="@string/permdesc_writeSettings" />
 
-    <!-- Allows an application to modify the Google service map.
+    <!-- @SystemApi 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|system"
         android:label="@string/permlab_writeGservices"
         android:description="@string/permdesc_writeGservices" />
 
-    <!-- Allows an application to call
+    <!-- @SystemApi Allows an application to call
         {@link android.app.ActivityManager#forceStopPackage}.
         @hide -->
     <permission android:name="android.permission.FORCE_STOP_PACKAGES"
@@ -1586,7 +1586,7 @@
         android:label="@string/permlab_forceStopPackages"
         android:description="@string/permdesc_forceStopPackages" />
 
-    <!-- @hide Allows an application to retrieve the content of the active window
+    <!-- @SystemApi @hide Allows an application to retrieve the content of the active window
          An active window is the window that has fired an accessibility event. -->
     <permission android:name="android.permission.RETRIEVE_WINDOW_CONTENT"
         android:permissionGroup="android.permission-group.PERSONAL_INFO"
@@ -1594,7 +1594,7 @@
         android:label="@string/permlab_retrieve_window_content"
         android:description="@string/permdesc_retrieve_window_content" />
 
-    <!-- Modify the global animation scaling factor.
+    <!-- @SystemApi Modify the global animation scaling factor.
     <p>Not for use by third-party applications. -->
     <permission android:name="android.permission.SET_ANIMATION_SCALE"
         android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
@@ -1653,7 +1653,7 @@
         android:label="@string/permlab_broadcastSticky"
         android:description="@string/permdesc_broadcastSticky" />
 
-    <!-- Allows mounting and unmounting file systems for removable storage.
+    <!-- @SystemApi 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:permissionGroup="android.permission-group.SYSTEM_TOOLS"
@@ -1661,7 +1661,7 @@
         android:label="@string/permlab_mount_unmount_filesystems"
         android:description="@string/permdesc_mount_unmount_filesystems" />
 
-    <!-- Allows formatting file systems for removable storage.
+    <!-- @SystemApi Allows formatting file systems for removable storage.
     <p>Not for use by third-party applications. -->
     <permission android:name="android.permission.MOUNT_FORMAT_FILESYSTEMS"
         android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
@@ -1709,7 +1709,7 @@
         android:label="@string/permlab_asec_rename"
         android:description="@string/permdesc_asec_rename" />
 
-    <!-- Allows applications to write the apn settings.
+    <!-- @SystemApi Allows applications to write the apn settings.
     <p>Not for use by third-party applications. -->
     <permission android:name="android.permission.WRITE_APN_SETTINGS"
                 android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
@@ -1745,14 +1745,14 @@
         android:label="@string/permlab_clearAppCache"
         android:description="@string/permdesc_clearAppCache" />
 
-    <!-- Allows an application to use any media decoder when decoding for playback
+    <!-- @SystemApi Allows an application to use any media decoder when decoding for playback
          @hide -->
     <permission android:name="android.permission.ALLOW_ANY_CODEC_FOR_PLAYBACK"
         android:protectionLevel="signature|system"
         android:label="@string/permlab_anyCodecForPlayback"
         android:description="@string/permdesc_anyCodecForPlayback" />
 
-    <!-- Allows an application to install and/or uninstall CA certificates on
+    <!-- @SystemApi Allows an application to install and/or uninstall CA certificates on
          behalf of the user.
          @hide -->
     <permission android:name="android.permission.MANAGE_CA_CERTIFICATES"
@@ -1760,7 +1760,7 @@
         android:label="@string/permlab_manageCaCertificates"
         android:description="@string/permdesc_manageCaCertificates" />
 
-    <!-- Allows an application to do certain operations needed for
+    <!-- @SystemApi Allows an application to do certain operations needed for
          interacting with the recovery (system update) system. -->
     <permission android:name="android.permission.RECOVERY"
         android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
@@ -1789,7 +1789,7 @@
         android:description="@string/permgroupdesc_developmentTools"
         android:priority="310" />
 
-    <!-- Allows an application to read or write the secure system settings.
+    <!-- @SystemApi 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:permissionGroup="android.permission-group.DEVELOPMENT_TOOLS"
@@ -1797,7 +1797,7 @@
         android:label="@string/permlab_writeSecureSettings"
         android:description="@string/permdesc_writeSecureSettings" />
 
-    <!-- Allows an application to retrieve state dump information from system services.
+    <!-- @SystemApi 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:permissionGroup="android.permission-group.DEVELOPMENT_TOOLS"
@@ -1805,7 +1805,7 @@
         android:label="@string/permlab_dump"
         android:description="@string/permdesc_dump" />
 
-    <!-- Allows an application to read the low-level system log files.
+    <!-- @SystemApi 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"
@@ -1814,7 +1814,7 @@
         android:label="@string/permlab_readLogs"
         android:description="@string/permdesc_readLogs" />
 
-    <!-- Configure an application for debugging.
+    <!-- @SystemApi Configure an application for debugging.
     <p>Not for use by third-party applications. -->
     <permission android:name="android.permission.SET_DEBUG_APP"
         android:permissionGroup="android.permission-group.DEVELOPMENT_TOOLS"
@@ -1822,7 +1822,7 @@
         android:label="@string/permlab_setDebugApp"
         android:description="@string/permdesc_setDebugApp" />
 
-    <!-- Allows an application to set the maximum number of (not needed)
+    <!-- @SystemApi 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"
@@ -1831,7 +1831,7 @@
         android:label="@string/permlab_setProcessLimit"
         android:description="@string/permdesc_setProcessLimit" />
 
-    <!-- Allows an application to control whether activities are immediately
+    <!-- @SystemApi 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"
@@ -1840,7 +1840,7 @@
         android:label="@string/permlab_setAlwaysFinish"
         android:description="@string/permdesc_setAlwaysFinish" />
 
-    <!-- Allow an application to request that a signal be sent to all persistent processes.
+    <!-- @SystemApi 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:permissionGroup="android.permission-group.DEVELOPMENT_TOOLS"
@@ -1853,7 +1853,7 @@
     <!-- ==================================== -->
     <eat-comment />
 
-    <!-- Allows applications to RW to diagnostic resources.
+    <!-- @SystemApi Allows applications to RW to diagnostic resources.
     <p>Not for use by third-party applications. -->
     <permission android:name="android.permission.DIAGNOSTIC"
         android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
@@ -1861,7 +1861,7 @@
         android:description="@string/permdesc_diagnostic"
         android:label="@string/permlab_diagnostic" />
 
-    <!-- Allows an application to open, close, or disable the status bar
+    <!-- @SystemApi 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"
@@ -1884,21 +1884,21 @@
         android:description="@string/permdesc_forceBack"
         android:protectionLevel="signature" />
 
-    <!-- Allows an application to update device statistics.
+    <!-- @SystemApi Allows an application to update device statistics.
     <p>Not for use by third-party applications. -->
     <permission android:name="android.permission.UPDATE_DEVICE_STATS"
         android:label="@string/permlab_updateBatteryStats"
         android:description="@string/permdesc_updateBatteryStats"
         android:protectionLevel="signature|system" />
 
-    <!-- @hide Allows an application to collect battery statistics -->
+    <!-- @SystemApi @hide Allows an application to collect battery statistics -->
     <permission android:name="android.permission.GET_APP_OPS_STATS"
         android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
         android:label="@string/permlab_getAppOpsStats"
         android:description="@string/permdesc_getAppOpsStats"
         android:protectionLevel="signature|system|development" />
 
-    <!-- Allows an application to update application operation statistics. Not for
+    <!-- @SystemApi Allows an application to update application operation statistics. Not for
          use by third party apps. @hide -->
     <permission android:name="android.permission.UPDATE_APP_OPS_STATS"
         android:label="@string/permlab_updateAppOpsStats"
@@ -1971,7 +1971,7 @@
         android:description="@string/permdesc_runSetActivityWatcher"
         android:protectionLevel="signature" />
 
-    <!-- Allows an application to call the activity manager shutdown() API
+    <!-- @SystemApi Allows an application to call the activity manager shutdown() API
          to put the higher-level system there into a shutdown state.
          @hide -->
     <permission android:name="android.permission.SHUTDOWN"
@@ -1979,7 +1979,7 @@
         android:description="@string/permdesc_shutdown"
         android:protectionLevel="signature|system" />
 
-    <!-- Allows an application to tell the activity manager to temporarily
+    <!-- @SystemApi Allows an application to tell the activity manager to temporarily
          stop application switches, putting it into a special mode that
          prevents applications from immediately switching away from some
          critical UI such as the home screen.
@@ -2100,7 +2100,7 @@
         android:description="@string/permdesc_bindDeviceAdmin"
         android:protectionLevel="signature" />
 
-    <!-- Required to add or remove another application as a device admin.
+    <!-- @SystemApi Required to add or remove another application as a device admin.
          <p>Not for use by third-party applications.
          @hide -->
     <permission android:name="android.permission.MANAGE_DEVICE_ADMINS"
@@ -2139,7 +2139,7 @@
         android:description="@string/permdesc_setKeyboardLayout"
         android:protectionLevel="signature" />
 
-    <!-- Allows an application to install packages.
+    <!-- @SystemApi Allows an application to install packages.
     <p>Not for use by third-party applications. -->
     <permission android:name="android.permission.INSTALL_PACKAGES"
         android:label="@string/permlab_installPackages"
@@ -2153,28 +2153,28 @@
         android:description="@string/permdesc_clearAppUserData"
         android:protectionLevel="signature" />
 
-    <!-- Allows an application to delete cache files.
+    <!-- @SystemApi Allows an application to delete cache files.
     <p>Not for use by third-party applications. -->
     <permission android:name="android.permission.DELETE_CACHE_FILES"
         android:label="@string/permlab_deleteCacheFiles"
         android:description="@string/permdesc_deleteCacheFiles"
         android:protectionLevel="signature|system" />
 
-    <!-- Allows an application to delete packages.
+    <!-- @SystemApi Allows an application to delete packages.
     <p>Not for use by third-party applications. -->
     <permission android:name="android.permission.DELETE_PACKAGES"
         android:label="@string/permlab_deletePackages"
         android:description="@string/permdesc_deletePackages"
         android:protectionLevel="signature|system" />
 
-    <!-- Allows an application to move location of installed package.
+    <!-- @SystemApi Allows an application to move location of installed package.
          @hide -->
     <permission android:name="android.permission.MOVE_PACKAGE"
         android:label="@string/permlab_movePackage"
         android:description="@string/permdesc_movePackage"
         android:protectionLevel="signature|system" />
 
-    <!-- Allows an application to change whether an application component (other than its own) is
+    <!-- @SystemApi 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"
@@ -2195,7 +2195,7 @@
         android:description="@string/permdesc_accessSurfaceFlinger"
         android:protectionLevel="signature" />
 
-    <!-- Allows an application to take screen shots and more generally
+    <!-- @SystemApi Allows an application to take screen shots and more generally
          get access to the frame buffer data.
          <p>Not for use by third-party applications. -->
     <permission android:name="android.permission.READ_FRAME_BUFFER"
@@ -2226,14 +2226,14 @@
         android:description="@string/permdesc_controlWifiDisplay"
         android:protectionLevel="signature" />
 
-    <!-- Allows an application to capture audio output.
+    <!-- @SystemApi 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:label="@string/permlab_captureAudioOutput"
         android:description="@string/permdesc_captureAudioOutput"
         android:protectionLevel="signature|system" />
 
-    <!-- Allows an application to capture audio for hotword detection.
+    <!-- @SystemApi Allows an application to capture audio for hotword detection.
          <p>Not for use by third-party applications.</p>
          @hide -->
     <permission android:name="android.permission.CAPTURE_AUDIO_HOTWORD"
@@ -2241,7 +2241,7 @@
         android:description="@string/permdesc_captureAudioHotword"
         android:protectionLevel="signature|system" />
 
-    <!-- Allows an application to modify audio routing and override policy decisions.
+    <!-- @SystemApi Allows an application to modify audio routing and override policy decisions.
          <p>Not for use by third-party applications.</p>
          @hide -->
     <permission android:name="android.permission.MODIFY_AUDIO_ROUTING"
@@ -2249,21 +2249,21 @@
         android:description="@string/permdesc_modifyAudioRouting"
         android:protectionLevel="signature|system" />
 
-    <!-- Allows an application to capture video output.
+    <!-- @SystemApi Allows an application to capture video output.
          <p>Not for use by third-party applications.</p> -->
     <permission android:name="android.permission.CAPTURE_VIDEO_OUTPUT"
         android:label="@string/permlab_captureVideoOutput"
         android:description="@string/permdesc_captureVideoOutput"
         android:protectionLevel="signature|system" />
 
-    <!-- Allows an application to capture secure video output.
+    <!-- @SystemApi Allows an application to capture secure video output.
          <p>Not for use by third-party applications.</p> -->
     <permission android:name="android.permission.CAPTURE_SECURE_VIDEO_OUTPUT"
         android:label="@string/permlab_captureSecureVideoOutput"
         android:description="@string/permdesc_captureSecureVideoOutput"
         android:protectionLevel="signature|system" />
 
-    <!-- Allows an application to know what content is playing and control its playback.
+    <!-- @SystemApi 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:label="@string/permlab_mediaContentControl"
@@ -2277,7 +2277,7 @@
         android:description="@string/permdesc_brick"
         android:protectionLevel="signature" />
 
-    <!-- Required to be able to reboot the device.
+    <!-- @SystemApi Required to be able to reboot the device.
     <p>Not for use by third-party applications. -->
     <permission android:name="android.permission.REBOOT"
         android:label="@string/permlab_reboot"
@@ -2329,20 +2329,20 @@
         android:description="@string/permdesc_broadcastWapPush"
         android:protectionLevel="signature" />
 
-    <!-- Allows an application to broadcast a SCORE_NETWORKS request.
+    <!-- @SystemApi Allows an application to broadcast a SCORE_NETWORKS request.
          <p>Not for use by third-party applications. @hide -->
     <permission android:name="android.permission.BROADCAST_SCORE_NETWORKS"
         android:label="@string/permlab_broadcastScoreNetworks"
         android:description="@string/permdesc_broadcastScoreNetworks"
         android:protectionLevel="signature|system" />
 
-    <!-- Not for use by third-party applications. -->
+    <!-- @SystemApi Not for use by third-party applications. -->
     <permission android:name="android.permission.MASTER_CLEAR"
         android:label="@string/permlab_masterClear"
         android:description="@string/permdesc_masterClear"
         android:protectionLevel="signature|system" />
 
-    <!-- Allows an application to call any phone number, including emergency
+    <!-- @SystemApi 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. -->
@@ -2351,13 +2351,13 @@
         android:description="@string/permdesc_callPrivileged"
         android:protectionLevel="signature|system" />
 
-    <!-- Allows an application to perform CDMA OTA provisioning @hide -->
+    <!-- @SystemApi Allows an application to perform CDMA OTA provisioning @hide -->
     <permission android:name="android.permission.PERFORM_CDMA_PROVISIONING"
         android:label="@string/permlab_performCdmaProvisioning"
         android:description="@string/permdesc_performCdmaProvisioning"
         android:protectionLevel="signature|system" />
 
-    <!-- Allows enabling/disabling location update notifications from
+    <!-- @SystemApi 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"
@@ -2365,7 +2365,7 @@
         android:description="@string/permdesc_locationUpdates"
         android:protectionLevel="signature|system" />
 
-    <!-- Allows read/write access to the "properties" table in the checkin
+    <!-- @SystemApi 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"
@@ -2373,21 +2373,21 @@
         android:description="@string/permdesc_checkinProperties"
         android:protectionLevel="signature|system" />
 
-    <!-- Allows an application to collect component usage
+    <!-- @SystemApi Allows an application to collect component usage
          statistics @hide -->
     <permission android:name="android.permission.PACKAGE_USAGE_STATS"
         android:label="@string/permlab_pkgUsageStats"
         android:description="@string/permdesc_pkgUsageStats"
         android:protectionLevel="signature|system" />
 
-    <!-- Allows an application to collect battery statistics -->
+    <!-- @SystemApi Allows an application to collect battery statistics -->
     <permission android:name="android.permission.BATTERY_STATS"
         android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
         android:label="@string/permlab_batteryStats"
         android:description="@string/permdesc_batteryStats"
         android:protectionLevel="signature|system" />
 
-    <!-- Allows an application to control the backup and restore process.
+    <!-- @SystemApi Allows an application to control the backup and restore process.
     <p>Not for use by third-party applications.
          @hide pending API council -->
     <permission android:name="android.permission.BACKUP"
@@ -2403,14 +2403,14 @@
         android:description="@string/permdesc_confirm_full_backup"
         android:protectionLevel="signature" />
 
-    <!-- Must be required by a {@link android.widget.RemoteViewsService},
+    <!-- @SystemApi 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:label="@string/permlab_bindRemoteViews"
         android:description="@string/permdesc_bindRemoteViews"
         android:protectionLevel="signature|system" />
 
-    <!-- Allows an application to tell the AppWidget service which application
+    <!-- @SystemApi 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.
@@ -2422,14 +2422,14 @@
         android:description="@string/permdesc_bindGadget"
         android:protectionLevel="signature|system" />
 
-    <!-- Private permission, to restrict who can bring up a dialog to add a new
+    <!-- @SystemApi Private permission, to restrict who can bring up a dialog to add a new
          keyguard widget
          @hide -->
     <permission android:name="android.permission.BIND_KEYGUARD_APPWIDGET"
         android:permissionGroup="android.permission-group.PERSONAL_INFO"
         android:protectionLevel="signature|system" />
 
-    <!-- Internal permission allowing an application to query/set which
+    <!-- @SystemApi Internal permission allowing an application to query/set which
          applications can bind AppWidgets.
          @hide -->
     <permission android:name="android.permission.MODIFY_APPWIDGET_BIND_PERMISSIONS"
@@ -2445,7 +2445,7 @@
         android:description="@string/permdesc_changeBackgroundDataSetting"
         android:label="@string/permlab_changeBackgroundDataSetting" />
 
-    <!-- This permission can be used on content providers to allow the global
+    <!-- @SystemApi 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
@@ -2468,32 +2468,32 @@
         android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
         android:protectionLevel="signature" />
 
-    <!-- Internal permission to allows an application to read indexable data.
+    <!-- @SystemApi Internal permission to allows an application to read indexable data.
         @hide -->
     <permission android:name="android.permission.READ_SEARCH_INDEXABLES"
         android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
         android:protectionLevel="signature|system" />
 
-    <!-- Allows applications to set a live wallpaper.
+    <!-- @SystemApi Allows applications to set a live wallpaper.
          @hide XXX Change to signature once the picker is moved to its
          own apk as Ghod Intended. -->
     <permission android:name="android.permission.SET_WALLPAPER_COMPONENT"
         android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
         android:protectionLevel="signature|system" />
 
-    <!-- Allows applications to read dream settings and dream state.
+    <!-- @SystemApi Allows applications to read dream settings and dream state.
          @hide -->
     <permission android:name="android.permission.READ_DREAM_STATE"
         android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
         android:protectionLevel="signature|system" />
 
-    <!-- Allows applications to write dream settings, and start or stop dreaming.
+    <!-- @SystemApi Allows applications to write dream settings, and start or stop dreaming.
          @hide -->
     <permission android:name="android.permission.WRITE_DREAM_STATE"
         android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
         android:protectionLevel="signature|system" />
 
-    <!-- Allow an application to read and write the cache partition.
+    <!-- @SystemApi Allow an application to read and write the cache partition.
          @hide -->
     <permission android:name="android.permission.ACCESS_CACHE_FILESYSTEM"
         android:label="@string/permlab_cache_filesystem"
@@ -2510,13 +2510,13 @@
         android:description="@string/permlab_copyProtectedData"
         android:protectionLevel="signature" />
 
-    <!-- Internal permission protecting access to the encryption methods
+    <!-- @SystemApi Internal permission protecting access to the encryption methods
         @hide
     -->
     <permission android:name="android.permission.CRYPT_KEEPER"
         android:protectionLevel="signature|system" />
 
-    <!-- Allows an application to read historical network usage for
+    <!-- @SystemApi Allows an application to read historical network usage for
          specific networks and applications. @hide -->
     <permission android:name="android.permission.READ_NETWORK_USAGE_HISTORY"
         android:label="@string/permlab_readNetworkUsageHistory"
@@ -2530,7 +2530,7 @@
         android:description="@string/permdesc_manageNetworkPolicy"
         android:protectionLevel="signature" />
 
-    <!-- Allows an application to account its network traffic against other UIDs. Used
+    <!-- @SystemApi Allows an application to account its network traffic against other UIDs. Used
          by system services like download manager and media server. Not for use by
          third party apps. @hide -->
     <permission android:name="android.permission.MODIFY_NETWORK_ACCOUNTING"
@@ -2538,7 +2538,7 @@
         android:description="@string/permdesc_modifyNetworkAccounting"
         android:protectionLevel="signature|system" />
 
-    <!-- Allows an application to mark traffic as from another user for per user routing.
+    <!-- @SystemApi Allows an application to mark traffic as from another user for per user routing.
          Used by system wide services like media server that execute delegated network connections
          for users.
          @hide
@@ -2555,7 +2555,7 @@
           android:protectionLevel="signature" />
     <uses-permission android:name="android.intent.category.MASTER_CLEAR.permission.C2D_MESSAGE"/>
 
-    <!-- @hide Package verifier needs to have this permission before the PackageManager will
+    <!-- @SystemApi @hide Package verifier needs to have this permission before the PackageManager will
          trust it to verify packages.
     -->
     <permission android:name="android.permission.PACKAGE_VERIFICATION_AGENT"
@@ -2572,7 +2572,7 @@
         android:description="@string/permdesc_bindPackageVerifier"
         android:protectionLevel="signature" />
 
-    <!-- Allows applications to access serial ports via the SerialManager.
+    <!-- @SystemApi Allows applications to access serial ports via the SerialManager.
          @hide -->
     <permission android:name="android.permission.SERIAL_PORT"
         android:label="@string/permlab_serialPort"
@@ -2589,7 +2589,8 @@
         android:label="@string/permlab_accessContentProvidersExternally"
         android:description="@string/permdesc_accessContentProvidersExternally"
         android:protectionLevel="signature" />
-    <!-- Allows an application to hold an UpdateLock, recommending that a headless
+
+    <!-- @SystemApi Allows an application to hold an UpdateLock, recommending that a headless
          OTA reboot *not* occur while the lock is held.
          @hide -->
     <permission android:name="android.permission.UPDATE_LOCK"
@@ -2597,7 +2598,7 @@
         android:description="@string/permdesc_updateLock"
         android:protectionLevel="signatureOrSystem" />
 
-    <!-- Allows an application to read the current set of notifications, including
+    <!-- @SystemApi Allows an application to read the current set of notifications, including
          any metadata and intents attached.
          @hide -->
     <permission android:name="android.permission.ACCESS_NOTIFICATIONS"
@@ -2626,7 +2627,7 @@
                 android:label="@string/permlab_trust_listener"
                 android:description="@string/permdesc_trust_listener" />
 
-    <!-- Allows an application to provide a trust agent.
+    <!-- @SystemApi Allows an application to provide a trust agent.
          @hide For security reasons, this is a platform-only permission. -->
     <permission android:name="android.permission.PROVIDE_TRUST_AGENT"
                 android:protectionLevel="signatureOrSystem"
@@ -2658,7 +2659,7 @@
         android:description="@string/permdesc_bindConditionProviderService"
         android:protectionLevel="signature" />
 
-    <!-- Allows an application to call into a carrier setup flow. It is up to the
+    <!-- @SystemApi Allows an application to call into a carrier setup flow. It is up to the
          carrier setup application to enforce that this permission is required
          @hide This is not a third-party API (intended for OEMs and system apps). -->
     <permission android:name="android.permission.INVOKE_CARRIER_SETUP"
@@ -2666,14 +2667,14 @@
         android:description="@string/permdesc_invokeCarrierSetup"
         android:protectionLevel="signature|system" />
 
-    <!-- Allows an application to listen for network condition observations.
+    <!-- @SystemApi Allows an application to listen for network condition observations.
          @hide This is not a third-party API (intended for system apps). -->
     <permission android:name="android.permission.ACCESS_NETWORK_CONDITIONS"
         android:label="@string/permlab_accessNetworkConditions"
         android:description="@string/permdesc_accessNetworkConditions"
         android:protectionLevel="signature|system" />
 
-    <!-- Allows an application to provision and access DRM certificates
+    <!-- @SystemApi Allows an application to provision and access DRM certificates
          @hide This is not a third-party API (intended for system apps). -->
     <permission android:name="android.permission.ACCESS_DRM_CERTIFICATES"
         android:label="@string/permlab_accessDrmCertificates"