diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java index f2bf122979..deb9940ad2 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java @@ -212,29 +212,29 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis @Override public boolean onKeyDown(int keyCode, KeyEvent event) { - if (keyCode == KeyEvent.KEYCODE_VOLUME_UP) { //向上长按 开启自动驾驶 - long currentTime = System.currentTimeMillis() / (1000); - long oldTime = SharedPrefsMgr.getInstance(getContext()).getLong("old_time_up", 0); -// Log.d("liyz", "time = " + (currentTime - oldTime)); - if (currentTime - oldTime > 6) { - SharedPrefsMgr.getInstance(getContext()).putLong("old_time_up", System.currentTimeMillis() / 1000); -// ToastUtils.showShort("长按 ↑↑↑ 开启自动驾驶"); -// CallerAutoPilotManager.INSTANCE.setControlAutopilotCarAuto(true); - CallerAutoPilotManager.INSTANCE.startAutoPilot(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getAutopilotControlParameters()); - - } - - return true; - } else if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) { //下和中间键盘长按,减速为-2 - long currentTime = System.currentTimeMillis() / (1000); - long oldTime = SharedPrefsMgr.getInstance(getContext()).getLong("old_time_down", 0); - if (currentTime - oldTime > 6) { - SharedPrefsMgr.getInstance(getContext()).putLong("old_time_down", System.currentTimeMillis() / 1000); -// ToastUtils.showShort("长按 ↓↓↓ 减速 -2 "); - sendAcc(true, -2); - } - return true; - } +// if (keyCode == KeyEvent.KEYCODE_VOLUME_UP) { //向上长按 开启自动驾驶 +// long currentTime = System.currentTimeMillis() / (1000); +// long oldTime = SharedPrefsMgr.getInstance(getContext()).getLong("old_time_up", 0); +//// Log.d("liyz", "time = " + (currentTime - oldTime)); +// if (currentTime - oldTime > 6) { +// SharedPrefsMgr.getInstance(getContext()).putLong("old_time_up", System.currentTimeMillis() / 1000); +//// ToastUtils.showShort("长按 ↑↑↑ 开启自动驾驶"); +//// CallerAutoPilotManager.INSTANCE.setControlAutopilotCarAuto(true); +// CallerAutoPilotManager.INSTANCE.startAutoPilot(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getAutopilotControlParameters()); +// +// } +// +// return true; +// } else if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) { //下和中间键盘长按,减速为-2 +// long currentTime = System.currentTimeMillis() / (1000); +// long oldTime = SharedPrefsMgr.getInstance(getContext()).getLong("old_time_down", 0); +// if (currentTime - oldTime > 6) { +// SharedPrefsMgr.getInstance(getContext()).putLong("old_time_down", System.currentTimeMillis() / 1000); +//// ToastUtils.showShort("长按 ↓↓↓ 减速 -2 "); +// sendAcc(true, -2); +// } +// return true; +// } // Log.e("liyz", "onKeyDown keyCode = " + keyCode + "--action = " + event.getAction() + "---" + event); return super.onKeyDown(keyCode, event);