summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorXin Li <delphij@google.com>2019-05-09 22:05:45 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-05-09 22:05:45 +0000
commit5bc12066ca932ad7a69bc992bedb2632d05abd3d (patch)
tree612c21febaabbf6c90a8e85ca1ad3fd4fd2ff385 /core/java
parentf84cf464e97cc2060c30a0e687e4fe237bbc742f (diff)
parent6d7d3f2042fb4dcc20afe88ed4bb3e57364b4147 (diff)
Merge "DO NOT MERGE - Merge Pie Bonito/Sargo into master."
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/app/Activity.java2
-rw-r--r--core/java/android/app/RemoteInput.java2
-rw-r--r--core/java/android/app/backup/OWNERS6
-rw-r--r--core/java/android/app/slice/Slice.java16
-rw-r--r--core/java/android/app/slice/SliceProvider.java2
-rw-r--r--core/java/android/content/ContentProvider.java12
-rw-r--r--core/java/android/database/sqlite/SQLiteQueryBuilder.java18
-rw-r--r--core/java/android/os/UserManager.java12
-rw-r--r--core/java/android/text/style/ImageSpan.java3
-rw-r--r--core/java/android/webkit/WebResourceResponse.java23
-rw-r--r--core/java/android/webkit/WebView.java2
-rw-r--r--core/java/com/android/internal/app/AssistUtils.java17
12 files changed, 54 insertions, 61 deletions
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index 5f99d6a0d098..2db7979a2a12 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -2188,7 +2188,7 @@ public class Activity extends ContextThemeWrapper
* picture-in-picture.
*
* @return true if the system successfully put this activity into picture-in-picture mode or was
- * already in picture-in-picture mode (@see {@link #isInPictureInPictureMode()). If the device
+ * already in picture-in-picture mode (see {@link #isInPictureInPictureMode()}). If the device
* does not support picture-in-picture, return false.
*/
public boolean enterPictureInPictureMode(@NonNull PictureInPictureParams params) {
diff --git a/core/java/android/app/RemoteInput.java b/core/java/android/app/RemoteInput.java
index 85fe99d95969..b1c71209948d 100644
--- a/core/java/android/app/RemoteInput.java
+++ b/core/java/android/app/RemoteInput.java
@@ -149,7 +149,7 @@ public final class RemoteInput implements Parcelable {
/**
* Returns true if the input only accepts data, meaning {@link #getAllowFreeFormInput}
- * is false, {@link #getChoices} is null or empty, and {@link #getAllowedDataTypes is
+ * is false, {@link #getChoices} is null or empty, and {@link #getAllowedDataTypes} is
* non-null and not empty.
*/
public boolean isDataOnly() {
diff --git a/core/java/android/app/backup/OWNERS b/core/java/android/app/backup/OWNERS
index 9c21e8fe5e45..1c9a43acfa65 100644
--- a/core/java/android/app/backup/OWNERS
+++ b/core/java/android/app/backup/OWNERS
@@ -1,9 +1,7 @@
-alsutton@google.com
-anniemeng@google.com
+artikz@google.com
brufino@google.com
bryanmawhinney@google.com
ctate@google.com
jorlow@google.com
-nathch@google.com
-rthakohov@google.com
+mkarpinski@google.com
diff --git a/core/java/android/app/slice/Slice.java b/core/java/android/app/slice/Slice.java
index e54d3b64f780..d1aec048bdf1 100644
--- a/core/java/android/app/slice/Slice.java
+++ b/core/java/android/app/slice/Slice.java
@@ -425,7 +425,7 @@ public final class Slice implements Parcelable {
/**
* Add a sub-slice to the slice being constructed
* @param subType Optional template-specific type information
- * @see {@link SliceItem#getSubType()}
+ * @see SliceItem#getSubType()
*/
public Builder addSubSlice(@NonNull Slice slice, @Nullable @SliceSubtype String subType) {
Preconditions.checkNotNull(slice);
@@ -437,7 +437,7 @@ public final class Slice implements Parcelable {
/**
* Add an action to the slice being constructed
* @param subType Optional template-specific type information
- * @see {@link SliceItem#getSubType()}
+ * @see SliceItem#getSubType()
*/
public Slice.Builder addAction(@NonNull PendingIntent action, @NonNull Slice s,
@Nullable @SliceSubtype String subType) {
@@ -453,7 +453,7 @@ public final class Slice implements Parcelable {
/**
* Add text to the slice being constructed
* @param subType Optional template-specific type information
- * @see {@link SliceItem#getSubType()}
+ * @see SliceItem#getSubType()
*/
public Builder addText(CharSequence text, @Nullable @SliceSubtype String subType,
@SliceHint List<String> hints) {
@@ -464,7 +464,7 @@ public final class Slice implements Parcelable {
/**
* Add an image to the slice being constructed
* @param subType Optional template-specific type information
- * @see {@link SliceItem#getSubType()}
+ * @see SliceItem#getSubType()
*/
public Builder addIcon(Icon icon, @Nullable @SliceSubtype String subType,
@SliceHint List<String> hints) {
@@ -476,7 +476,7 @@ public final class Slice implements Parcelable {
/**
* Add remote input to the slice being constructed
* @param subType Optional template-specific type information
- * @see {@link SliceItem#getSubType()}
+ * @see SliceItem#getSubType()
*/
public Slice.Builder addRemoteInput(RemoteInput remoteInput,
@Nullable @SliceSubtype String subType,
@@ -490,7 +490,7 @@ public final class Slice implements Parcelable {
/**
* Add an integer to the slice being constructed
* @param subType Optional template-specific type information
- * @see {@link SliceItem#getSubType()}
+ * @see SliceItem#getSubType()
*/
public Builder addInt(int value, @Nullable @SliceSubtype String subType,
@SliceHint List<String> hints) {
@@ -511,7 +511,7 @@ public final class Slice implements Parcelable {
/**
* Add a long to the slice being constructed
* @param subType Optional template-specific type information
- * @see {@link SliceItem#getSubType()}
+ * @see SliceItem#getSubType()
*/
public Slice.Builder addLong(long value, @Nullable @SliceSubtype String subType,
@SliceHint List<String> hints) {
@@ -525,7 +525,7 @@ public final class Slice implements Parcelable {
* <p>Expected to be used for support library extension, should not be used for general
* development
* @param subType Optional template-specific type information
- * @see {@link SliceItem#getSubType()}
+ * @see SliceItem#getSubType()
*/
public Slice.Builder addBundle(Bundle bundle, @Nullable @SliceSubtype String subType,
@SliceHint List<String> hints) {
diff --git a/core/java/android/app/slice/SliceProvider.java b/core/java/android/app/slice/SliceProvider.java
index 4c22c94266d7..ea9c9dab21ee 100644
--- a/core/java/android/app/slice/SliceProvider.java
+++ b/core/java/android/app/slice/SliceProvider.java
@@ -209,7 +209,7 @@ public abstract class SliceProvider extends ContentProvider {
*
* @param sliceUri Uri to bind.
* @param supportedSpecs List of supported specs.
- * @see {@link Slice}.
+ * @see {@link Slice}
* @see {@link Slice#HINT_PARTIAL}
*/
public Slice onBindSlice(Uri sliceUri, Set<SliceSpec> supportedSpecs) {
diff --git a/core/java/android/content/ContentProvider.java b/core/java/android/content/ContentProvider.java
index 2997e984add4..f1b8d1e46449 100644
--- a/core/java/android/content/ContentProvider.java
+++ b/core/java/android/content/ContentProvider.java
@@ -1073,12 +1073,12 @@ public abstract class ContentProvider implements ComponentCallbacks2 {
* Implement this to handle query requests where the arguments are packed into a {@link Bundle}.
* Arguments may include traditional SQL style query arguments. When present these
* should be handled according to the contract established in
- * {@link #query(Uri, String[], String, String[], String, CancellationSignal).
+ * {@link #query(Uri, String[], String, String[], String, CancellationSignal)}.
*
* <p>Traditional SQL arguments can be found in the bundle using the following keys:
- * <li>{@link ContentResolver#QUERY_ARG_SQL_SELECTION}
- * <li>{@link ContentResolver#QUERY_ARG_SQL_SELECTION_ARGS}
- * <li>{@link ContentResolver#QUERY_ARG_SQL_SORT_ORDER}
+ * <li>{@link android.content.ContentResolver#QUERY_ARG_SQL_SELECTION}
+ * <li>{@link android.content.ContentResolver#QUERY_ARG_SQL_SELECTION_ARGS}
+ * <li>{@link android.content.ContentResolver#QUERY_ARG_SQL_SORT_ORDER}
*
* <p>This method can be called from multiple threads, as described in
* <a href="{@docRoot}guide/topics/fundamentals/processes-and-threads.html#Threads">Processes
@@ -1135,8 +1135,8 @@ public abstract class ContentProvider implements ComponentCallbacks2 {
return cursor;</pre>
* <p>
- * @see #query(Uri, String[], String, String[], String, CancellationSignal) for
- * implementation details.
+ * See {@link #query(Uri, String[], String, String[], String, CancellationSignal)}
+ * for implementation details.
*
* @param uri The URI to query. This will be the full URI sent by the client.
* @param projection The list of columns to put into the cursor.
diff --git a/core/java/android/database/sqlite/SQLiteQueryBuilder.java b/core/java/android/database/sqlite/SQLiteQueryBuilder.java
index 982c10ae7fae..71760f28782b 100644
--- a/core/java/android/database/sqlite/SQLiteQueryBuilder.java
+++ b/core/java/android/database/sqlite/SQLiteQueryBuilder.java
@@ -27,7 +27,6 @@ import android.os.CancellationSignal;
import android.os.OperationCanceledException;
import android.provider.BaseColumns;
import android.text.TextUtils;
-import android.util.ArrayMap;
import android.util.Log;
import libcore.util.EmptyArray;
@@ -44,8 +43,7 @@ import java.util.regex.Pattern;
* This is a convenience class that helps build SQL queries to be sent to
* {@link SQLiteDatabase} objects.
*/
-public class SQLiteQueryBuilder
-{
+public class SQLiteQueryBuilder {
private static final String TAG = "SQLiteQueryBuilder";
private static final Pattern sLimitPattern =
Pattern.compile("\\s*\\d+\\s*(,\\s*\\d+\\s*)?");
@@ -498,12 +496,12 @@ public class SQLiteQueryBuilder
if (selectionArgs == null) {
selectionArgs = EmptyArray.STRING;
}
- final ArrayMap<String, Object> rawValues = values.getValues();
- final int valuesLength = rawValues.size();
+ final String[] rawKeys = values.keySet().toArray(EmptyArray.STRING);
+ final int valuesLength = rawKeys.length;
final Object[] sqlArgs = new Object[valuesLength + selectionArgs.length];
for (int i = 0; i < sqlArgs.length; i++) {
if (i < valuesLength) {
- sqlArgs[i] = rawValues.valueAt(i);
+ sqlArgs[i] = values.get(rawKeys[i]);
} else {
sqlArgs[i] = selectionArgs[i - valuesLength];
}
@@ -629,7 +627,7 @@ public class SQLiteQueryBuilder
/** {@hide} */
public String buildUpdate(ContentValues values, String selection) {
- if (values == null || values.isEmpty()) {
+ if (values == null || values.size() == 0) {
throw new IllegalArgumentException("Empty values");
}
@@ -638,12 +636,12 @@ public class SQLiteQueryBuilder
sql.append(mTables);
sql.append(" SET ");
- final ArrayMap<String, Object> rawValues = values.getValues();
- for (int i = 0; i < rawValues.size(); i++) {
+ final String[] rawKeys = values.keySet().toArray(EmptyArray.STRING);
+ for (int i = 0; i < rawKeys.length; i++) {
if (i > 0) {
sql.append(',');
}
- sql.append(rawValues.keyAt(i));
+ sql.append(rawKeys[i]);
sql.append("=?");
}
diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java
index 3edd06b38905..b29636a9863a 100644
--- a/core/java/android/os/UserManager.java
+++ b/core/java/android/os/UserManager.java
@@ -1454,11 +1454,11 @@ public class UserManager {
* background user; the result here does not distinguish between the two.
*
* <p>Note prior to Android Nougat MR1 (SDK version <= 24;
- * {@link android.os.Build.VERSION_CODES#N), this API required a system permission
+ * {@link android.os.Build.VERSION_CODES#N}, this API required a system permission
* in order to check other profile's status.
* Since Android Nougat MR1 (SDK version >= 25;
- * {@link android.os.Build.VERSION_CODES#N_MR1)), the restriction has been relaxed, and now
- * it'll accept any {@link UserHandle} within the same profile group as the caller.
+ * {@link android.os.Build.VERSION_CODES#N_MR1}), the restriction has been relaxed, and now
+ * it'll accept any {@link android.os.UserHandle} within the same profile group as the caller.
*
* @param user The user to retrieve the running state for.
*/
@@ -1483,11 +1483,11 @@ public class UserManager {
* (but is not yet fully stopped, and still running some code).
*
* <p>Note prior to Android Nougat MR1 (SDK version <= 24;
- * {@link android.os.Build.VERSION_CODES#N), this API required a system permission
+ * {@link android.os.Build.VERSION_CODES#N}, this API required a system permission
* in order to check other profile's status.
* Since Android Nougat MR1 (SDK version >= 25;
- * {@link android.os.Build.VERSION_CODES#N_MR1)), the restriction has been relaxed, and now
- * it'll accept any {@link UserHandle} within the same profile group as the caller.
+ * {@link android.os.Build.VERSION_CODES#N_MR1}), the restriction has been relaxed, and now
+ * it'll accept any {@link android.os.UserHandle} within the same profile group as the caller.
*
* @param user The user to retrieve the running state for.
*/
diff --git a/core/java/android/text/style/ImageSpan.java b/core/java/android/text/style/ImageSpan.java
index d4edde9ec589..13ac9ff2ddaf 100644
--- a/core/java/android/text/style/ImageSpan.java
+++ b/core/java/android/text/style/ImageSpan.java
@@ -259,7 +259,8 @@ public class ImageSpan extends DynamicDrawableSpan {
* Returns the source string that was saved during construction.
*
* @return the source string that was saved during construction
- * @see #ImageSpan(Drawable, String) and this{@link #ImageSpan(Context, Uri)}
+ * @see #ImageSpan(Drawable, String)
+ * @see #ImageSpan(Context, Uri)
*/
@Nullable
public String getSource() {
diff --git a/core/java/android/webkit/WebResourceResponse.java b/core/java/android/webkit/WebResourceResponse.java
index aae3056f6191..e66596b5c0e9 100644
--- a/core/java/android/webkit/WebResourceResponse.java
+++ b/core/java/android/webkit/WebResourceResponse.java
@@ -41,13 +41,21 @@ public class WebResourceResponse {
private InputStream mInputStream;
/**
- * Constructs a resource response with the given MIME type, encoding, and
- * input stream. Callers must implement
+ * Constructs a resource response with the given MIME type, character encoding,
+ * and input stream. Callers must implement
* {@link InputStream#read(byte[]) InputStream.read(byte[])} for the input
* stream.
*
- * @param mimeType the resource response's MIME type, for example text/html
- * @param encoding the resource response's encoding
+ * <p class="note"><b>Note:</b> The MIME type and character encoding must
+ * be specified as separate parameters (for example {@code "text/html"} and
+ * {@code "utf-8"}), not a single value like the {@code "text/html; charset=utf-8"}
+ * format used in the HTTP Content-Type header. Do not use the value of a HTTP
+ * Content-Encoding header for {@code encoding}, as that header does not specify a
+ * character encoding. Content without a defined character encoding (for example
+ * image resources) should pass {@code null} for {@code encoding}.
+ *
+ * @param mimeType the resource response's MIME type, for example {@code "text/html"}.
+ * @param encoding the resource response's character encoding, for example {@code "utf-8"}.
* @param data the input stream that provides the resource response's data. Must not be a
* StringBufferInputStream.
*/
@@ -63,8 +71,11 @@ public class WebResourceResponse {
* implement {@link InputStream#read(byte[]) InputStream.read(byte[])} for
* the input stream.
*
- * @param mimeType the resource response's MIME type, for example text/html
- * @param encoding the resource response's encoding
+ * <p class="note"><b>Note:</b> See {@link #WebResourceResponse(String,String,InputStream)}
+ * for details on what should be specified for {@code mimeType} and {@code encoding}.
+ *
+ * @param mimeType the resource response's MIME type, for example {@code "text/html"}.
+ * @param encoding the resource response's character encoding, for example {@code "utf-8"}.
* @param statusCode the status code needs to be in the ranges [100, 299], [400, 599].
* Causing a redirect by specifying a 3xx code is not supported.
* @param reasonPhrase the phrase describing the status code, for example "OK". Must be
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index 8f03b693e587..91340925da95 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -847,7 +847,7 @@ public class WebView extends AbsoluteLayout
/**
* Asynchronously evaluates JavaScript in the context of the currently displayed page.
- * If non-null, |resultCallback| will be invoked with any result returned from that
+ * If non-null, {@code resultCallback} will be invoked with any result returned from that
* execution. This method must be called on the UI thread and the callback will
* be made on the UI thread.
* <p>
diff --git a/core/java/com/android/internal/app/AssistUtils.java b/core/java/com/android/internal/app/AssistUtils.java
index 9ae614982fb5..fde01dd0deea 100644
--- a/core/java/com/android/internal/app/AssistUtils.java
+++ b/core/java/com/android/internal/app/AssistUtils.java
@@ -33,8 +33,6 @@ import android.os.ServiceManager;
import android.provider.Settings;
import android.util.Log;
-import com.android.internal.R;
-
/**
* Utility method for dealing with the assistant aspects of
* {@link com.android.internal.app.IVoiceInteractionManagerService IVoiceInteractionManagerService}.
@@ -43,14 +41,6 @@ public class AssistUtils {
private static final String TAG = "AssistUtils";
- /**
- * Sentinel value for "no default assistant specified."
- *
- * Empty string is already used to represent an explicit setting of No Assistant. null cannot
- * be used because we can't represent a null value in XML.
- */
- private static final String UNSET = "#+UNSET";
-
private final Context mContext;
private final IVoiceInteractionManagerService mVoiceInteractionManagerService;
@@ -167,7 +157,7 @@ public class AssistUtils {
final String defaultSetting = mContext.getResources().getString(
R.string.config_defaultAssistantComponentName);
- if (defaultSetting != null && !defaultSetting.equals(UNSET)) {
+ if (defaultSetting != null) {
return ComponentName.unflattenFromString(defaultSetting);
}
@@ -175,11 +165,6 @@ public class AssistUtils {
if (activeServiceSupportsAssistGesture()) {
return getActiveServiceComponentName();
}
-
- if (UNSET.equals(defaultSetting)) {
- return null;
- }
-
final SearchManager searchManager =
(SearchManager) mContext.getSystemService(Context.SEARCH_SERVICE);
if (searchManager == null) {