Platform: RK3288
OS: Android 7.1.2
Kernel: v4.4.143
问题:
客户的软件第一次进入沉浸模式,会有下图的提示,如果一直不点击确定,重启机器还是会有此现象
Android7.1:
Android5.1:
沉浸模式:
知识点:参考郭霖大神这篇文章
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状态栏微技巧,带你真正理解沉浸式模式