当前位置: 代码迷 >> 综合 >> [RK3288][Android7.1] 调试笔记 --- 去除android应用沉浸模式弹出的提示“从顶部向下滑动即可退出全屏模式”
  详细解决方案

[RK3288][Android7.1] 调试笔记 --- 去除android应用沉浸模式弹出的提示“从顶部向下滑动即可退出全屏模式”

热度:87   发布时间:2023-10-09 13:22:56.0

Platform: RK3288
OS: Android 7.1.2
Kernel: v4.4.143

问题:

客户的软件第一次进入沉浸模式,会有下图的提示,如果一直不点击确定,重启机器还是会有此现象

Android7.1:

[RK3288][Android7.1] 调试笔记 --- 去除android应用沉浸模式弹出的提示“从顶部向下滑动即可退出全屏模式”

Android5.1:

[RK3288][Android7.1] 调试笔记 --- 去除android应用沉浸模式弹出的提示“从顶部向下滑动即可退出全屏模式”

沉浸模式:

知识点:参考郭霖大神这篇文章

Android状态栏微技巧,带你真正理解沉浸式模式

附上测试demo:

    @Overridepublic void onWindowFocusChanged(boolean hasFocus) {super.onWindowFocusChanged(hasFocus);if (hasFocus && Build.VERSION.SDK_INT >= 19) {View decorView = getWindow().getDecorView();decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION| View.SYSTEM_UI_FLAG_FULLSCREEN| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);}}

实现:

Android7.1 patch

diff --git a/services/core/java/com/android/server/policy/ImmersiveModeConfirmation.java b/services/core/java/com/android/server/policy/ImmersiveModeConfirmation.java
old mode 100644
new mode 100755
index 9bf0476..7623e64
--- a/services/core/java/com/android/server/policy/ImmersiveModeConfirmation.java
+++ b/services/core/java/com/android/server/policy/ImmersiveModeConfirmation.java
@@ -380,7 +380,7 @@ public class ImmersiveModeConfirmation {public void handleMessage(Message msg) {switch(msg.what) {case SHOW:
-                    handleShow();
+                    //handleShow();break;case HIDE:handleHide();

Android5.1 patch

diff --git a/policy/src/com/android/internal/policy/impl/ImmersiveModeConfirmation.java b/policy/src/com/android/internal/policy/impl/ImmersiveModeConfirmation.java
old mode 100644
new mode 100755
index 8fc4647..3091ece
--- a/policy/src/com/android/internal/policy/impl/ImmersiveModeConfirmation.java
+++ b/policy/src/com/android/internal/policy/impl/ImmersiveModeConfirmation.java
@@ -333,7 +333,7 @@ public class ImmersiveModeConfirmation {public void handleMessage(Message msg) {switch(msg.what) {case SHOW:
-                    handleShow();
+                    //handleShow();break;case HIDE:handleHide();

参考:

Android状态栏微技巧,带你真正理解沉浸式模式

  相关解决方案