注册 登录
电子工程世界-论坛 返回首页 EEWORLD首页 频道 EE大学堂 下载中心 Datasheet 专题
jasmien的个人空间 https://home.eeworld.com.cn/space-uid-717194.html [收藏] [复制] [分享] [RSS]
日志

开机动画结束时增加振动提示

已有 343 次阅读2017-11-24 17:50

[DESCRIPTION]
进入MTK手机待机界面的时候,增加一个500ms振动提示

[SOLUTION]
在进入launcher前增加振动功能solution:
振动500ms。
/php?mod=tag&id=6090" target="_blank" class="relatedlink">Frameworks/base/services/core/java/com/android/server/wm/WindowManagerService.java
//-------------add--------------------
// length of vibration before boot up
private static final int BOOTUP_VIBRATE_MS = 500;
private static final AudioAttributes VIBRATION_ATTRIBUTES = new
AudioAttributes.Builder()
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
.setUsage(AudioAttributes.USAGE_ASSISTANCE_SONIFICATION)
.build();
//-------------add--------------------
6424 public void performEnableScreen() {
...
6483 mDisplayEnabled = true;
6484 if (DEBUG_SCREEN_ON || DEBUG_BOOT) Slog.i(TAG, "******************** ENABLING
SCREEN!");
//-------------add--------------------
1076 // vibrate before boot up
1077 Vibrator vibrator = new SystemVibrator();
1078 try {
1079 vibrator.vibrate(BOOTUP_VIBRATE_MS, VIBRATION_ATTRIBUTES);
1080 } catch (Exception e) {
1081 // Failure to vibrate shouldn't interrupt boot up. Just log it.
1082 Log.w(TAG, "Failed to vibrate during boot up.", e);
1083 }
//-------------add--------------------
6486 // Enable input dispatch.
6487 mInputMonitor.setEventDispatchingLw(mEventDispatchingEnabled);
/frameworks/base/services/core/java/com/android/server/VibratorService.java
391 private void startVibrationLocked(final Vibration vib) {
//将该部分注释掉
404 if (mode != AppOpsManager.MODE_ALLOWED) {
405 if (mode == AppOpsManager.MODE_ERRORED) {
406 Slog.w(TAG, "Would be an error: vibrate fROM uid " + vib.mUid);
407 }
408 //mtk Modify, do nothing with App related control in MTK solution
409 //mH.post(mVibrationRunnable);
410 return;
411 }
//将该部分注释掉
评论 (0 个评论)

facelist doodle 涂鸦板

您需要登录后才可以评论 登录 | 注册

热门文章