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 {
相关推荐
装不满的克莱因瓶14 分钟前
【Redis经典面试题六】Redis的持久化机制是怎样的?
java·数据库·redis·持久化·aof·rdb
n北斗22 分钟前
常用类晨考day15
java
骇客野人25 分钟前
【JAVA】JAVA接口公共返回体ResponseData封装
java·开发语言
yuanbenshidiaos1 小时前
c++---------数据类型
java·jvm·c++
向宇it2 小时前
【从零开始入门unity游戏开发之——C#篇25】C#面向对象动态多态——virtual、override 和 base 关键字、抽象类和抽象方法
java·开发语言·unity·c#·游戏引擎
带电的小王2 小时前
WhisperKit: Android 端测试 Whisper -- Android手机(Qualcomm GPU)部署音频大模型
android·智能手机·whisper·qualcomm
Lojarro2 小时前
【Spring】Spring框架之-AOP
java·mysql·spring
莫名其妙小饼干2 小时前
网上球鞋竞拍系统|Java|SSM|VUE| 前后端分离
java·开发语言·maven·mssql
梦想平凡2 小时前
PHP 微信棋牌开发全解析:高级教程
android·数据库·oracle
isolusion2 小时前
Springboot的创建方式
java·spring boot·后端