测试平台
Platform: RK3399
OS: Android 8.1/9.0/10.0
现象
Android从8.1开始系统支持两种形式的关机菜单,传统的关机菜单与新版的关机菜单(如下图所示)
但是新关机菜单对红外遥控不支持,我们选择始终使用传统关机菜单。
解决方法
diff --git a/frameworks/base/services/core/java/com/android/server/policy/GlobalActions.java b/frameworks/base/services/core/java/com/android/server/policy/GlobalActions.java
index f34dc52..4a886fb 100644
--- a/frameworks/base/services/core/java/com/android/server/policy/GlobalActions.java
+++ b/frameworks/base/services/core/java/com/android/server/policy/GlobalActions.java
@@ -62,16 +62,18 @@ class GlobalActions implements GlobalActionsListener {
mKeyguardShowing = keyguardShowing;
mDeviceProvisioned = deviceProvisioned;
mShowing = true;
- boolean isTvProduct = SystemProperties.get("ro.target.product","unknown").equals("atv") ||
- SystemProperties.get("ro.target.product","unknown").equals("box");
- if (mStatusBarConnected && !isTvProduct) {
- mStatusBarInternal.showGlobalActions();
- mHandler.postDelayed(mShowTimeout, 5000);
- } else {
- // SysUI isn't alive, show legacy menu.
- ensureLegacyCreated();
- mLegacyGlobalActions.showDialog(mKeyguardShowing, mDeviceProvisioned);
- }
+ //boolean isTvProduct = SystemProperties.get("ro.target.product","unknown").equals("atv") ||
+ // SystemProperties.get("ro.target.product","unknown").equals("box");
+ //if (mStatusBarConnected && !isTvProduct) {
+ // mStatusBarInternal.showGlobalActions();
+ // mHandler.postDelayed(mShowTimeout, 5000);
+ //} else {
+ // // SysUI isn't alive, show legacy menu.
+ // ensureLegacyCreated();
+ // mLegacyGlobalActions.showDialog(mKeyguardShowing, mDeviceProvisioned);
+ //}
+ ensureLegacyCreated();
+ mLegacyGlobalActions.showDialog(mKeyguardShowing, mDeviceProvisioned);
}