Android 取消锁屏及下拉菜单

需求

  • android7.1 屏蔽锁屏,系统启动后直接进入桌面
  • 屏蔽下拉,无法通过桌面顶部下拉菜单进行设置

patch

  • 禁止锁屏
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    diff --git a/frameworks/base/packages/SettingsProvider/res/values/defaults.xml b/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
    index f4cefc2..7734cfd 100644 (file)
    --- a/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
    +++ b/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
    @@ -80,7 +80,7 @@
    <string name="def_trusted_sound" translatable="false">/system/media/audio/ui/Trusted.ogg</string>
    <string name="def_wireless_charging_started_sound" translatable="false">/system/media/audio/ui/WirelessChargingStarted.ogg</string>

    - <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>
  • 屏蔽通知栏下拉
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
diff --git a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
index c80b3ad..4df6860 100644
--- a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
+++ b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
@@ -121,17 +121,20 @@ public class PhoneStatusBarView extends PanelBar {

@Override
public boolean onTouchEvent(MotionEvent event) {
- boolean barConsumedEvent = mBar.interceptTouchEvent(event);
-
- if (DEBUG_GESTURES) {
- if (event.getActionMasked() != MotionEvent.ACTION_MOVE) {
- EventLog.writeEvent(EventLogTags.SYSUI_PANELBAR_TOUCH,
- event.getActionMasked(), (int) event.getX(), (int) event.getY(),
- barConsumedEvent ? 1 : 0);
- }
- }
-
- return barConsumedEvent || super.onTouchEvent(event);
+ return true;
+/*
+ * boolean barConsumedEvent = mBar.interceptTouchEvent(event);
+ *
+ * if (DEBUG_GESTURES) {
+ * if (event.getActionMasked() != MotionEvent.ACTION_MOVE) {
+ * EventLog.writeEvent(EventLogTags.SYSUI_PANELBAR_TOUCH,
+ * event.getActionMasked(), (int) event.getX(), (int) event.getY(),
+ * barConsumedEvent ? 1 : 0);
+ * }
+ * }
+ *
+ * return barConsumedEvent || super.onTouchEvent(event);
+ */
}

@Override
(END)
您的支持将鼓励我继续创作!