Get Vibrator from Context instead of using private API.

Bug: 6334179
Change-Id: I5b16e0706489edc6c93ad9b5e480157aea1ecad0
This commit is contained in:
Jeff Brown
2012-04-13 02:58:38 -07:00
parent 200358df3f
commit 8ef85c7a01
@@ -67,7 +67,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();
@@ -151,6 +151,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);