Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bfc4fcde authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Give Doclava our manifest; more permission docs.

We've seen some @SystemApi methods protected with non-system
permissions, so give Doclava the platform AndroidManifest.xml so it
can parse the actual permission protection levels to look for APIs
that are letting in non-system apps.

Also document more @SystemApi permissions.

This is purely a docs change; no logic changes are being made.

Test: make -j32 update-api
Bug: 62263906
Change-Id: Ie0f0a5fb0033817bcc95060f2183a52ae4ae7b06
parent d86b8fea
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -923,6 +923,7 @@ framework_docs_LOCAL_DROIDDOC_OPTIONS := \
    -android \
    -knowntags ./frameworks/base/docs/knowntags.txt \
    -knowntags ./libcore/known_oj_tags.txt \
    -manifest ./frameworks/base/core/res/AndroidManifest.xml \
    -hidePackage com.android.org.conscrypt \
    -since $(SRC_API_DIR)/1.xml 1 \
    -since $(SRC_API_DIR)/2.xml 2 \
+8 −4
Original line number Diff line number Diff line
@@ -1605,6 +1605,7 @@ public class DevicePolicyManager {
     * @hide
     */
    @SystemApi
    @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL)
    public boolean packageHasActiveAdmins(String packageName) {
        return packageHasActiveAdmins(packageName, myUserId());
    }
@@ -4516,11 +4517,10 @@ public class DevicePolicyManager {
    /**
     * @return device owner component name, even if it's running on a different user.
     *
     * <p>Requires the MANAGE_USERS permission.
     *
     * @hide
     */
    @SystemApi
    @RequiresPermission(android.Manifest.permission.MANAGE_USERS)
    public ComponentName getDeviceOwnerComponentOnAnyUser() {
        return getDeviceOwnerComponentInner(/* callingUserOnly =*/ false);
    }
@@ -4604,6 +4604,7 @@ public class DevicePolicyManager {
     * @hide
     */
    @SystemApi
    @RequiresPermission(android.Manifest.permission.MANAGE_USERS)
    public @Nullable String getDeviceOwner() {
        throwIfParentInstance("getDeviceOwner");
        final ComponentName name = getDeviceOwnerComponentOnCallingUser();
@@ -4621,6 +4622,7 @@ public class DevicePolicyManager {
     */
    @SystemApi
    @TestApi
    @SuppressLint("Doclava125")
    public boolean isDeviceManaged() {
        try {
            return mService.hasDeviceOwner();
@@ -4633,11 +4635,10 @@ public class DevicePolicyManager {
     * Returns the device owner name.  Note this method *will* return the device owner
     * name when it's running on a different user.
     *
     * <p>Requires the MANAGE_USERS permission.
     *
     * @hide
     */
    @SystemApi
    @RequiresPermission(android.Manifest.permission.MANAGE_USERS)
    public String getDeviceOwnerNameOnAnyUser() {
        throwIfParentInstance("getDeviceOwnerNameOnAnyUser");
        if (mService != null) {
@@ -5010,6 +5011,7 @@ public class DevicePolicyManager {
     * @throws IllegalArgumentException if the userId is invalid.
     */
    @SystemApi
    @RequiresPermission(android.Manifest.permission.MANAGE_USERS)
    public @Nullable String getProfileOwnerNameAsUser(int userId) throws IllegalArgumentException {
        throwIfParentInstance("getProfileOwnerNameAsUser");
        if (mService != null) {
@@ -7528,6 +7530,7 @@ public class DevicePolicyManager {
     */
    @SystemApi
    @TestApi
    @SuppressLint("Doclava125")
    public @Nullable CharSequence getDeviceOwnerOrganizationName() {
        try {
            return mService.getDeviceOwnerOrganizationName();
@@ -7739,6 +7742,7 @@ public class DevicePolicyManager {
     * @hide
     */
    @SystemApi
    @RequiresPermission(android.Manifest.permission.MANAGE_USERS)
    public boolean isDeviceProvisioningConfigApplied() {
        try {
            return mService.isDeviceProvisioningConfigApplied();
+8 −0
Original line number Diff line number Diff line
@@ -17,8 +17,10 @@
package android.hardware.hdmi;

import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
import android.annotation.SuppressLint;
import android.content.Context;
import android.annotation.SystemApi;
import android.annotation.SystemService;
@@ -298,6 +300,7 @@ public final class HdmiControlManager {
     * See {@link HdmiDeviceInfo#DEVICE_TV}
     */
    @Nullable
    @SuppressLint("Doclava125")
    public HdmiClient getClient(int type) {
        if (mService == null) {
            return null;
@@ -322,6 +325,7 @@ public final class HdmiControlManager {
     * @return {@link HdmiPlaybackClient} instance. {@code null} on failure.
     */
    @Nullable
    @SuppressLint("Doclava125")
    public HdmiPlaybackClient getPlaybackClient() {
        return (HdmiPlaybackClient) getClient(HdmiDeviceInfo.DEVICE_PLAYBACK);
    }
@@ -336,6 +340,7 @@ public final class HdmiControlManager {
     * @return {@link HdmiTvClient} instance. {@code null} on failure.
     */
    @Nullable
    @SuppressLint("Doclava125")
    public HdmiTvClient getTvClient() {
        return (HdmiTvClient) getClient(HdmiDeviceInfo.DEVICE_TV);
    }
@@ -346,6 +351,7 @@ public final class HdmiControlManager {
     *
     * @param isStandbyModeOn target status of the system's standby mode
     */
    @RequiresPermission(android.Manifest.permission.HDMI_CEC)
    public void setStandbyMode(boolean isStandbyModeOn) {
        try {
            mService.setStandbyMode(isStandbyModeOn);
@@ -406,6 +412,7 @@ public final class HdmiControlManager {
     * @param listener {@link HotplugEventListener} instance
     * @see HdmiControlManager#removeHotplugEventListener(HotplugEventListener)
     */
    @RequiresPermission(android.Manifest.permission.HDMI_CEC)
    public void addHotplugEventListener(HotplugEventListener listener) {
        if (mService == null) {
            Log.e(TAG, "HdmiControlService is not available");
@@ -429,6 +436,7 @@ public final class HdmiControlManager {
     *
     * @param listener {@link HotplugEventListener} instance to be removed
     */
    @RequiresPermission(android.Manifest.permission.HDMI_CEC)
    public void removeHotplugEventListener(HotplugEventListener listener) {
        if (mService == null) {
            Log.e(TAG, "HdmiControlService is not available");
+6 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.annotation.SdkConstant;
import android.annotation.SuppressLint;
import android.annotation.SystemApi;
import android.annotation.SystemService;
import android.annotation.WorkerThread;
@@ -1699,6 +1700,7 @@ public class StorageManager {

    /** @hide */
    @SystemApi
    @SuppressLint("Doclava125")
    public long getAllocatableBytes(@NonNull UUID storageUuid,
            @RequiresPermission @AllocateFlags int flags) throws IOException {
        try {
@@ -1713,6 +1715,7 @@ public class StorageManager {

    /** @removed */
    @Deprecated
    @SuppressLint("Doclava125")
    public long getAllocatableBytes(@NonNull File path,
            @RequiresPermission @AllocateFlags int flags) throws IOException {
        return getAllocatableBytes(getUuidForPath(path), flags);
@@ -1747,6 +1750,7 @@ public class StorageManager {

    /** @hide */
    @SystemApi
    @SuppressLint("Doclava125")
    public void allocateBytes(@NonNull UUID storageUuid, @BytesLong long bytes,
            @RequiresPermission @AllocateFlags int flags) throws IOException {
        try {
@@ -1760,6 +1764,7 @@ public class StorageManager {

    /** @removed */
    @Deprecated
    @SuppressLint("Doclava125")
    public void allocateBytes(@NonNull File path, @BytesLong long bytes,
            @RequiresPermission @AllocateFlags int flags) throws IOException {
        allocateBytes(getUuidForPath(path), bytes, flags);
@@ -1796,6 +1801,7 @@ public class StorageManager {

    /** @hide */
    @SystemApi
    @SuppressLint("Doclava125")
    public void allocateBytes(FileDescriptor fd, @BytesLong long bytes,
            @RequiresPermission @AllocateFlags int flags) throws IOException {
        final File file = ParcelFileDescriptor.getFile(fd);
+2 −0
Original line number Diff line number Diff line
@@ -828,6 +828,7 @@ public class LocationManager {
     * @hide
     */
    @SystemApi
    @RequiresPermission(anyOf = {ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION})
    public void requestLocationUpdates(LocationRequest request, LocationListener listener,
            Looper looper) {
        checkListener(listener);
@@ -856,6 +857,7 @@ public class LocationManager {
     * @hide
     */
    @SystemApi
    @RequiresPermission(anyOf = {ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION})
    public void requestLocationUpdates(LocationRequest request, PendingIntent intent) {
        checkPendingIntent(intent);
        requestLocationUpdates(request, null, null, intent);
Loading