Merge "Fix an issue that setMaxSuggestions(-1) throws unexpectedly" into rvc-dev am: 0fcab06f80
Change-Id: Ia7007f0d352b79d910f98e93bd6877a9e4a574af
This commit is contained in:
@@ -27,8 +27,6 @@ import android.os.Parcel;
|
|||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
import android.text.SpannedString;
|
import android.text.SpannedString;
|
||||||
|
|
||||||
import com.android.internal.util.Preconditions;
|
|
||||||
|
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
import java.time.ZonedDateTime;
|
import java.time.ZonedDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
@@ -491,7 +489,11 @@ public final class ConversationActions implements Parcelable {
|
|||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
public Builder setMaxSuggestions(@IntRange(from = -1) int maxSuggestions) {
|
public Builder setMaxSuggestions(@IntRange(from = -1) int maxSuggestions) {
|
||||||
mMaxSuggestions = Preconditions.checkArgumentNonnegative(maxSuggestions);
|
if (maxSuggestions < -1) {
|
||||||
|
throw new IllegalArgumentException("maxSuggestions has to be greater than or "
|
||||||
|
+ "equal to -1.");
|
||||||
|
}
|
||||||
|
mMaxSuggestions = maxSuggestions;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user