.. | .. |
---|
2644 | 2644 | + repeatCount + " keyguardOn=" + keyguardOn + " canceled=" + canceled); |
---|
2645 | 2645 | } |
---|
2646 | 2646 | |
---|
2647 | | - if(down) { |
---|
2648 | | - pwd += String.valueOf(keyCode); |
---|
| 2647 | + //-----------------------kickpi code-------------- |
---|
| 2648 | + if (down) { |
---|
| 2649 | + pwd += String.valueOf(keyCode); |
---|
| 2650 | + |
---|
| 2651 | + Log.d(TAG, "kickpi pwd = " + pwd); |
---|
| 2652 | + |
---|
| 2653 | + if (pwd.contains("1412151297")) { //758520 |
---|
| 2654 | + String irConfig = SystemProperties.get("persist.sys.kickpi.irkeylock","0"); |
---|
| 2655 | + if("1".equals(irConfig)) { |
---|
| 2656 | + SystemProperties.set("persist.sys.kickpi.irkeylock","0"); |
---|
| 2657 | + mHandler.removeMessages(MSG_SHOW_TOAST); |
---|
| 2658 | + mHandler.sendMessage(mHandler.obtainMessage(MSG_SHOW_TOAST, "Close IR Key Lock")); |
---|
| 2659 | + } else { |
---|
| 2660 | + SystemProperties.set("persist.sys.kickpi.irkeylock","1"); |
---|
| 2661 | + mHandler.removeMessages(MSG_SHOW_TOAST); |
---|
| 2662 | + mHandler.sendMessage(mHandler.obtainMessage(MSG_SHOW_TOAST, "Open IR Key Lock")); |
---|
| 2663 | + } |
---|
| 2664 | + pwd = ""; |
---|
| 2665 | + } |
---|
| 2666 | + |
---|
| 2667 | + String IRKeyProp = SystemProperties.get("persist.sys.kickpi.irkeylock"); |
---|
| 2668 | + if ("1".equals(IRKeyProp)) { |
---|
| 2669 | + mHandler.removeMessages(MSG_SHOW_TOAST); |
---|
| 2670 | + mHandler.sendMessage(mHandler.obtainMessage(MSG_SHOW_TOAST, "IR Key Locking")); |
---|
| 2671 | + Log.e(TAG, "IR POWER KEY LOCK"); |
---|
| 2672 | + return -1; |
---|
| 2673 | + } |
---|
2649 | 2674 | if(pwd.contains("3822020")){ // home menu 2down |
---|
2650 | 2675 | try { |
---|
2651 | 2676 | Intent intent = new Intent(Intent.ACTION_MAIN); |
---|
.. | .. |
---|
2701 | 2726 | e.printStackTrace(); |
---|
2702 | 2727 | } |
---|
2703 | 2728 | pwd = ""; |
---|
2704 | | - } else if(pwd.contains("1412151297")){ //758520 |
---|
2705 | | - String irConfig = SystemProperties.get("vendor.kickpi.irkey.enable","0"); |
---|
2706 | | - if("1".equals(irConfig)) { |
---|
2707 | | - SystemProperties.set("vendor.kickpi.irkey.enable","0"); |
---|
2708 | | - mHandler.removeMessages(MSG_SHOW_TOAST); |
---|
2709 | | - mHandler.sendMessage(mHandler.obtainMessage(MSG_SHOW_TOAST, "Close IR Key")); |
---|
2710 | | - } else { |
---|
2711 | | - SystemProperties.set("vendor.kickpi.irkey.enable","1"); |
---|
2712 | | - mHandler.removeMessages(MSG_SHOW_TOAST); |
---|
2713 | | - mHandler.sendMessage(mHandler.obtainMessage(MSG_SHOW_TOAST, "Open IR Key")); |
---|
2714 | | - } |
---|
2715 | | - pwd = ""; |
---|
2716 | 2729 | } else if(pwd.contains("14121512910")){ // 8521 adb switch |
---|
2717 | 2730 | String adbConfig = SystemProperties.get("persist.vendor.adb.enable","0"); |
---|
2718 | 2731 | if("1".equals(adbConfig)) { |
---|
.. | .. |
---|
2734 | 2747 | pwd = ""; |
---|
2735 | 2748 | } |
---|
2736 | 2749 | } |
---|
2737 | | - |
---|
2738 | | - String IRKeyProp = SystemProperties.get("vendor.kickpi.irkey.enable"); |
---|
2739 | | - if ("1".equals(IRKeyProp)) { |
---|
2740 | | - mHandler.removeMessages(MSG_SHOW_TOAST); |
---|
2741 | | - mHandler.sendMessage(mHandler.obtainMessage(MSG_SHOW_TOAST, "Close IR Key")); |
---|
2742 | | - return -1; |
---|
2743 | | - } |
---|
| 2750 | + //------------------------------------------------ |
---|
2744 | 2751 | |
---|
2745 | 2752 | // If we think we might have a volume down & power key chord on the way |
---|
2746 | 2753 | // but we're not sure, then tell the dispatcher to wait a little while and |
---|
.. | .. |
---|
4004 | 4011 | } |
---|
4005 | 4012 | |
---|
4006 | 4013 | case KeyEvent.KEYCODE_POWER: { |
---|
4007 | | - EventLogTags.writeInterceptPower( |
---|
4008 | | - KeyEvent.actionToString(event.getAction()), |
---|
4009 | | - mPowerKeyHandled ? 1 : 0, mPowerKeyPressCounter); |
---|
4010 | | - // Any activity on the power button stops the accessibility shortcut |
---|
4011 | | - cancelPendingAccessibilityShortcutAction(); |
---|
4012 | | - result &= ~ACTION_PASS_TO_USER; |
---|
4013 | | - isWakeKey = false; // wake-up will be handled separately |
---|
4014 | | - if (down) { |
---|
4015 | | - interceptPowerKeyDown(event, interactive); |
---|
| 4014 | + // kickpi when ir lock always return |
---|
| 4015 | + String IRKeyProp = SystemProperties.get("persist.sys.kickpi.irkeylock"); |
---|
| 4016 | + if ("1".equals(IRKeyProp)) { |
---|
| 4017 | + Log.e(TAG, "IR POWER KEY LOCK"); |
---|
4016 | 4018 | } else { |
---|
4017 | | - interceptPowerKeyUp(event, interactive, canceled); |
---|
| 4019 | + EventLogTags.writeInterceptPower( |
---|
| 4020 | + KeyEvent.actionToString(event.getAction()), |
---|
| 4021 | + mPowerKeyHandled ? 1 : 0, mPowerKeyPressCounter); |
---|
| 4022 | + // Any activity on the power button stops the accessibility shortcut |
---|
| 4023 | + cancelPendingAccessibilityShortcutAction(); |
---|
| 4024 | + result &= ~ACTION_PASS_TO_USER; |
---|
| 4025 | + isWakeKey = false; // wake-up will be handled separately |
---|
| 4026 | + if (down) { |
---|
| 4027 | + interceptPowerKeyDown(event, interactive); |
---|
| 4028 | + } else { |
---|
| 4029 | + interceptPowerKeyUp(event, interactive, canceled); |
---|
| 4030 | + } |
---|
4018 | 4031 | } |
---|
4019 | 4032 | break; |
---|
4020 | 4033 | } |
---|