Get Vibrator from Context instead of using private API.
Bug: 6334179 Change-Id: I5b16e0706489edc6c93ad9b5e480157aea1ecad0
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user