Merge "Auto-generate docs based on annotations." into oc-dev
am: 9ea4b33f2a
Change-Id: Ic81a77a4fc3bb3638b8b53037c58efc9b26bbb7a
This commit is contained in:
36
core/java/android/annotation/BytesLong.java
Normal file
36
core/java/android/annotation/BytesLong.java
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (C) 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.annotation;
|
||||
|
||||
import static java.lang.annotation.ElementType.FIELD;
|
||||
import static java.lang.annotation.ElementType.METHOD;
|
||||
import static java.lang.annotation.ElementType.PARAMETER;
|
||||
import static java.lang.annotation.RetentionPolicy.SOURCE;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* @memberDoc Value is a non-negative number of bytes.
|
||||
* @paramDoc Value is a non-negative number of bytes.
|
||||
* @returnDoc Value is a non-negative number of bytes.
|
||||
* @hide
|
||||
*/
|
||||
@Retention(SOURCE)
|
||||
@Target({METHOD, PARAMETER, FIELD})
|
||||
public @interface BytesLong {
|
||||
}
|
||||
39
core/java/android/annotation/CurrentTimeMillisLong.java
Normal file
39
core/java/android/annotation/CurrentTimeMillisLong.java
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright (C) 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.annotation;
|
||||
|
||||
import static java.lang.annotation.ElementType.FIELD;
|
||||
import static java.lang.annotation.ElementType.METHOD;
|
||||
import static java.lang.annotation.ElementType.PARAMETER;
|
||||
import static java.lang.annotation.RetentionPolicy.SOURCE;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* @memberDoc Value is a non-negative timestamp in the
|
||||
* {@link System#currentTimeMillis()} time base.
|
||||
* @paramDoc Value is a non-negative timestamp in the
|
||||
* {@link System#currentTimeMillis()} time base.
|
||||
* @returnDoc Value is a non-negative timestamp in the
|
||||
* {@link System#currentTimeMillis()} time base.
|
||||
* @hide
|
||||
*/
|
||||
@Retention(SOURCE)
|
||||
@Target({METHOD, PARAMETER, FIELD})
|
||||
public @interface CurrentTimeMillisLong {
|
||||
}
|
||||
36
core/java/android/annotation/DurationMillisLong.java
Normal file
36
core/java/android/annotation/DurationMillisLong.java
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (C) 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.annotation;
|
||||
|
||||
import static java.lang.annotation.ElementType.FIELD;
|
||||
import static java.lang.annotation.ElementType.METHOD;
|
||||
import static java.lang.annotation.ElementType.PARAMETER;
|
||||
import static java.lang.annotation.RetentionPolicy.SOURCE;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* @memberDoc Value is a non-negative duration in milliseconds.
|
||||
* @paramDoc Value is a non-negative duration in milliseconds.
|
||||
* @returnDoc Value is a non-negative duration in milliseconds.
|
||||
* @hide
|
||||
*/
|
||||
@Retention(SOURCE)
|
||||
@Target({METHOD, PARAMETER, FIELD})
|
||||
public @interface DurationMillisLong {
|
||||
}
|
||||
41
core/java/android/annotation/ElapsedRealtimeLong.java
Normal file
41
core/java/android/annotation/ElapsedRealtimeLong.java
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright (C) 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.annotation;
|
||||
|
||||
import static java.lang.annotation.ElementType.FIELD;
|
||||
import static java.lang.annotation.ElementType.METHOD;
|
||||
import static java.lang.annotation.ElementType.PARAMETER;
|
||||
import static java.lang.annotation.RetentionPolicy.SOURCE;
|
||||
|
||||
import android.os.SystemClock;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* @memberDoc Value is a non-negative timestamp in the
|
||||
* {@link SystemClock#elapsedRealtime()} time base.
|
||||
* @paramDoc Value is a non-negative timestamp in the
|
||||
* {@link SystemClock#elapsedRealtime()} time base.
|
||||
* @returnDoc Value is a non-negative timestamp in the
|
||||
* {@link SystemClock#elapsedRealtime()} time base.
|
||||
* @hide
|
||||
*/
|
||||
@Retention(SOURCE)
|
||||
@Target({METHOD, PARAMETER, FIELD})
|
||||
public @interface ElapsedRealtimeLong {
|
||||
}
|
||||
@@ -51,6 +51,9 @@ import static java.lang.annotation.RetentionPolicy.CLASS;
|
||||
@Retention(CLASS)
|
||||
@Target({ANNOTATION_TYPE})
|
||||
public @interface IntDef {
|
||||
/** Defines the constant prefix for this element */
|
||||
String[] prefix() default "";
|
||||
|
||||
/** Defines the allowed constants for this element */
|
||||
long[] value() default {};
|
||||
|
||||
|
||||
@@ -23,20 +23,27 @@ 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;
|
||||
|
||||
/**
|
||||
* 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 called
|
||||
* on the main thread.
|
||||
* If the annotated element is a class, then all methods in the class should be
|
||||
* called on the main thread.
|
||||
* <p>
|
||||
* Example:
|
||||
* <pre><code>
|
||||
*
|
||||
* <pre>
|
||||
* <code>
|
||||
* @MainThread
|
||||
* public void deliverResult(D data) { ... }
|
||||
* </code></pre>
|
||||
* </code>
|
||||
* </pre>
|
||||
*
|
||||
* {@hide}
|
||||
* @memberDoc This method must be called from the
|
||||
* {@linkplain Looper#getMainLooper() main thread} of your app.
|
||||
* @hide
|
||||
*/
|
||||
@Retention(SOURCE)
|
||||
@Target({METHOD,CONSTRUCTOR,TYPE})
|
||||
public @interface MainThread {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,8 @@ import static java.lang.annotation.RetentionPolicy.SOURCE;
|
||||
* <p>
|
||||
* This is a marker annotation and it has no specific attributes.
|
||||
*
|
||||
* @paramDoc This value must never be {@code null}.
|
||||
* @returnDoc This value will never be {@code null}.
|
||||
* @hide
|
||||
*/
|
||||
@Retention(SOURCE)
|
||||
|
||||
@@ -35,6 +35,8 @@ import static java.lang.annotation.RetentionPolicy.SOURCE;
|
||||
* <p>
|
||||
* This is a marker annotation and it has no specific attributes.
|
||||
*
|
||||
* @paramDoc This value may be {@code null}.
|
||||
* @returnDoc This value may be {@code null}.
|
||||
* @hide
|
||||
*/
|
||||
@Retention(SOURCE)
|
||||
|
||||
36
core/java/android/annotation/SuppressAutoDoc.java
Normal file
36
core/java/android/annotation/SuppressAutoDoc.java
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (C) 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.annotation;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import static java.lang.annotation.ElementType.FIELD;
|
||||
import static java.lang.annotation.ElementType.METHOD;
|
||||
import static java.lang.annotation.ElementType.PARAMETER;
|
||||
import static java.lang.annotation.RetentionPolicy.SOURCE;
|
||||
|
||||
/**
|
||||
* Denotes that any automatically generated documentation should be suppressed
|
||||
* for the annotated method, parameter, or field.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@Retention(SOURCE)
|
||||
@Target({METHOD, PARAMETER, FIELD})
|
||||
public @interface SuppressAutoDoc {
|
||||
}
|
||||
@@ -25,18 +25,23 @@ import static java.lang.annotation.RetentionPolicy.SOURCE;
|
||||
|
||||
/**
|
||||
* Denotes that the annotated method should only be called on a worker thread.
|
||||
* If the annotated element is a class, then all methods in the class should be called
|
||||
* on a worker thread.
|
||||
* If the annotated element is a class, then all methods in the class should be
|
||||
* called on a worker thread.
|
||||
* <p>
|
||||
* Example:
|
||||
* <pre><code>
|
||||
*
|
||||
* <pre>
|
||||
* <code>
|
||||
* @WorkerThread
|
||||
* protected abstract FilterResults performFiltering(CharSequence constraint);
|
||||
* </code></pre>
|
||||
* </code>
|
||||
* </pre>
|
||||
*
|
||||
* {@hide}
|
||||
* @memberDoc This method may take several seconds to complete, so it should
|
||||
* only be called from a worker thread.
|
||||
* @hide
|
||||
*/
|
||||
@Retention(SOURCE)
|
||||
@Target({METHOD,CONSTRUCTOR,TYPE})
|
||||
public @interface WorkerThread {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2720,12 +2720,13 @@ public class Activity extends ContextThemeWrapper
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@IntDef({
|
||||
@IntDef(prefix = { "DEFAULT_KEYS_" }, value = {
|
||||
DEFAULT_KEYS_DISABLE,
|
||||
DEFAULT_KEYS_DIALER,
|
||||
DEFAULT_KEYS_SHORTCUT,
|
||||
DEFAULT_KEYS_SEARCH_LOCAL,
|
||||
DEFAULT_KEYS_SEARCH_GLOBAL})
|
||||
DEFAULT_KEYS_SEARCH_GLOBAL
|
||||
})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@interface DefaultKeyMode {}
|
||||
|
||||
@@ -2791,11 +2792,6 @@ public class Activity extends ContextThemeWrapper
|
||||
*
|
||||
* @param mode The desired default key mode constant.
|
||||
*
|
||||
* @see #DEFAULT_KEYS_DISABLE
|
||||
* @see #DEFAULT_KEYS_DIALER
|
||||
* @see #DEFAULT_KEYS_SHORTCUT
|
||||
* @see #DEFAULT_KEYS_SEARCH_LOCAL
|
||||
* @see #DEFAULT_KEYS_SEARCH_GLOBAL
|
||||
* @see #onKeyDown
|
||||
*/
|
||||
public final void setDefaultKeyMode(@DefaultKeyMode int mode) {
|
||||
|
||||
@@ -21,6 +21,7 @@ import org.xmlpull.v1.XmlPullParser;
|
||||
import org.xmlpull.v1.XmlSerializer;
|
||||
|
||||
import android.annotation.SystemApi;
|
||||
import android.app.NotificationManager.Importance;
|
||||
import android.content.Intent;
|
||||
import android.media.AudioAttributes;
|
||||
import android.net.Uri;
|
||||
@@ -389,16 +390,14 @@ public final class NotificationChannel implements Parcelable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the level of interruption of this notification channel.
|
||||
*
|
||||
* Only modifiable before the channel is submitted to
|
||||
* Sets the level of interruption of this notification channel. Only
|
||||
* modifiable before the channel is submitted to
|
||||
* {@link NotificationManager#notify(String, int, Notification)}.
|
||||
*
|
||||
* @param importance the amount the user should be interrupted by notifications from this
|
||||
* channel. See e.g.
|
||||
* {@link android.app.NotificationManager#IMPORTANCE_DEFAULT}.
|
||||
* @param importance the amount the user should be interrupted by
|
||||
* notifications from this channel.
|
||||
*/
|
||||
public void setImportance(int importance) {
|
||||
public void setImportance(@Importance int importance) {
|
||||
this.mImportance = importance;
|
||||
}
|
||||
|
||||
|
||||
@@ -145,8 +145,10 @@ public class NotificationManager
|
||||
= "android.app.action.INTERRUPTION_FILTER_CHANGED_INTERNAL";
|
||||
|
||||
/** @hide */
|
||||
@IntDef({INTERRUPTION_FILTER_NONE, INTERRUPTION_FILTER_PRIORITY, INTERRUPTION_FILTER_ALARMS,
|
||||
INTERRUPTION_FILTER_ALL, INTERRUPTION_FILTER_UNKNOWN})
|
||||
@IntDef(prefix = { "INTERRUPTION_FILTER_" }, value = {
|
||||
INTERRUPTION_FILTER_NONE, INTERRUPTION_FILTER_PRIORITY, INTERRUPTION_FILTER_ALARMS,
|
||||
INTERRUPTION_FILTER_ALL, INTERRUPTION_FILTER_UNKNOWN
|
||||
})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface InterruptionFilter {}
|
||||
|
||||
@@ -186,8 +188,10 @@ public class NotificationManager
|
||||
public static final int INTERRUPTION_FILTER_UNKNOWN = 0;
|
||||
|
||||
/** @hide */
|
||||
@IntDef({IMPORTANCE_UNSPECIFIED, IMPORTANCE_NONE,
|
||||
IMPORTANCE_MIN, IMPORTANCE_LOW, IMPORTANCE_DEFAULT, IMPORTANCE_HIGH})
|
||||
@IntDef(prefix = { "IMPORTANCE_" }, value = {
|
||||
IMPORTANCE_UNSPECIFIED, IMPORTANCE_NONE,
|
||||
IMPORTANCE_MIN, IMPORTANCE_LOW, IMPORTANCE_DEFAULT, IMPORTANCE_HIGH
|
||||
})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface Importance {}
|
||||
|
||||
@@ -717,9 +721,8 @@ public class NotificationManager
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the user specified importance for notifications from the calling package.
|
||||
*
|
||||
* @return An importance level, such as {@link #IMPORTANCE_DEFAULT}.
|
||||
* Returns the user specified importance for notifications from the calling
|
||||
* package.
|
||||
*/
|
||||
public @Importance int getImportance() {
|
||||
INotificationManager service = getService();
|
||||
@@ -1095,12 +1098,10 @@ public class NotificationManager
|
||||
|
||||
/**
|
||||
* Gets the current notification interruption filter.
|
||||
*
|
||||
* <p>
|
||||
* The interruption filter defines which notifications are allowed to interrupt the user
|
||||
* (e.g. via sound & vibration) and is applied globally.
|
||||
* @return One of the INTERRUPTION_FILTER_ constants, or INTERRUPTION_FILTER_UNKNOWN when
|
||||
* unavailable.
|
||||
* The interruption filter defines which notifications are allowed to
|
||||
* interrupt the user (e.g. via sound & vibration) and is applied
|
||||
* globally.
|
||||
*/
|
||||
public final @InterruptionFilter int getCurrentInterruptionFilter() {
|
||||
final INotificationManager service = getService();
|
||||
@@ -1113,18 +1114,15 @@ public class NotificationManager
|
||||
|
||||
/**
|
||||
* Sets the current notification interruption filter.
|
||||
*
|
||||
* <p>
|
||||
* The interruption filter defines which notifications are allowed to interrupt the user
|
||||
* (e.g. via sound & vibration) and is applied globally.
|
||||
* @return One of the INTERRUPTION_FILTER_ constants, or INTERRUPTION_FILTER_UNKNOWN when
|
||||
* unavailable.
|
||||
*
|
||||
* The interruption filter defines which notifications are allowed to
|
||||
* interrupt the user (e.g. via sound & vibration) and is applied
|
||||
* globally.
|
||||
* <p>
|
||||
* Only available if policy access is granted to this package.
|
||||
* See {@link #isNotificationPolicyAccessGranted}.
|
||||
* Only available if policy access is granted to this package. See
|
||||
* {@link #isNotificationPolicyAccessGranted}.
|
||||
*/
|
||||
public final void setInterruptionFilter(int interruptionFilter) {
|
||||
public final void setInterruptionFilter(@InterruptionFilter int interruptionFilter) {
|
||||
final INotificationManager service = getService();
|
||||
try {
|
||||
service.setInterruptionFilter(mContext.getOpPackageName(), interruptionFilter);
|
||||
|
||||
@@ -321,11 +321,10 @@ public abstract class Service extends ContextWrapper implements ComponentCallbac
|
||||
public static final int STOP_FOREGROUND_DETACH = 1<<1;
|
||||
|
||||
/** @hide */
|
||||
@IntDef(flag = true,
|
||||
value = {
|
||||
STOP_FOREGROUND_REMOVE,
|
||||
STOP_FOREGROUND_DETACH
|
||||
})
|
||||
@IntDef(flag = true, prefix = { "STOP_FOREGROUND_" }, value = {
|
||||
STOP_FOREGROUND_REMOVE,
|
||||
STOP_FOREGROUND_DETACH
|
||||
})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface StopForegroundFlags {}
|
||||
|
||||
@@ -423,13 +422,12 @@ public abstract class Service extends ContextWrapper implements ComponentCallbac
|
||||
public static final int START_REDELIVER_INTENT = 3;
|
||||
|
||||
/** @hide */
|
||||
@IntDef(flag = false,
|
||||
value = {
|
||||
START_STICKY_COMPATIBILITY,
|
||||
START_STICKY,
|
||||
START_NOT_STICKY,
|
||||
START_REDELIVER_INTENT,
|
||||
})
|
||||
@IntDef(flag = false, prefix = { "START_" }, value = {
|
||||
START_STICKY_COMPATIBILITY,
|
||||
START_STICKY,
|
||||
START_NOT_STICKY,
|
||||
START_REDELIVER_INTENT,
|
||||
})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface StartResult {}
|
||||
|
||||
@@ -456,11 +454,10 @@ public abstract class Service extends ContextWrapper implements ComponentCallbac
|
||||
public static final int START_FLAG_RETRY = 0x0002;
|
||||
|
||||
/** @hide */
|
||||
@IntDef(flag = true,
|
||||
value = {
|
||||
START_FLAG_REDELIVERY,
|
||||
START_FLAG_RETRY,
|
||||
})
|
||||
@IntDef(flag = true, prefix = { "START_FLAG_" }, value = {
|
||||
START_FLAG_REDELIVERY,
|
||||
START_FLAG_RETRY,
|
||||
})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface StartArgFlags {}
|
||||
|
||||
@@ -494,8 +491,7 @@ public abstract class Service extends ContextWrapper implements ComponentCallbac
|
||||
* as given. This may be null if the service is being restarted after
|
||||
* its process has gone away, and it had previously returned anything
|
||||
* except {@link #START_STICKY_COMPATIBILITY}.
|
||||
* @param flags Additional data about this start request. Currently either
|
||||
* 0, {@link #START_FLAG_REDELIVERY}, or {@link #START_FLAG_RETRY}.
|
||||
* @param flags Additional data about this start request.
|
||||
* @param startId A unique integer representing this specific request to
|
||||
* start. Use with {@link #stopSelfResult(int)}.
|
||||
*
|
||||
@@ -721,8 +717,8 @@ public abstract class Service extends ContextWrapper implements ComponentCallbac
|
||||
/**
|
||||
* Remove this service from foreground state, allowing it to be killed if
|
||||
* more memory is needed.
|
||||
* @param flags Additional behavior options: {@link #STOP_FOREGROUND_REMOVE},
|
||||
* {@link #STOP_FOREGROUND_DETACH}.
|
||||
*
|
||||
* @param flags additional behavior options.
|
||||
* @see #startForeground(int, Notification)
|
||||
*/
|
||||
public final void stopForeground(@StopForegroundFlags int flags) {
|
||||
|
||||
@@ -4100,15 +4100,7 @@ public abstract class Context {
|
||||
*
|
||||
* @param toPackage The package you would like to allow to access the Uri.
|
||||
* @param uri The Uri you would like to grant access to.
|
||||
* @param modeFlags The desired access modes. Any combination of
|
||||
* {@link Intent#FLAG_GRANT_READ_URI_PERMISSION
|
||||
* Intent.FLAG_GRANT_READ_URI_PERMISSION},
|
||||
* {@link Intent#FLAG_GRANT_WRITE_URI_PERMISSION
|
||||
* Intent.FLAG_GRANT_WRITE_URI_PERMISSION},
|
||||
* {@link Intent#FLAG_GRANT_PERSISTABLE_URI_PERMISSION
|
||||
* Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION}, or
|
||||
* {@link Intent#FLAG_GRANT_PREFIX_URI_PERMISSION
|
||||
* Intent.FLAG_GRANT_PREFIX_URI_PERMISSION}.
|
||||
* @param modeFlags The desired access modes.
|
||||
*
|
||||
* @see #revokeUriPermission
|
||||
*/
|
||||
@@ -4139,11 +4131,7 @@ public abstract class Context {
|
||||
* revoke grants that another app could be strongly expecting to stick around.</p>
|
||||
*
|
||||
* @param uri The Uri you would like to revoke access to.
|
||||
* @param modeFlags The desired access modes. Any combination of
|
||||
* {@link Intent#FLAG_GRANT_READ_URI_PERMISSION
|
||||
* Intent.FLAG_GRANT_READ_URI_PERMISSION} or
|
||||
* {@link Intent#FLAG_GRANT_WRITE_URI_PERMISSION
|
||||
* Intent.FLAG_GRANT_WRITE_URI_PERMISSION}.
|
||||
* @param modeFlags The access modes to revoke.
|
||||
*
|
||||
* @see #grantUriPermission
|
||||
*/
|
||||
@@ -4166,11 +4154,7 @@ public abstract class Context {
|
||||
*
|
||||
* @param toPackage The package you had previously granted access to.
|
||||
* @param uri The Uri you would like to revoke access to.
|
||||
* @param modeFlags The desired access modes. Any combination of
|
||||
* {@link Intent#FLAG_GRANT_READ_URI_PERMISSION
|
||||
* Intent.FLAG_GRANT_READ_URI_PERMISSION} or
|
||||
* {@link Intent#FLAG_GRANT_WRITE_URI_PERMISSION
|
||||
* Intent.FLAG_GRANT_WRITE_URI_PERMISSION}.
|
||||
* @param modeFlags The access modes to revoke.
|
||||
*
|
||||
* @see #grantUriPermission
|
||||
*/
|
||||
@@ -4188,9 +4172,7 @@ public abstract class Context {
|
||||
* @param pid The process ID being checked against. Must be > 0.
|
||||
* @param uid The user ID being checked against. A uid of 0 is the root
|
||||
* user, which will pass every permission check.
|
||||
* @param modeFlags The type of access to grant. May be one or both of
|
||||
* {@link Intent#FLAG_GRANT_READ_URI_PERMISSION Intent.FLAG_GRANT_READ_URI_PERMISSION} or
|
||||
* {@link Intent#FLAG_GRANT_WRITE_URI_PERMISSION Intent.FLAG_GRANT_WRITE_URI_PERMISSION}.
|
||||
* @param modeFlags The access modes to check.
|
||||
*
|
||||
* @return {@link PackageManager#PERMISSION_GRANTED} if the given
|
||||
* pid/uid is allowed to access that uri, or
|
||||
@@ -4217,9 +4199,7 @@ public abstract class Context {
|
||||
* will always fail.
|
||||
*
|
||||
* @param uri The uri that is being checked.
|
||||
* @param modeFlags The type of access to grant. May be one or both of
|
||||
* {@link Intent#FLAG_GRANT_READ_URI_PERMISSION Intent.FLAG_GRANT_READ_URI_PERMISSION} or
|
||||
* {@link Intent#FLAG_GRANT_WRITE_URI_PERMISSION Intent.FLAG_GRANT_WRITE_URI_PERMISSION}.
|
||||
* @param modeFlags The access modes to check.
|
||||
*
|
||||
* @return {@link PackageManager#PERMISSION_GRANTED} if the caller
|
||||
* is allowed to access that uri, or
|
||||
@@ -4237,9 +4217,7 @@ public abstract class Context {
|
||||
* if you are not currently processing an IPC. Use with care!
|
||||
*
|
||||
* @param uri The uri that is being checked.
|
||||
* @param modeFlags The type of access to grant. May be one or both of
|
||||
* {@link Intent#FLAG_GRANT_READ_URI_PERMISSION Intent.FLAG_GRANT_READ_URI_PERMISSION} or
|
||||
* {@link Intent#FLAG_GRANT_WRITE_URI_PERMISSION Intent.FLAG_GRANT_WRITE_URI_PERMISSION}.
|
||||
* @param modeFlags The access modes to check.
|
||||
*
|
||||
* @return {@link PackageManager#PERMISSION_GRANTED} if the caller
|
||||
* is allowed to access that uri, or
|
||||
@@ -4265,9 +4243,7 @@ public abstract class Context {
|
||||
* @param pid The process ID being checked against. Must be > 0.
|
||||
* @param uid The user ID being checked against. A uid of 0 is the root
|
||||
* user, which will pass every permission check.
|
||||
* @param modeFlags The type of access to grant. May be one or both of
|
||||
* {@link Intent#FLAG_GRANT_READ_URI_PERMISSION Intent.FLAG_GRANT_READ_URI_PERMISSION} or
|
||||
* {@link Intent#FLAG_GRANT_WRITE_URI_PERMISSION Intent.FLAG_GRANT_WRITE_URI_PERMISSION}.
|
||||
* @param modeFlags The access modes to check.
|
||||
*
|
||||
* @return {@link PackageManager#PERMISSION_GRANTED} if the caller
|
||||
* is allowed to access that uri or holds one of the given permissions, or
|
||||
@@ -4290,9 +4266,7 @@ public abstract class Context {
|
||||
* @param pid The process ID being checked against. Must be > 0.
|
||||
* @param uid The user ID being checked against. A uid of 0 is the root
|
||||
* user, which will pass every permission check.
|
||||
* @param modeFlags The type of access to grant. May be one or both of
|
||||
* {@link Intent#FLAG_GRANT_READ_URI_PERMISSION Intent.FLAG_GRANT_READ_URI_PERMISSION} or
|
||||
* {@link Intent#FLAG_GRANT_WRITE_URI_PERMISSION Intent.FLAG_GRANT_WRITE_URI_PERMISSION}.
|
||||
* @param modeFlags The access modes to enforce.
|
||||
* @param message A message to include in the exception if it is thrown.
|
||||
*
|
||||
* @see #checkUriPermission(Uri, int, int, int)
|
||||
@@ -4312,9 +4286,7 @@ public abstract class Context {
|
||||
* will always throw a SecurityException.
|
||||
*
|
||||
* @param uri The uri that is being checked.
|
||||
* @param modeFlags The type of access to grant. May be one or both of
|
||||
* {@link Intent#FLAG_GRANT_READ_URI_PERMISSION Intent.FLAG_GRANT_READ_URI_PERMISSION} or
|
||||
* {@link Intent#FLAG_GRANT_WRITE_URI_PERMISSION Intent.FLAG_GRANT_WRITE_URI_PERMISSION}.
|
||||
* @param modeFlags The access modes to enforce.
|
||||
* @param message A message to include in the exception if it is thrown.
|
||||
*
|
||||
* @see #checkCallingUriPermission(Uri, int)
|
||||
@@ -4331,9 +4303,7 @@ public abstract class Context {
|
||||
* with care!
|
||||
*
|
||||
* @param uri The uri that is being checked.
|
||||
* @param modeFlags The type of access to grant. May be one or both of
|
||||
* {@link Intent#FLAG_GRANT_READ_URI_PERMISSION Intent.FLAG_GRANT_READ_URI_PERMISSION} or
|
||||
* {@link Intent#FLAG_GRANT_WRITE_URI_PERMISSION Intent.FLAG_GRANT_WRITE_URI_PERMISSION}.
|
||||
* @param modeFlags The access modes to enforce.
|
||||
* @param message A message to include in the exception if it is thrown.
|
||||
*
|
||||
* @see #checkCallingOrSelfUriPermission(Uri, int)
|
||||
@@ -4355,9 +4325,7 @@ public abstract class Context {
|
||||
* @param pid The process ID being checked against. Must be > 0.
|
||||
* @param uid The user ID being checked against. A uid of 0 is the root
|
||||
* user, which will pass every permission check.
|
||||
* @param modeFlags The type of access to grant. May be one or both of
|
||||
* {@link Intent#FLAG_GRANT_READ_URI_PERMISSION Intent.FLAG_GRANT_READ_URI_PERMISSION} or
|
||||
* {@link Intent#FLAG_GRANT_WRITE_URI_PERMISSION Intent.FLAG_GRANT_WRITE_URI_PERMISSION}.
|
||||
* @param modeFlags The access modes to enforce.
|
||||
* @param message A message to include in the exception if it is thrown.
|
||||
*
|
||||
* @see #checkUriPermission(Uri, String, String, int, int, int)
|
||||
|
||||
@@ -4880,14 +4880,14 @@ public class Intent implements Parcelable, Cloneable {
|
||||
// Intent flags (see mFlags variable).
|
||||
|
||||
/** @hide */
|
||||
@IntDef(flag = true, value = {
|
||||
@IntDef(flag = true, prefix = { "FLAG_GRANT_" }, value = {
|
||||
FLAG_GRANT_READ_URI_PERMISSION, FLAG_GRANT_WRITE_URI_PERMISSION,
|
||||
FLAG_GRANT_PERSISTABLE_URI_PERMISSION, FLAG_GRANT_PREFIX_URI_PERMISSION })
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface GrantUriMode {}
|
||||
|
||||
/** @hide */
|
||||
@IntDef(flag = true, value = {
|
||||
@IntDef(flag = true, prefix = { "FLAG_GRANT_" }, value = {
|
||||
FLAG_GRANT_READ_URI_PERMISSION, FLAG_GRANT_WRITE_URI_PERMISSION })
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface AccessUriMode {}
|
||||
|
||||
Reference in New Issue
Block a user