Pass window token when creating a tooltip popup

This allows using tooltips in System UI.

Bug: 62065980
Test: android.view.cts.TooltipTest passes
Change-Id: If0a76d0806aa92efa4be57204c4517242b0ebb99
This commit is contained in:
Vladislav Kaznacheev
2017-06-12 12:10:49 -07:00
parent 7410170ddc
commit d85915f786

View File

@@ -97,6 +97,8 @@ public class TooltipPopup {
private void computePosition(View anchorView, int anchorX, int anchorY, boolean fromTouch,
WindowManager.LayoutParams outParams) {
outParams.token = anchorView.getWindowToken();
final int tooltipPreciseAnchorThreshold = mContext.getResources().getDimensionPixelOffset(
com.android.internal.R.dimen.tooltip_precise_anchor_threshold);