Merge "ApiCouncil review round3 / setHidden, Query.getExtras" into sc-dev am: 46d6e25d25
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14683051 Change-Id: I774d7109e0296adcf2072ddf4659dcf2da3c5d04
This commit is contained in:
@@ -1458,6 +1458,7 @@ package android.app.search {
|
||||
method public long getTimestampMillis();
|
||||
method public void writeToParcel(@NonNull android.os.Parcel, int);
|
||||
field @NonNull public static final android.os.Parcelable.Creator<android.app.search.Query> CREATOR;
|
||||
field public static final String EXTRA_IME_HEIGHT = "android.app.search.extra.IME_HEIGHT";
|
||||
}
|
||||
|
||||
public final class SearchAction implements android.os.Parcelable {
|
||||
@@ -1526,7 +1527,7 @@ package android.app.search {
|
||||
method @Nullable public android.content.pm.ShortcutInfo getShortcutInfo();
|
||||
method @Nullable public android.net.Uri getSliceUri();
|
||||
method @NonNull public android.os.UserHandle getUserHandle();
|
||||
method public boolean shouldHide();
|
||||
method public boolean isHidden();
|
||||
method public void writeToParcel(@NonNull android.os.Parcel, int);
|
||||
field @NonNull public static final android.os.Parcelable.Creator<android.app.search.SearchTarget> CREATOR;
|
||||
field public static final String LAYOUT_TYPE_ICON = "icon";
|
||||
@@ -1543,12 +1544,12 @@ package android.app.search {
|
||||
method @NonNull public android.app.search.SearchTarget build();
|
||||
method @NonNull public android.app.search.SearchTarget.Builder setAppWidgetProviderInfo(@NonNull android.appwidget.AppWidgetProviderInfo);
|
||||
method @NonNull public android.app.search.SearchTarget.Builder setExtras(@NonNull android.os.Bundle);
|
||||
method @NonNull public android.app.search.SearchTarget.Builder setHidden(boolean);
|
||||
method @NonNull public android.app.search.SearchTarget.Builder setPackageName(@NonNull String);
|
||||
method @NonNull public android.app.search.SearchTarget.Builder setParentId(@NonNull String);
|
||||
method @NonNull public android.app.search.SearchTarget.Builder setScore(@FloatRange(from=0.0f, to=1.0f) float);
|
||||
method @NonNull public android.app.search.SearchTarget.Builder setSearchAction(@Nullable android.app.search.SearchAction);
|
||||
method @NonNull public android.app.search.SearchTarget.Builder setShortcutInfo(@NonNull android.content.pm.ShortcutInfo);
|
||||
method @NonNull public android.app.search.SearchTarget.Builder setShouldHide(boolean);
|
||||
method @NonNull public android.app.search.SearchTarget.Builder setSliceUri(@NonNull android.net.Uri);
|
||||
method @NonNull public android.app.search.SearchTarget.Builder setUserHandle(@NonNull android.os.UserHandle);
|
||||
}
|
||||
|
||||
@@ -58,6 +58,14 @@ package android.app.search {
|
||||
method @Deprecated public void destroy();
|
||||
}
|
||||
|
||||
public final class SearchTarget implements android.os.Parcelable {
|
||||
method @Deprecated public boolean shouldHide();
|
||||
}
|
||||
|
||||
public static final class SearchTarget.Builder {
|
||||
method @Deprecated @NonNull public android.app.search.SearchTarget.Builder setShouldHide(boolean);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
package android.bluetooth {
|
||||
|
||||
@@ -36,6 +36,14 @@ import android.os.Parcelable;
|
||||
@SystemApi
|
||||
public final class Query implements Parcelable {
|
||||
|
||||
/**
|
||||
* The lookup key for a integer that indicates what the height of the soft keyboard
|
||||
* (e.g., IME, also known as Input Method Editor) was on the client window
|
||||
* in dp (density-independent pixels). This information is to be used by the consumer
|
||||
* of the API in estimating how many search results will be visible above the keyboard.
|
||||
*/
|
||||
public static final String EXTRA_IME_HEIGHT = "android.app.search.extra.IME_HEIGHT";
|
||||
|
||||
/**
|
||||
* string typed from the client.
|
||||
*/
|
||||
@@ -45,7 +53,7 @@ public final class Query implements Parcelable {
|
||||
private final long mTimestampMillis;
|
||||
|
||||
/**
|
||||
* Contains other client UI constraints related data
|
||||
* Contains other client UI constraints related data (e.g., {@link #EXTRA_IME_HEIGHT}.
|
||||
*/
|
||||
@NonNull
|
||||
private final Bundle mExtras;
|
||||
|
||||
@@ -50,7 +50,7 @@ import java.util.Objects;
|
||||
* can recommend which layout this target should be rendered in.
|
||||
*
|
||||
* The service can also use fields such as {@link #getScore()} to indicate
|
||||
* how confidence the search result is and {@link #shouldHide()} to indicate
|
||||
* how confidence the search result is and {@link #isHidden()} to indicate
|
||||
* whether it is recommended to be shown by default.
|
||||
*
|
||||
* Finally, {@link #getId()} is the unique identifier of this search target and a single
|
||||
@@ -125,7 +125,7 @@ public final class SearchTarget implements Parcelable {
|
||||
|
||||
private final float mScore;
|
||||
|
||||
private final boolean mShouldHide;
|
||||
private final boolean mHidden;
|
||||
|
||||
@NonNull
|
||||
private final String mPackageName;
|
||||
@@ -149,7 +149,7 @@ public final class SearchTarget implements Parcelable {
|
||||
mId = parcel.readString();
|
||||
mParentId = parcel.readString();
|
||||
mScore = parcel.readFloat();
|
||||
mShouldHide = parcel.readBoolean();
|
||||
mHidden = parcel.readBoolean();
|
||||
|
||||
mPackageName = parcel.readString();
|
||||
mUserHandle = UserHandle.of(parcel.readInt());
|
||||
@@ -165,7 +165,7 @@ public final class SearchTarget implements Parcelable {
|
||||
@NonNull String layoutType,
|
||||
@NonNull String id,
|
||||
@Nullable String parentId,
|
||||
float score, boolean shouldHide,
|
||||
float score, boolean hidden,
|
||||
@NonNull String packageName,
|
||||
@NonNull UserHandle userHandle,
|
||||
@Nullable SearchAction action,
|
||||
@@ -178,7 +178,7 @@ public final class SearchTarget implements Parcelable {
|
||||
mId = Objects.requireNonNull(id);
|
||||
mParentId = parentId;
|
||||
mScore = score;
|
||||
mShouldHide = shouldHide;
|
||||
mHidden = hidden;
|
||||
mPackageName = Objects.requireNonNull(packageName);
|
||||
mUserHandle = Objects.requireNonNull(userHandle);
|
||||
mSearchAction = action;
|
||||
@@ -238,9 +238,20 @@ public final class SearchTarget implements Parcelable {
|
||||
|
||||
/**
|
||||
* Indicates whether this object should be hidden and shown only on demand.
|
||||
*
|
||||
* @deprecated will be removed once SDK drops
|
||||
* @removed
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean shouldHide() {
|
||||
return mShouldHide;
|
||||
return mHidden;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether this object should be hidden and shown only on demand.
|
||||
*/
|
||||
public boolean isHidden() {
|
||||
return mHidden;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -311,7 +322,7 @@ public final class SearchTarget implements Parcelable {
|
||||
parcel.writeString(mId);
|
||||
parcel.writeString(mParentId);
|
||||
parcel.writeFloat(mScore);
|
||||
parcel.writeBoolean(mShouldHide);
|
||||
parcel.writeBoolean(mHidden);
|
||||
parcel.writeString(mPackageName);
|
||||
parcel.writeInt(mUserHandle.getIdentifier());
|
||||
parcel.writeTypedObject(mSearchAction, flags);
|
||||
@@ -351,7 +362,7 @@ public final class SearchTarget implements Parcelable {
|
||||
@Nullable
|
||||
private String mParentId;
|
||||
private float mScore;
|
||||
private boolean mShouldHide;
|
||||
private boolean mHidden;
|
||||
@NonNull
|
||||
private String mPackageName;
|
||||
@NonNull
|
||||
@@ -374,7 +385,7 @@ public final class SearchTarget implements Parcelable {
|
||||
mLayoutType = Objects.requireNonNull(layoutType);
|
||||
mResultType = resultType;
|
||||
mScore = 1f;
|
||||
mShouldHide = false;
|
||||
mHidden = false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -473,8 +484,20 @@ public final class SearchTarget implements Parcelable {
|
||||
* Sets whether the result should be hidden (e.g. not visible) by default inside client.
|
||||
*/
|
||||
@NonNull
|
||||
public Builder setHidden(boolean hidden) {
|
||||
mHidden = hidden;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether the result should be hidden by default inside client.
|
||||
* @deprecated will be removed once SDK drops
|
||||
* @removed
|
||||
*/
|
||||
@NonNull
|
||||
@Deprecated
|
||||
public Builder setShouldHide(boolean shouldHide) {
|
||||
mShouldHide = shouldHide;
|
||||
mHidden = shouldHide;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -485,7 +508,7 @@ public final class SearchTarget implements Parcelable {
|
||||
*/
|
||||
@NonNull
|
||||
public SearchTarget build() {
|
||||
return new SearchTarget(mResultType, mLayoutType, mId, mParentId, mScore, mShouldHide,
|
||||
return new SearchTarget(mResultType, mLayoutType, mId, mParentId, mScore, mHidden,
|
||||
mPackageName, mUserHandle,
|
||||
mSearchAction, mShortcutInfo, mSliceUri, mAppWidgetProviderInfo,
|
||||
mExtras);
|
||||
|
||||
Reference in New Issue
Block a user