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 {
相关推荐
腥臭腐朽的日子熠熠生辉3 分钟前
解决maven失效问题(现象:maven中只有jdk的工具包,没有springboot的包)
java·spring boot·maven
Harrison_zhu4 分钟前
Ubuntu18.04 编译 Android7.1代码报错
android
ejinxian5 分钟前
Spring AI Alibaba 快速开发生成式 Java AI 应用
java·人工智能·spring
杉之10 分钟前
SpringBlade 数据库字段的自动填充
java·笔记·学习·spring·tomcat
圈圈编码30 分钟前
Spring Task 定时任务
java·前端·spring
俏布斯43 分钟前
算法日常记录
java·算法·leetcode
27669582921 小时前
美团民宿 mtgsig 小程序 mtgsig1.2 分析
java·python·小程序·美团·mtgsig·mtgsig1.2·美团民宿
爱的叹息1 小时前
Java 连接 Redis 的驱动(Jedis、Lettuce、Redisson、Spring Data Redis)分类及对比
java·redis·spring
程序猿chen1 小时前
《JVM考古现场(十五):熵火燎原——从量子递归到热寂晶壁的代码涅槃》
java·jvm·git·后端·java-ee·区块链·量子计算
松韬2 小时前
Spring + Redisson:从 0 到 1 搭建高可用分布式缓存系统
java·redis·分布式·spring·缓存