Merge "Get Vibrator from Context instead of using private API."

This commit is contained in:
Winson Chung authored and Android (Google) Code Review committed 2012-04-13 15:55:03 -07:00
commit e46772df79
1 file changed
+2 -1
@@ -66,7 +66,7 @@ public class DragController {
private Launcher mLauncher;
private Handler mHandler;
private final Vibrator mVibrator = new Vibrator();
private final Vibrator mVibrator;
// temporaries to avoid gc thrash
private Rect mRectTemp = new Rect();
@@ -150,6 +150,7 @@ public class DragController {
mHandler = new Handler();
mScrollZone = launcher.getResources().getDimensionPixelSize(R.dimen.scroll_zone);
mVelocityTracker = VelocityTracker.obtain();
mVibrator = (Vibrator)launcher.getSystemService(Context.VIBRATOR_SERVICE);
float density = launcher.getResources().getDisplayMetrics().density;
mFlingToDeleteThresholdVelocity = (int) (FLING_TO_DELETE_THRESHOLD_Y_VELOCITY * density);