Merge "More auto-doc work." into oc-dev

am: 6bc03748a7

Change-Id: I71f5f408abfa0d7cdf71711bb1bbab63341989c3
This commit is contained in:
Jeff Sharkey
2017-04-24 18:23:35 +00:00
committed by android-build-merger
22 changed files with 111 additions and 134 deletions

View File

@@ -15,30 +15,34 @@
*/
package android.annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.CONSTRUCTOR;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.SOURCE;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Denotes that the annotated method can be called from any thread (e.g. it is "thread safe".)
* If the annotated element is a class, then all methods in the class can be called
* from any thread.
* Denotes that the annotated method can be called from any thread (e.g. it is
* "thread safe".) If the annotated element is a class, then all methods in the
* class can be called from any thread.
* <p>
* The main purpose of this method is to indicate that you believe a method can be called
* from any thread; static tools can then check that nothing you call from within this method
* or class have more strict threading requirements.
* The main purpose of this method is to indicate that you believe a method can
* be called from any thread; static tools can then check that nothing you call
* from within this method or class have more strict threading requirements.
* <p>
* Example:
* <pre><code>
*
* <pre>
* <code>
* &#64;AnyThread
* public void deliverResult(D data) { ... }
* </code></pre>
* </code>
* </pre>
*
* {@hide}
* @memberDoc This method is safe to call from any thread.
* @hide
*/
@Retention(SOURCE)
@Target({METHOD,CONSTRUCTOR,TYPE})

View File

@@ -15,24 +15,29 @@
*/
package android.annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.SOURCE;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Denotes that any overriding methods should invoke this method as well.
* <p>
* Example:
* <pre><code>
*
* <pre>
* <code>
* &#64;CallSuper
* public abstract void onFocusLost();
* </code></pre>
* </code>
* </pre>
*
* @memberDoc If you override this method you <em>must</em> call through to the
* superclass implementation.
* @hide
*/
@Retention(SOURCE)
@Target({METHOD})
public @interface CallSuper {
}
}

View File

@@ -15,9 +15,6 @@
*/
package android.annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.CONSTRUCTOR;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;
@@ -25,6 +22,9 @@ import static java.lang.annotation.RetentionPolicy.SOURCE;
import android.os.Looper;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Denotes that the annotated method should only be called on the main thread.
* If the annotated element is a class, then all methods in the class should be

View File

@@ -16,14 +16,17 @@
package android.annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.CONSTRUCTOR;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.SOURCE;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Denotes that any automatically generated documentation should be suppressed
* for the annotated method, parameter, or field.
@@ -31,6 +34,6 @@ import static java.lang.annotation.RetentionPolicy.SOURCE;
* @hide
*/
@Retention(SOURCE)
@Target({METHOD, PARAMETER, FIELD})
@Target({TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE})
public @interface SuppressAutoDoc {
}

View File

@@ -15,28 +15,36 @@
*/
package android.annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.CONSTRUCTOR;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.SOURCE;
import android.os.Looper;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Denotes that the annotated method or constructor should only be called on the UI thread.
* If the annotated element is a class, then all methods in the class should be called
* on the UI thread.
* Denotes that the annotated method or constructor should only be called on the
* UI thread. If the annotated element is a class, then all methods in the class
* should be called on the UI thread.
* <p>
* Example:
* <pre><code>
*
* <pre>
* <code>
* &#64;UiThread
* public abstract void setText(@NonNull String text) { ... }
* </code></pre>
* </code>
* </pre>
*
* {@hide}
* @memberDoc This method must be called on the thread that originally created
* this UI element. This is typically the
* {@linkplain Looper#getMainLooper() main thread} of your app.
* @hide
*/
@Retention(SOURCE)
@Target({METHOD,CONSTRUCTOR,TYPE})
public @interface UiThread {
}
}

View File

@@ -3081,6 +3081,21 @@ public class ActivityManager {
*/
public int lastTrimLevel;
/** @hide */
@IntDef(prefix = { "IMPORTANCE_" }, value = {
IMPORTANCE_FOREGROUND,
IMPORTANCE_FOREGROUND_SERVICE,
IMPORTANCE_TOP_SLEEPING,
IMPORTANCE_VISIBLE,
IMPORTANCE_PERCEPTIBLE,
IMPORTANCE_CANT_SAVE_STATE,
IMPORTANCE_SERVICE,
IMPORTANCE_CACHED,
IMPORTANCE_GONE,
})
@Retention(RetentionPolicy.SOURCE)
public @interface Importance {}
/**
* Constant for {@link #importance}: This process is running the
* foreground UI; that is, it is the thing currently at the top of the screen
@@ -3190,7 +3205,7 @@ public class ActivityManager {
* will be passed to a client, use {@link #procStateToImportanceForClient}.
* @hide
*/
public static int procStateToImportance(int procState) {
public static @Importance int procStateToImportance(int procState) {
if (procState == PROCESS_STATE_NONEXISTENT) {
return IMPORTANCE_GONE;
} else if (procState >= PROCESS_STATE_HOME) {
@@ -3219,7 +3234,8 @@ public class ActivityManager {
* client's target SDK < {@link VERSION_CODES#O}.
* @hide
*/
public static int procStateToImportanceForClient(int procState, Context clientContext) {
public static @Importance int procStateToImportanceForClient(int procState,
Context clientContext) {
final int importance = procStateToImportance(procState);
// For pre O apps, convert to the old, wrong values.
@@ -3235,7 +3251,7 @@ public class ActivityManager {
}
/** @hide */
public static int importanceToProcState(int importance) {
public static int importanceToProcState(@Importance int importance) {
if (importance == IMPORTANCE_GONE) {
return PROCESS_STATE_NONEXISTENT;
} else if (importance >= IMPORTANCE_CACHED) {
@@ -3258,14 +3274,11 @@ public class ActivityManager {
}
/**
* The relative importance level that the system places on this
* process. May be one of {@link #IMPORTANCE_FOREGROUND},
* {@link #IMPORTANCE_VISIBLE}, {@link #IMPORTANCE_SERVICE}, or
* {@link #IMPORTANCE_CACHED}. These
* constants are numbered so that "more important" values are always
* smaller than "less important" values.
* The relative importance level that the system places on this process.
* These constants are numbered so that "more important" values are
* always smaller than "less important" values.
*/
public int importance;
public @Importance int importance;
/**
* An additional ordering within a particular {@link #importance}
@@ -3459,7 +3472,7 @@ public class ActivityManager {
*/
@SystemApi @TestApi
@RequiresPermission(Manifest.permission.PACKAGE_USAGE_STATS)
public int getPackageImportance(String packageName) {
public @RunningAppProcessInfo.Importance int getPackageImportance(String packageName) {
try {
int procState = getService().getPackageProcessState(packageName,
mContext.getOpPackageName());
@@ -3479,7 +3492,7 @@ public class ActivityManager {
*/
@SystemApi @TestApi
@RequiresPermission(Manifest.permission.PACKAGE_USAGE_STATS)
public int getUidImportance(int uid) {
public @RunningAppProcessInfo.Importance int getUidImportance(int uid) {
try {
int procState = getService().getUidProcessState(uid,
mContext.getOpPackageName());
@@ -3505,7 +3518,7 @@ public class ActivityManager {
* @param uid The uid whose importance has changed.
* @param importance The new importance value as per {@link RunningAppProcessInfo}.
*/
void onUidImportance(int uid, int importance);
void onUidImportance(int uid, @RunningAppProcessInfo.Importance int importance);
}
/**
@@ -3527,7 +3540,7 @@ public class ActivityManager {
*/
@SystemApi @TestApi
public void addOnUidImportanceListener(OnUidImportanceListener listener,
int importanceCutpoint) {
@RunningAppProcessInfo.Importance int importanceCutpoint) {
synchronized (this) {
if (mImportanceListeners.containsKey(listener)) {
throw new IllegalArgumentException("Listener already registered: " + listener);
@@ -4263,8 +4276,7 @@ public class ActivityManager {
/**
* Enable more aggressive scheduling for latency-sensitive low-runtime VR threads that persist
* beyond a single process. It requires holding the
* {@link android.Manifest.permission#RESTRICTED_VR_ACCESS} permission. Only one thread can be a
* beyond a single process. Only one thread can be a
* persistent VR thread at a time, and that thread may be subject to restrictions on the amount
* of time it can run. Calling this method will disable aggressive scheduling for non-persistent
* VR threads set via {@link #setVrThread}. If persistent VR mode is disabled then the

View File

@@ -169,9 +169,6 @@ public class KeyguardManager {
* Note: This call has no effect while any {@link android.app.admin.DevicePolicyManager}
* is enabled that requires a password.
*
* <p>This method requires the caller to hold the permission
* {@link android.Manifest.permission#DISABLE_KEYGUARD}.
*
* @see #reenableKeyguard()
*/
@RequiresPermission(Manifest.permission.DISABLE_KEYGUARD)
@@ -191,9 +188,6 @@ public class KeyguardManager {
* Note: This call has no effect while any {@link android.app.admin.DevicePolicyManager}
* is enabled that requires a password.
*
* <p>This method requires the caller to hold the permission
* {@link android.Manifest.permission#DISABLE_KEYGUARD}.
*
* @see #disableKeyguard()
*/
@RequiresPermission(Manifest.permission.DISABLE_KEYGUARD)
@@ -431,9 +425,6 @@ public class KeyguardManager {
* This will, if the keyguard is secure, bring up the unlock screen of
* the keyguard.
*
* <p>This method requires the caller to hold the permission
* {@link android.Manifest.permission#DISABLE_KEYGUARD}.
*
* @param callback Let's you know whether the operation was succesful and
* it is safe to launch anything that would normally be considered safe
* once the user has gotten past the keyguard.

View File

@@ -51,8 +51,6 @@ public class TrustManager {
* Changes the lock status for the given user. This is only applicable to Managed Profiles,
* other users should be handled by Keyguard.
*
* Requires the {@link android.Manifest.permission#ACCESS_KEYGUARD_SECURE_STORAGE} permission.
*
* @param userId The id for the user to be locked/unlocked.
* @param locked The value for that user's locked state.
*/

View File

@@ -422,8 +422,6 @@ public final class BluetoothA2dp implements BluetoothProfile {
* {@link #PRIORITY_AUTO_CONNECT}, {@link #PRIORITY_OFF},
* {@link #PRIORITY_ON}, {@link #PRIORITY_UNDEFINED}
*
* <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission.
*
* @param device Bluetooth device
* @return priority of the device
* @hide

View File

@@ -697,7 +697,6 @@ public final class BluetoothAdapter {
* Return true if Bluetooth is currently enabled and ready for use.
* <p>Equivalent to:
* <code>getBluetoothState() == STATE_ON</code>
* <p>Requires {@link android.Manifest.permission#BLUETOOTH}
*
* @return true if the local adapter is turned on
*/
@@ -835,7 +834,6 @@ public final class BluetoothAdapter {
* {@link #STATE_TURNING_ON},
* {@link #STATE_ON},
* {@link #STATE_TURNING_OFF}.
* <p>Requires {@link android.Manifest.permission#BLUETOOTH}
*
* @return current state of Bluetooth adapter
*/
@@ -878,7 +876,6 @@ public final class BluetoothAdapter {
* {@link #STATE_ON},
* {@link #STATE_TURNING_OFF},
* {@link #STATE_BLE_TURNING_OFF}.
* <p>Requires {@link android.Manifest.permission#BLUETOOTH}
*
* @return current state of Bluetooth adapter
* @hide
@@ -934,8 +931,6 @@ public final class BluetoothAdapter {
* #STATE_ON}. If this call returns false then there was an
* immediate problem that will prevent the adapter from being turned on -
* such as Airplane mode, or the adapter is already turned on.
* <p>Requires the {@link android.Manifest.permission#BLUETOOTH_ADMIN}
* permission
*
* @return true to indicate adapter startup has begun, or false on
* immediate error
@@ -970,8 +965,6 @@ public final class BluetoothAdapter {
* #STATE_ON}. If this call returns false then there was an
* immediate problem that will prevent the adapter from being turned off -
* such as the adapter already being turned off.
* <p>Requires the {@link android.Manifest.permission#BLUETOOTH_ADMIN}
* permission
*
* @return true to indicate adapter shutdown has begun, or false on
* immediate error
@@ -1005,7 +998,6 @@ public final class BluetoothAdapter {
/**
* Returns the hardware address of the local Bluetooth adapter.
* <p>For example, "00:11:22:AA:BB:CC".
* <p>Requires {@link android.Manifest.permission#BLUETOOTH}
*
* @return Bluetooth hardware address as string
*/
@@ -1109,7 +1101,6 @@ public final class BluetoothAdapter {
* will return false. After turning on Bluetooth,
* wait for {@link #ACTION_STATE_CHANGED} with {@link #STATE_ON}
* to get the updated value.
* <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN}
*
* @param name a valid Bluetooth name
* @return true if the name was set, false otherwise
@@ -1140,7 +1131,6 @@ public final class BluetoothAdapter {
* will return {@link #SCAN_MODE_NONE}. After turning on Bluetooth,
* wait for {@link #ACTION_STATE_CHANGED} with {@link #STATE_ON}
* to get the updated value.
* <p>Requires {@link android.Manifest.permission#BLUETOOTH}
*
* @return scan mode
*/
@@ -1279,7 +1269,6 @@ public final class BluetoothAdapter {
* will return false. After turning on Bluetooth,
* wait for {@link #ACTION_STATE_CHANGED} with {@link #STATE_ON}
* to get the updated value.
* <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN}.
*
* @return true on success, false on error
*/
@@ -1299,7 +1288,6 @@ public final class BluetoothAdapter {
/**
* Cancel the current device discovery process.
* <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN}.
* <p>Because discovery is a heavyweight procedure for the Bluetooth
* adapter, this method should always be called before attempting to connect
* to a remote device with {@link
@@ -1343,7 +1331,6 @@ public final class BluetoothAdapter {
* will return false. After turning on Bluetooth,
* wait for {@link #ACTION_STATE_CHANGED} with {@link #STATE_ON}
* to get the updated value.
* <p>Requires {@link android.Manifest.permission#BLUETOOTH}.
*
* @return true if discovering
*/
@@ -1610,7 +1597,6 @@ public final class BluetoothAdapter {
* will return an empty set. After turning on Bluetooth,
* wait for {@link #ACTION_STATE_CHANGED} with {@link #STATE_ON}
* to get the updated value.
* <p>Requires {@link android.Manifest.permission#BLUETOOTH}.
*
* @return unmodifiable set of {@link BluetoothDevice}, or null on error
*/
@@ -1695,8 +1681,6 @@ public final class BluetoothAdapter {
* Profile can be one of {@link BluetoothProfile#HEALTH}, {@link BluetoothProfile#HEADSET},
* {@link BluetoothProfile#A2DP}.
*
* <p>Requires {@link android.Manifest.permission#BLUETOOTH}.
*
* <p> Return value can be one of
* {@link BluetoothProfile#STATE_DISCONNECTED},
* {@link BluetoothProfile#STATE_CONNECTING},
@@ -1786,7 +1770,6 @@ public final class BluetoothAdapter {
* closed, or if this application closes unexpectedly.
* <p>Use {@link BluetoothDevice#createRfcommSocketToServiceRecord} to
* connect to this socket from another device using the same {@link UUID}.
* <p>Requires {@link android.Manifest.permission#BLUETOOTH}
* @param name service name for SDP record
* @param uuid uuid for SDP record
* @return a listening RFCOMM BluetoothServerSocket
@@ -1818,7 +1801,6 @@ public final class BluetoothAdapter {
* closed, or if this application closes unexpectedly.
* <p>Use {@link BluetoothDevice#createRfcommSocketToServiceRecord} to
* connect to this socket from another device using the same {@link UUID}.
* <p>Requires {@link android.Manifest.permission#BLUETOOTH}
* @param name service name for SDP record
* @param uuid uuid for SDP record
* @return a listening RFCOMM BluetoothServerSocket
@@ -2410,8 +2392,6 @@ public final class BluetoothAdapter {
* <p>Results of the scan are reported using the
* {@link LeScanCallback#onLeScan} callback.
*
* <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN} permission.
*
* @param callback the callback LE scan results are delivered
* @return true, if the scan was started successfully
* @deprecated use {@link BluetoothLeScanner#startScan(List, ScanSettings, ScanCallback)}
@@ -2430,8 +2410,6 @@ public final class BluetoothAdapter {
* <p>Devices which advertise all specified services are reported using the
* {@link LeScanCallback#onLeScan} callback.
*
* <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN} permission.
*
* @param serviceUuids Array of services to look for
* @param callback the callback LE scan results are delivered
* @return true, if the scan was started successfully
@@ -2519,8 +2497,6 @@ public final class BluetoothAdapter {
/**
* Stops an ongoing Bluetooth LE device scan.
*
* <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN} permission.
*
* @param callback used to identify which scan to stop
* must be the same handle used to start the scan
* @deprecated Use {@link BluetoothLeScanner#stopScan(ScanCallback)} instead.

View File

@@ -762,7 +762,6 @@ public final class BluetoothDevice implements Parcelable {
* <p>The local adapter will automatically retrieve remote names when
* performing a device scan, and will cache them. This method just returns
* the name for this device from the cache.
* <p>Requires {@link android.Manifest.permission#BLUETOOTH}
*
* @return the Bluetooth name, or null if there was a problem.
*/
@@ -781,8 +780,6 @@ public final class BluetoothDevice implements Parcelable {
/**
* Get the Bluetooth device type of the remote device.
*
* <p>Requires {@link android.Manifest.permission#BLUETOOTH}
*
* @return the device type {@link #DEVICE_TYPE_CLASSIC}, {@link #DEVICE_TYPE_LE}
* {@link #DEVICE_TYPE_DUAL}.
* {@link #DEVICE_TYPE_UNKNOWN} if it's not available
@@ -862,7 +859,6 @@ public final class BluetoothDevice implements Parcelable {
* the bonding process completes, and its result.
* <p>Android system services will handle the necessary user interactions
* to confirm and complete the bonding process.
* <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN}.
*
* @return false on immediate error, true if bonding will begin
*/
@@ -1022,7 +1018,6 @@ public final class BluetoothDevice implements Parcelable {
* {@link #BOND_NONE},
* {@link #BOND_BONDING},
* {@link #BOND_BONDED}.
* <p>Requires {@link android.Manifest.permission#BLUETOOTH}.
*
* @return the bond state
*/
@@ -1089,7 +1084,6 @@ public final class BluetoothDevice implements Parcelable {
/**
* Get the Bluetooth class of the remote device.
* <p>Requires {@link android.Manifest.permission#BLUETOOTH}.
*
* @return Bluetooth class object, or null on error
*/
@@ -1114,7 +1108,6 @@ public final class BluetoothDevice implements Parcelable {
* from the remote device. Instead, the local cached copy of the service
* UUIDs are returned.
* <p>Use {@link #fetchUuidsWithSdp} if fresh UUIDs are desired.
* <p>Requires {@link android.Manifest.permission#BLUETOOTH}.
*
* @return the supported features (UUIDs) of the remote device,
* or null on error
@@ -1140,7 +1133,6 @@ public final class BluetoothDevice implements Parcelable {
* {@link #ACTION_UUID} intent is sent with the UUIDs that is currently
* present in the cache. Clients should use the {@link #getUuids} to get UUIDs
* if service discovery is not to be performed.
* <p>Requires {@link android.Manifest.permission#BLUETOOTH}.
*
* @return False if the sanity check fails, True if the process
* of initiating an ACL connection to the remote device
@@ -1221,7 +1213,6 @@ public final class BluetoothDevice implements Parcelable {
/**
* Confirm passkey for {@link #PAIRING_VARIANT_PASSKEY_CONFIRMATION} pairing.
* <p>Requires {@link android.Manifest.permission#BLUETOOTH_PRIVILEGED}.
*
* @return true confirmation has been sent out
* false for error
@@ -1502,7 +1493,6 @@ public final class BluetoothDevice implements Parcelable {
* using the well-known SPP UUID 00001101-0000-1000-8000-00805F9B34FB.
* However if you are connecting to an Android peer then please generate
* your own unique UUID.
* <p>Requires {@link android.Manifest.permission#BLUETOOTH}
*
* @param uuid service record uuid to lookup RFCOMM channel
* @return a RFCOMM BluetoothServerSocket ready for an outgoing connection
@@ -1541,7 +1531,6 @@ public final class BluetoothDevice implements Parcelable {
* using the well-known SPP UUID 00001101-0000-1000-8000-00805F9B34FB.
* However if you are connecting to an Android peer then please generate
* your own unique UUID.
* <p>Requires {@link android.Manifest.permission#BLUETOOTH}
*
* @param uuid service record uuid to lookup RFCOMM channel
* @return a RFCOMM BluetoothServerSocket ready for an outgoing connection

View File

@@ -85,8 +85,6 @@ public final class BluetoothManager {
* This can be used by applications like status bar which would just like
* to know the state of Bluetooth.
*
* <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission.
*
* @param device Remote bluetooth device.
* @param profile GATT or GATT_SERVER
* @return State of the profile connection. One of
@@ -118,8 +116,6 @@ public final class BluetoothManager {
* This can be used by applications like status bar which would just like
* to know the state of Bluetooth.
*
* <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission.
*
* @param profile GATT or GATT_SERVER
* @return List of devices. The list will be empty on error.
*/
@@ -159,8 +155,6 @@ public final class BluetoothManager {
* This can be used by applications like status bar which would just like
* to know the state of the local adapter.
*
* <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission.
*
* @param profile GATT or GATT_SERVER
* @param states Array of states. States can be one of
* {@link BluetoothProfile#STATE_CONNECTED}, {@link BluetoothProfile#STATE_CONNECTING},

View File

@@ -187,8 +187,6 @@ public interface BluetoothProfile {
*
* <p> Return the set of devices which are in state {@link #STATE_CONNECTED}
*
* <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission.
*
* @return List of devices. The list will be empty on error.
*/
@RequiresPermission(Manifest.permission.BLUETOOTH)
@@ -201,8 +199,6 @@ public interface BluetoothProfile {
* <p> If none of the devices match any of the given states,
* an empty list will be returned.
*
* <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission.
*
* @param states Array of states. States can be one of
* {@link #STATE_CONNECTED}, {@link #STATE_CONNECTING},
* {@link #STATE_DISCONNECTED}, {@link #STATE_DISCONNECTING},
@@ -214,8 +210,6 @@ public interface BluetoothProfile {
/**
* Get the current connection state of the profile
*
* <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission.
*
* @param device Remote bluetooth device.
* @return State of the profile connection. One of
* {@link #STATE_CONNECTED}, {@link #STATE_CONNECTING},

View File

@@ -100,7 +100,6 @@ public final class BluetoothLeScanner {
* Start Bluetooth LE scan with default parameters and no filters. The scan results will be
* delivered through {@code callback}.
* <p>
* Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN} permission.
* An app must hold
* {@link android.Manifest.permission#ACCESS_COARSE_LOCATION ACCESS_COARSE_LOCATION} or
* {@link android.Manifest.permission#ACCESS_FINE_LOCATION ACCESS_FINE_LOCATION} permission
@@ -117,7 +116,6 @@ public final class BluetoothLeScanner {
/**
* Start Bluetooth LE scan. The scan results will be delivered through {@code callback}.
* <p>
* Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN} permission.
* An app must hold
* {@link android.Manifest.permission#ACCESS_COARSE_LOCATION ACCESS_COARSE_LOCATION} or
* {@link android.Manifest.permission#ACCESS_FINE_LOCATION ACCESS_FINE_LOCATION} permission
@@ -243,8 +241,6 @@ public final class BluetoothLeScanner {
/**
* Stops an ongoing Bluetooth LE scan.
* <p>
* Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN} permission.
*
* @param callback
*/
@@ -263,8 +259,6 @@ public final class BluetoothLeScanner {
/**
* Stops an ongoing Bluetooth LE scan started using a PendingIntent.
* <p>
* Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN} permission.
*
* @param callbackIntent The PendingIntent that was used to start the scan.
* @see #startScan(List, ScanSettings, PendingIntent)

View File

@@ -16,6 +16,11 @@
package android.content;
import android.annotation.IntDef;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* Extended {@link ComponentCallbacks} interface with a new callback for
* finer-grained memory management. This interface is available in all application components
@@ -83,6 +88,19 @@ package android.content;
*/
public interface ComponentCallbacks2 extends ComponentCallbacks {
/** @hide */
@IntDef(prefix = { "TRIM_MEMORY_" }, value = {
TRIM_MEMORY_COMPLETE,
TRIM_MEMORY_MODERATE,
TRIM_MEMORY_BACKGROUND,
TRIM_MEMORY_UI_HIDDEN,
TRIM_MEMORY_RUNNING_CRITICAL,
TRIM_MEMORY_RUNNING_LOW,
TRIM_MEMORY_RUNNING_MODERATE,
})
@Retention(RetentionPolicy.SOURCE)
public @interface TrimMemoryLevel {}
/**
* Level for {@link #onTrimMemory(int)}: the process is nearing the end
* of the background LRU list, and if more memory isn't found soon it will
@@ -132,7 +150,6 @@ public interface ComponentCallbacks2 extends ComponentCallbacks {
*/
static final int TRIM_MEMORY_RUNNING_LOW = 10;
/**
* Level for {@link #onTrimMemory(int)}: the process is not an expendable
* background process, but the device is running moderately low on memory.
@@ -155,11 +172,7 @@ public interface ComponentCallbacks2 extends ComponentCallbacks {
* ActivityManager.getMyMemoryState(RunningAppProcessInfo)}.
*
* @param level The context of the trim, giving a hint of the amount of
* trimming the application may like to perform. May be
* {@link #TRIM_MEMORY_COMPLETE}, {@link #TRIM_MEMORY_MODERATE},
* {@link #TRIM_MEMORY_BACKGROUND}, {@link #TRIM_MEMORY_UI_HIDDEN},
* {@link #TRIM_MEMORY_RUNNING_CRITICAL}, {@link #TRIM_MEMORY_RUNNING_LOW},
* or {@link #TRIM_MEMORY_RUNNING_MODERATE}.
* trimming the application may like to perform.
*/
void onTrimMemory(int level);
void onTrimMemory(@TrimMemoryLevel int level);
}

View File

@@ -1084,8 +1084,6 @@ public class PackageInstaller {
/**
* Sets which runtime permissions to be granted to the package at installation.
* Using this API requires holding {@link android.Manifest.permission
* #INSTALL_GRANT_RUNTIME_PERMISSIONS}
*
* @param permissions The permissions to grant or null to grant all runtime
* permissions.

View File

@@ -3535,8 +3535,7 @@ public abstract class PackageManager {
@ApplicationInfoFlags int flags, @UserIdInt int userId);
/**
* Gets the instant applications the user recently used. Requires
* holding "android.permission.ACCESS_INSTANT_APPS".
* Gets the instant applications the user recently used.
*
* @return The instant app list.
*

View File

@@ -115,8 +115,7 @@ public class Build {
public static final String SERIAL = getString("no.such.thing");
/**
* Gets the hardware serial, if available. Requires holding the {@link
* android.Manifest.permission#READ_PHONE_STATE} permission.
* Gets the hardware serial, if available.
* @return The serial if specified.
*/
@RequiresPermission(Manifest.permission.READ_PHONE_STATE)

View File

@@ -24,7 +24,7 @@ import android.annotation.IntRange;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.Size;
import android.annotation.SuppressAutoDoc;
import android.util.Half;
import com.android.internal.util.XmlUtils;
@@ -289,6 +289,7 @@ import java.util.function.DoubleUnaryOperator;
* and <code>(1.0, 0.0, 0.0, 0.5)</code>.</p>
*/
@AnyThread
@SuppressAutoDoc
public class Color {
@ColorInt public static final int BLACK = 0xFF000000;
@ColorInt public static final int DKGRAY = 0xFF444444;

View File

@@ -22,6 +22,7 @@ import android.annotation.IntRange;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.Size;
import android.annotation.SuppressAutoDoc;
import android.util.Pair;
import java.util.ArrayList;
@@ -131,6 +132,7 @@ import java.util.function.DoubleUnaryOperator;
*/
@AnyThread
@SuppressWarnings("StaticInitializerReferencesSubClass")
@SuppressAutoDoc
public abstract class ColorSpace {
/**
* Standard CIE 1931 2° illuminant A, encoded in xyY.

View File

@@ -95,9 +95,6 @@ public abstract class AttestationUtils {
* For privacy reasons, you cannot distinguish between (1) and (2). If attestation is
* unsuccessful, the device may not support it in general or the user may have permanently
* disabled it.
* <p>
* The caller must hold {@link android.Manifest.permission#READ_PRIVILEGED_PHONE_STATE}
* permission.
*
* @param context the context to use for retrieving device identifiers.
* @param idTypes the types of device identifiers to attest.

View File

@@ -16,6 +16,7 @@ package android.telecom;
import android.Manifest;
import android.annotation.RequiresPermission;
import android.annotation.SuppressAutoDoc;
import android.annotation.SystemApi;
import android.content.ComponentName;
import android.content.Context;
@@ -46,6 +47,7 @@ import java.util.List;
* permissions declared in its manifest file. Where permissions apply, they are noted in the method
* descriptions.
*/
@SuppressAutoDoc
public class TelecomManager {
/**