[2.13.0] 添加日志
This commit is contained in:
@@ -204,17 +204,17 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean dispatchKeyEvent(KeyEvent event) {
|
public boolean dispatchKeyEvent(KeyEvent event) {
|
||||||
// CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent code = " + event.getKeyCode() + "--action = " + event.getAction() + "----" + event);
|
CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent code = " + event.getKeyCode() + "--action = " + event.getAction() + "----" + event);
|
||||||
String bluetoothName = SharedPrefsMgr.getInstance(getContext()).getString(MfConstants.BLUETOOTH_NAME);
|
String bluetoothName = SharedPrefsMgr.getInstance(getContext()).getString(MfConstants.BLUETOOTH_NAME);
|
||||||
if (!isPressEnd) {
|
if (!isPressEnd) {
|
||||||
CallerLogger.INSTANCE.d(M_F + "MoFangManager","dispatchKeyEvent bluetoothName = " + bluetoothName);
|
CallerLogger.INSTANCE.d(M_F + "MoFangManager","dispatchKeyEvent ---1--- bluetoothName = " + bluetoothName);
|
||||||
}
|
}
|
||||||
if (bluetoothName.equals("MINI_KEYBOARD")) {
|
if (bluetoothName.equals("MINI_KEYBOARD")) {
|
||||||
if (!isPressEnd) {
|
if (!isPressEnd) {
|
||||||
isPressEnd = true;
|
isPressEnd = true;
|
||||||
startPressTime = System.currentTimeMillis();
|
startPressTime = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
CallerLogger.INSTANCE.d(M_F + "MoFangManager","dispatchKeyEvent ---2--- bluetoothName = " + bluetoothName + "--- code = " + event.getKeyCode() + "--action = " + event.getAction());
|
||||||
if (event.getKeyCode() == KeyEvent.KEYCODE_A) { //单击 -1,长按无操作,AB组合-2
|
if (event.getKeyCode() == KeyEvent.KEYCODE_A) { //单击 -1,长按无操作,AB组合-2
|
||||||
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||||
pressADownTime = System.currentTimeMillis();
|
pressADownTime = System.currentTimeMillis();
|
||||||
@@ -299,6 +299,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
|||||||
} else if (event.getKeyCode() == KeyEvent.KEYCODE_C) { //单击左变道,长按无操作
|
} else if (event.getKeyCode() == KeyEvent.KEYCODE_C) { //单击左变道,长按无操作
|
||||||
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||||
pressCDownTime = System.currentTimeMillis();
|
pressCDownTime = System.currentTimeMillis();
|
||||||
|
CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent 方块 长按C 无操作 time dif = " + (pressCDownTime - startPressTime));
|
||||||
if ((pressCDownTime - startPressTime) > 1320) {
|
if ((pressCDownTime - startPressTime) > 1320) {
|
||||||
CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent 方块 长按C 无操作 ");
|
CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent 方块 长按C 无操作 ");
|
||||||
if (isShowToast) {
|
if (isShowToast) {
|
||||||
@@ -308,6 +309,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
|||||||
} else if (event.getAction() == KeyEvent.ACTION_UP) {
|
} else if (event.getAction() == KeyEvent.ACTION_UP) {
|
||||||
pressCUpTime = System.currentTimeMillis();
|
pressCUpTime = System.currentTimeMillis();
|
||||||
isPressEnd = false;
|
isPressEnd = false;
|
||||||
|
CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent 方块 单击C ← 向左变道 time dif = " + (pressCUpTime - startPressTime));
|
||||||
if ((pressCUpTime - startPressTime) < 300) {
|
if ((pressCUpTime - startPressTime) < 300) {
|
||||||
CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent 方块 单击C ← 向左变道 ");
|
CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent 方块 单击C ← 向左变道 ");
|
||||||
if (isShowToast) {
|
if (isShowToast) {
|
||||||
@@ -320,6 +322,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
|||||||
} else if (event.getKeyCode() == KeyEvent.KEYCODE_D) { //单击向右变道,双击无操作
|
} else if (event.getKeyCode() == KeyEvent.KEYCODE_D) { //单击向右变道,双击无操作
|
||||||
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||||
pressDDownTime = System.currentTimeMillis();
|
pressDDownTime = System.currentTimeMillis();
|
||||||
|
CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent 方块 长按D 无操作 time dif = " + (pressDDownTime - startPressTime));
|
||||||
if ((pressDDownTime - startPressTime) > 1320) {
|
if ((pressDDownTime - startPressTime) > 1320) {
|
||||||
CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent 方块 长按D 无操作 ");
|
CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent 方块 长按D 无操作 ");
|
||||||
if (isShowToast) {
|
if (isShowToast) {
|
||||||
@@ -329,6 +332,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
|||||||
} else if (event.getAction() == KeyEvent.ACTION_UP) {
|
} else if (event.getAction() == KeyEvent.ACTION_UP) {
|
||||||
pressDUpTime = System.currentTimeMillis();
|
pressDUpTime = System.currentTimeMillis();
|
||||||
isPressEnd = false;
|
isPressEnd = false;
|
||||||
|
CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent 方块 单击D → 向右变道 time dif = " + (pressDUpTime - startPressTime));
|
||||||
if ((pressDUpTime - startPressTime) < 300) {
|
if ((pressDUpTime - startPressTime) < 300) {
|
||||||
if (isShowToast) {
|
if (isShowToast) {
|
||||||
ToastUtils.showShort("方块 单击D → 向右变道 ");
|
ToastUtils.showShort("方块 单击D → 向右变道 ");
|
||||||
@@ -341,6 +345,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
|||||||
} else if (event.getKeyCode() == KeyEvent.KEYCODE_E) { //单击启动自驾,长按鸣笛
|
} else if (event.getKeyCode() == KeyEvent.KEYCODE_E) { //单击启动自驾,长按鸣笛
|
||||||
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||||
pressEDownTime = System.currentTimeMillis();
|
pressEDownTime = System.currentTimeMillis();
|
||||||
|
CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent 方块 长按E 鸣笛 time dif = " + (pressEDownTime - startPressTime));
|
||||||
if ((pressEDownTime - startPressTime) > 1320) {
|
if ((pressEDownTime - startPressTime) > 1320) {
|
||||||
if (isShowToast) {
|
if (isShowToast) {
|
||||||
ToastUtils.showShort("方块 长按E 鸣笛 ");
|
ToastUtils.showShort("方块 长按E 鸣笛 ");
|
||||||
@@ -361,6 +366,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
|||||||
} else if (event.getAction() == KeyEvent.ACTION_UP) {
|
} else if (event.getAction() == KeyEvent.ACTION_UP) {
|
||||||
pressEUpTime = System.currentTimeMillis();
|
pressEUpTime = System.currentTimeMillis();
|
||||||
isPressEnd = false;
|
isPressEnd = false;
|
||||||
|
CallerLogger.INSTANCE.d(M_F + "MoFangManager", "方块 单击E 开启自动驾驶 time dif = " + (pressEUpTime - startPressTime));
|
||||||
if ((pressEUpTime - startPressTime) < 300) {
|
if ((pressEUpTime - startPressTime) < 300) {
|
||||||
if (isShowToast) {
|
if (isShowToast) {
|
||||||
ToastUtils.showShort("方块 单击E 开启自动驾驶 ");
|
ToastUtils.showShort("方块 单击E 开启自动驾驶 ");
|
||||||
|
|||||||
Reference in New Issue
Block a user