Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7fa52948 authored by Rob Carr's avatar Rob Carr Committed by android-build-merger
Browse files

Merge "ListPopupWindow: Wrap new bounds checking in targetSdk check." into oc-dev

am: 82b41e46

Change-Id: Idbb623e64dbaf079d603c3fbb93e60e8325209fe
parents 05c0e75d 82b41e46
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.content.res.TypedArray;
import android.database.DataSetObserver;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Handler;
import android.util.AttributeSet;
import android.util.Log;
@@ -532,9 +533,15 @@ public class ListPopupWindow implements ShowableListMenu {
    public void setHeight(int height) {
        if (height < 0 && ViewGroup.LayoutParams.WRAP_CONTENT != height
                && ViewGroup.LayoutParams.MATCH_PARENT != height) {
            if (mContext.getApplicationInfo().targetSdkVersion
                    < Build.VERSION_CODES.O) {
                Log.e(TAG, "Negative value " + height + " passed to ListPopupWindow#setHeight"
                        + " produces undefined results");
            } else {
                throw new IllegalArgumentException(
                        "Invalid height. Must be a positive value, MATCH_PARENT, or WRAP_CONTENT.");
            }
        }
        mDropDownHeight = height;
    }