OSDN Git Service

Pass window token when creating a tooltip popup
authorVladislav Kaznacheev <kaznacheev@google.com>
Mon, 12 Jun 2017 19:10:49 +0000 (12:10 -0700)
committerVladislav Kaznacheev <kaznacheev@google.com>
Mon, 12 Jun 2017 19:10:49 +0000 (12:10 -0700)
This allows using tooltips in System UI.

Bug: 62065980
Test: android.view.cts.TooltipTest passes
Change-Id: If0a76d0806aa92efa4be57204c4517242b0ebb99

core/java/com/android/internal/view/TooltipPopup.java

index ebbbdbb..52357ac 100644 (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);