IR红外功能,多么基础的功能,但是说来也不简单
因为,小小的红外看似基础,实则设计太多东西了,
从关机涉及Uboot;到内核kernel键码上报;到android键码的实现,小小的功能涉及大大的范围;
(101条消息) rk3288-android8-IR-mouse_旋风旋风的博客-CSDN博客
大家可以看一下我之前的博客可以知道调试过程,下面进入正题:
1.修改代码让uboot实现IR可关机
2.修改代码让关机小窗口可以选中;
上述是uboot遥控开机的内容
下面是关机到uboot
Index: reboot.c
===================================================================
--- reboot.c (revision 101)
+++ reboot.c (working copy)
@@ -16,6 +16,8 @@
#include <linux/syscalls.h>
#include <linux/syscore_ops.h>
#include <linux/uaccess.h>
+#include <linux/gpio.h>
+#include <linux/of_gpio.h>
/*
* this indicates whether you can reboot with ctrl-alt-del: the default is yes
@@ -275,6 +277,12 @@
*/
void kernel_power_off(void)
{
+
+ printk("fan kernel_power_off\n");
+ gpio_direction_output(160,0);
+ gpio_direction_output(161,1);
+ kernel_restart("charge");
+
kernel_shutdown_prepare(SYSTEM_POWER_OFF);
if (pm_power_off_prepare)
pm_power_off_prepare();
然后是关机弹窗焦点问题
这个弹窗遥控器是选不中的
diff --git a/services/core/java/com/android/server/policy/GlobalActions.java b/services/core/java/com/android/server/policy/GlobalActions.java
index f34dc52..b858903 100644
--- a/services/core/java/com/android/server/policy/GlobalActions.java
+++ b/services/core/java/com/android/server/policy/GlobalActions.java
@@ -64,7 +64,7 @@ class GlobalActions implements GlobalActionsListener {
mShowing = true;
boolean isTvProduct = SystemProperties.get("ro.target.product","unknown").equals("atv") ||
SystemProperties.get("ro.target.product","unknown").equals("box");
- if (mStatusBarConnected && !isTvProduct) {
+ if (false) {
mStatusBarInternal.showGlobalActions();
mHandler.postDelayed(mShowTimeout, 5000);
} else {
然后关机窗口就变了
然后输入法无法选中问题
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index f28cc1a..a131732 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -7101,7 +7101,7 @@ public final class ViewRootImpl implements ViewParent,
}
if (stage != null) {
- handleWindowFocusChanged();
+ //handleWindowFocusChanged();
stage.deliver(q);
} else {
finishInputEvent(q);