当前位置:   article > 正文

Android 13 SystemUI 屏蔽导航栏;屏蔽锁屏;隐藏状态栏;禁止状态栏下拉;屏蔽Camera绿色图标;屏蔽原生音量条;屏蔽原生亮度条。_android13 源码 隐藏状态栏

android13 源码 隐藏状态栏

写在前面:本文给出Android 13 手机/平板原生SystemUI 一些实用的屏蔽补丁。

1、屏蔽导航栏

  导航栏屏蔽很简单,直接把创建导航栏的代码屏蔽即可。

代码路径:frameworks\base\packages\SystemUI\src\com\android\systemui\statusbar\phone\CentralSurfacesImpl.java
    // ================================================================================
    // Constructing the view
    // ================================================================================
    protected void makeStatusBarView(@Nullable RegisterStatusBarResult result) {
    	. . . . . .
    	. . . . . .
    	. . . . . .
    	//createNavigationBar(result);//注释这行代码即可
    	. . . . . .
    	. . . . . .
    	. . . . . .

	}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14

2、屏蔽锁屏

diff --git a/frameworks/base/packages/SettingsProvider/res/values/defaults.xml b/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
index 99b15db780..e68bc2f410 100644
--- a/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
+++ b/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
@@ -82,7 +82,7 @@
     <integer name="def_max_sound_trigger_detection_service_ops_per_day" translatable="false">1000</integer>
     <integer name="def_sound_trigger_detection_service_op_timeout" translatable="false">15000</integer>
 
-    <bool name="def_lockscreen_disabled">false</bool>
+    <bool name="def_lockscreen_disabled">true</bool>
     <bool name="def_device_provisioned">false</bool>
     <integer name="def_dock_audio_media_enabled">1</integer>
 
diff --git a/packages/apps/Settings/res/xml/security_settings_picker.xml b/packages/apps/Settings/res/xml/security_settings_picker.xml
index aed702983c..1c4ee9854e 100644
--- a/packages/apps/Settings/res/xml/security_settings_picker.xml
+++ b/packages/apps/Settings/res/xml/security_settings_picker.xml
@@ -24,7 +24,7 @@
             android:icon="@drawable/ic_lock_none"
             android:persistent="false"/>
 
-    <com.android.settingslib.RestrictedPreference
+    <!-- <com.android.settingslib.RestrictedPreference
             android:key="unlock_set_none"
             android:title="@string/unlock_set_unlock_none_title"
             android:icon="@drawable/ic_lock_swipe"
@@ -70,6 +70,6 @@
     <com.android.settingslib.widget.FooterPreference
             android:key="lock_settings_footer"
             android:selectable="false"
-            settings:searchable="false"/>
+            settings:searchable="false"/> -->
 
 </PreferenceScreen>
diff --git a/packages/apps/Settings/src/com/android/settings/password/ChooseLockGeneric.java b/packages/apps/Settings/src/com/android/settings/password/ChooseLockGeneric.java
index 8a4e9bb6c1..a1ca5340e3 100644
--- a/packages/apps/Settings/src/com/android/settings/password/ChooseLockGeneric.java
+++ b/packages/apps/Settings/src/com/android/settings/password/ChooseLockGeneric.java
@@ -656,11 +656,11 @@ public class ChooseLockGeneric extends SettingsActivity {
 
             // Used for testing purposes
             findPreference(ScreenLockType.NONE.preferenceKey).setViewId(R.id.lock_none);
-            findPreference(KEY_SKIP_FINGERPRINT).setViewId(R.id.lock_none);
-            findPreference(KEY_SKIP_FACE).setViewId(R.id.lock_none);
-            findPreference(KEY_SKIP_BIOMETRICS).setViewId(R.id.lock_none);
-            findPreference(ScreenLockType.PIN.preferenceKey).setViewId(R.id.lock_pin);
-            findPreference(ScreenLockType.PASSWORD.preferenceKey).setViewId(R.id.lock_password);
+            // findPreference(KEY_SKIP_FINGERPRINT).setViewId(R.id.lock_none); //xuhao add 
+            // findPreference(KEY_SKIP_FACE).setViewId(R.id.lock_none);
+            // findPreference(KEY_SKIP_BIOMETRICS).setViewId(R.id.lock_none);
+            // findPreference(ScreenLockType.PIN.preferenceKey).setViewId(R.id.lock_pin);
+            // findPreference(ScreenLockType.PASSWORD.preferenceKey).setViewId(R.id.lock_password);
         }
 
         private String getFooterString() {
@@ -686,30 +686,30 @@ public class ChooseLockGeneric extends SettingsActivity {
 
         private void updatePreferenceText() {
             if (mForFingerprint) {
-                setPreferenceTitle(ScreenLockType.PATTERN,
-                        R.string.fingerprint_unlock_set_unlock_pattern);
-                setPreferenceTitle(ScreenLockType.PIN, R.string.fingerprint_unlock_set_unlock_pin);
-                setPreferenceTitle(ScreenLockType.PASSWORD,
-                        R.string.fingerprint_unlock_set_unlock_password);
+                // setPreferenceTitle(ScreenLockType.PATTERN,
+                //         R.string.fingerprint_unlock_set_unlock_pattern);
+                // setPreferenceTitle(ScreenLockType.PIN, R.string.fingerprint_unlock_set_unlock_pin);
+                // setPreferenceTitle(ScreenLockType.PASSWORD,
+                //         R.string.fingerprint_unlock_set_unlock_password);
             } else if (mForFace) {
-                setPreferenceTitle(ScreenLockType.PATTERN,
-                        R.string.face_unlock_set_unlock_pattern);
-                setPreferenceTitle(ScreenLockType.PIN, R.string.face_unlock_set_unlock_pin);
-                setPreferenceTitle(ScreenLockType.PASSWORD,
-                        R.string.face_unlock_set_unlock_password);
+                // setPreferenceTitle(ScreenLockType.PATTERN,
+                //         R.string.face_unlock_set_unlock_pattern);
+                // setPreferenceTitle(ScreenLockType.PIN, R.string.face_unlock_set_unlock_pin);
+                // setPreferenceTitle(ScreenLockType.PASSWORD,
+                //         R.string.face_unlock_set_unlock_password);
             } else if (mForBiometrics) {
-                setPreferenceTitle(ScreenLockType.PATTERN,
-                        R.string.biometrics_unlock_set_unlock_pattern);
-                setPreferenceTitle(ScreenLockType.PIN, R.string.biometrics_unlock_set_unlock_pin);
-                setPreferenceTitle(ScreenLockType.PASSWORD,
-                        R.string.biometrics_unlock_set_unlock_password);
+                // setPreferenceTitle(ScreenLockType.PATTERN,
+                //         R.string.biometrics_unlock_set_unlock_pattern);
+                // setPreferenceTitle(ScreenLockType.PIN, R.string.biometrics_unlock_set_unlock_pin);
+                // setPreferenceTitle(ScreenLockType.PASSWORD,
+                //         R.string.biometrics_unlock_set_unlock_password);
             }
 
             if (mManagedPasswordProvider.isSettingManagedPasswordSupported()) {
-                setPreferenceTitle(ScreenLockType.MANAGED,
-                        mManagedPasswordProvider.getPickerOptionTitle(mForFingerprint));
+                // setPreferenceTitle(ScreenLockType.MANAGED,
+                //         mManagedPasswordProvider.getPickerOptionTitle(mForFingerprint));
             } else {
-                removePreference(ScreenLockType.MANAGED.preferenceKey);
+                //removePreference(ScreenLockType.MANAGED.preferenceKey);
             }
 
             if (!(mForFingerprint && mIsSetNewPassword)) {
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104

3、隐藏状态栏

在这里插入图片描述

4、禁止状态栏下拉

  解锁之后禁止状态栏下拉显示快捷通知、快捷设置。
在这里插入图片描述

5、屏蔽Camera绿色图标

  Android 13 使用摄像头时右上角会有绿色图标,屏蔽方法如下:
在这里插入图片描述
在这里插入图片描述

6、屏蔽原生音量条

frameworks\base\packages\SystemUI\src\com\android\systemui\volume\VolumeDialogImpl.java
在这里插入图片描述

在这里插入图片描述

7、屏蔽原生亮度条

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/496575
推荐阅读
相关标签
  

闽ICP备14008679号