Merge changes Ia92e0619,Ifd0cfc06

* changes:
  Don't reference UNDEMOTE_METHOD
  Don't use internal VisibleForTesting annotation
diff --git a/src/com/android/contacts/widget/MultiShrinkScroller.java b/src/com/android/contacts/widget/MultiShrinkScroller.java
index 50dfa3f..7b97643 100644
--- a/src/com/android/contacts/widget/MultiShrinkScroller.java
+++ b/src/com/android/contacts/widget/MultiShrinkScroller.java
@@ -19,12 +19,11 @@
 import android.graphics.ColorMatrixColorFilter;
 import android.graphics.Rect;
 import android.graphics.drawable.GradientDrawable;
-import android.hardware.display.DisplayManagerGlobal;
+import android.hardware.display.DisplayManager;
 import android.os.Trace;
 import android.util.AttributeSet;
 import android.util.TypedValue;
 import android.view.Display;
-import android.view.DisplayInfo;
 import android.view.Gravity;
 import android.view.MotionEvent;
 import android.view.VelocityTracker;
@@ -1032,14 +1031,14 @@
      * finishes moving into its target location/size.
      */
     private void calculateCollapsedLargeTitlePadding() {
-        final Rect largeTextViewRect = new Rect();
-        mToolbar.getBoundsOnScreen(largeTextViewRect);
-        final Rect invisiblePlaceholderTextViewRect = new Rect();
-        mInvisiblePlaceholderTextView.getBoundsOnScreen(invisiblePlaceholderTextViewRect);
+        int invisiblePlaceHolderLocation[] = new int[2];
+        int largeTextViewRectLocation[] = new int[2];
+        mInvisiblePlaceholderTextView.getLocationOnScreen(invisiblePlaceHolderLocation);
+        mToolbar.getLocationOnScreen(largeTextViewRectLocation);
         // Distance between top of toolbar to the center of the target rectangle.
-        final int desiredTopToCenter = (
-                invisiblePlaceholderTextViewRect.top + invisiblePlaceholderTextViewRect.bottom)
-                / 2 - largeTextViewRect.top;
+        final int desiredTopToCenter = invisiblePlaceHolderLocation[1]
+                + mInvisiblePlaceholderTextView.getHeight() / 2
+                - largeTextViewRectLocation[1];
         // Padding needed on the mLargeTextView so that it has the same amount of
         // padding as the target rectangle.
         mCollapsedTitleBottomMargin = desiredTopToCenter - mLargeTextView.getHeight() / 2;
@@ -1239,7 +1238,7 @@
      * Similar to a {@link android.view.animation.AccelerateInterpolator} in the sense that
      * getInterpolation() is a quadratic function.
      */
-    private static class AcceleratingFlingInterpolator implements Interpolator {
+    private class AcceleratingFlingInterpolator implements Interpolator {
 
         private final float mStartingSpeedPixelsPerFrame;
         private final float mDurationMs;
@@ -1271,9 +1270,9 @@
         }
 
         private float getRefreshRate() {
-            DisplayInfo di = DisplayManagerGlobal.getInstance().getDisplayInfo(
-                    Display.DEFAULT_DISPLAY);
-            return di.refreshRate;
+            final DisplayManager displayManager = (DisplayManager) MultiShrinkScroller
+                    .this.getContext().getSystemService(Context.DISPLAY_SERVICE);
+            return displayManager.getDisplay(Display.DEFAULT_DISPLAY).getRefreshRate();
         }
 
         public long getFrameIntervalMs() {