OSDN Git Service

Get Vibrator from Context instead of using private API.
authorJeff Brown <jeffbrown@google.com>
Fri, 13 Apr 2012 09:56:56 +0000 (02:56 -0700)
committerJeff Brown <jeffbrown@google.com>
Fri, 13 Apr 2012 09:56:56 +0000 (02:56 -0700)
Bug: 6334179
Change-Id: I55ee28578ba8ac22168c3578e4888b2235442884

src/com/android/inputmethod/pinyin/SoftKeyboardView.java

index 5543f33..bd74701 100644 (file)
@@ -380,7 +380,7 @@ public class SoftKeyboardView extends View {
             return;
         }
         if (mVibrator == null) {
-            mVibrator = new Vibrator();
+            mVibrator = (Vibrator)getContext().getSystemService(Context.VIBRATOR_SERVICE);
         }
         mVibrator.vibrate(mVibratePattern, -1);
     }