Android11系统去掉截屏功能

  1. 去掉Settings里截屏菜单条目,packages/apps/Settings:
java 复制代码
diff --git a/res/xml/top_level_settings.xml b/res/xml/top_level_settings.xml
old mode 100644
new mode 100755
index a5e4d06..a9420bb
--- a/res/xml/top_level_settings.xml
+++ b/res/xml/top_level_settings.xml
@@ -125,13 +125,13 @@
         android:fragment="com.android.settings.accessibility.AccessibilitySettings"
         settings:controller="com.android.settings.accessibility.TopLevelAccessibilityPreferenceController"/>
 
-    <Preference
+    <!-- Preference
         android:key="top_level_screenshot"
         android:title="@string/screenshot_manager"
         android:summary="@string/screenshot_manager"
         android:icon="@drawable/ic_homepage_screenshot"
         android:order="-10"
-        android:fragment="com.android.settings.ScreenshotSettings"/>
+        android:fragment="com.android.settings.ScreenshotSettings"/ -->
 
     <Preference
         android:key="top_level_system"
  1. 去掉power键+音量减键组合截屏功能,frameworks/base:
java 复制代码
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java
index 95c532e..3f4ebe8 100755
--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -966,7 +966,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                 && (event.getFlags() & KeyEvent.FLAG_FALLBACK) == 0) {
             mScreenshotChordPowerKeyTriggered = true;
             mScreenshotChordPowerKeyTime = event.getDownTime();
-            interceptScreenshotChord();
+            //interceptScreenshotChord();
             interceptRingerToggleChord();
         }
 
@@ -3841,7 +3841,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                             mScreenshotChordVolumeDownKeyTime = event.getDownTime();
                             mScreenshotChordVolumeDownKeyConsumed = false;
                             cancelPendingPowerKeyAction();
-                            interceptScreenshotChord();
+                            //interceptScreenshotChord();
                             interceptAccessibilityShortcutChord();
                         }
                     } else {
相关推荐
L***d67012 分钟前
Spring Boot 各种事务操作实战(自动回滚、手动回滚、部分回滚)
java·数据库·spring boot
凌波粒13 分钟前
Springboot基础教程(3)--自动装配原理/静态资源处理/欢迎页
java·spring boot·后端
likuolei15 分钟前
XSL-FO 软件
java·开发语言·前端·数据库
凌波粒15 分钟前
SpringBoot基础教程(2)--yaml/配置文件注入/数据校验/多环境配置
java·spring boot·后端·spring
S***267517 分钟前
Spring Boot环境配置
java·spring boot·后端
6***830518 分钟前
什么是Spring Boot 应用开发?
java·spring boot·后端
毕设源码柳学姐23 分钟前
计算机毕设 java 智慧社区服务系统 SSM 框架社区生活平台 Java 开发的便民服务与互动系统
java·开发语言·生活
U***l83226 分钟前
【postgresql】分区表管理
java·数据库·postgresql
倚肆26 分钟前
MyBatis-Plus Mapper 接口方法详解
java·mybatis
n***786827 分钟前
SpringBoot详解
java·spring boot·后端