文章出处:http://blog.chinaunix.net/uid/30230931.html
作者联系方式:JonLee
针对不同行业应用,Android系统个性化需求五花八门,何以解忧,唯有coding,仅此一记之。
- commit a57f4fa72648133be623ef9d452fdbc0095ee143
- Author: JonLee <409775514@qq.com>
- Date: Thu Apr 19 22:42:34 2018 +0800
- 禁止状态栏下拉动作,禁止弹出通知栏和快捷菜单栏
- diff --git a/android/device/softwinner/alpaca/alpaca.mk b/android/device/softwinner/alpaca/alpaca.mk
- index 8317bb5..8e75f6d 100755
- --- a/android/device/softwinner/alpaca/alpaca.mk
- +++ b/android/device/softwinner/alpaca/alpaca.mk
- @@ -116,7 +116,8 @@ PRODUCT_PROPERTY_OVERRIDES += \
- persist.sys.language=zh \
- persist.sys.country=CN \
- persist.sys.browser_homepage=https://www.baidu.com \
- - ro.sf.rotation=90
- + ro.sf.rotation=90 \
- + persist.sys.disdropstatusbar=false
-
- PRODUCT_PACKAGES += Bluetooth
-
- diff --git a/android/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java b/android/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java
- index a3e35d1..0eb80a5 100644
- --- a/android/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java
- +++ b/android/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java
- @@ -24,6 +24,7 @@ import android.view.View;
- import android.widget.FrameLayout;
-
- import java.util.ArrayList;
- +import android.os.SystemProperties;
-
- public class PanelBar extends FrameLayout {
- public static final boolean DEBUG = false;
- @@ -135,6 +136,9 @@ public class PanelBar extends FrameLayout {
-
- // called from PanelView when self-expanding, too
- public void startOpeningPanel(PanelView panel) {
- + if (SystemProperties.getBoolean("persist.sys.disdropstatusbar", false)) {
- + return;
- + }
- if (DEBUG) LOG("startOpeningPanel: " + panel);
- mTouchingPanel = panel;
- mPanelHolder.setSelectedPanel(mTouchingPanel);
- diff --git a/android/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java b/android/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java
- index 4901823..92d3af0 100644
- --- a/android/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java
- +++ b/android/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java
- @@ -32,7 +32,7 @@ import com.android.systemui.ExpandHelper;
- import com.android.systemui.R;
- import com.android.systemui.statusbar.BaseStatusBar;
- import com.android.systemui.statusbar.policy.NotificationRowLayout;
- -
- +import android.os.SystemProperties;
-
- public class StatusBarWindowView extends FrameLayout
- {
- @@ -87,6 +87,9 @@ public class StatusBarWindowView extends FrameLayout
-
- @Override
- public boolean onInterceptTouchEvent(MotionEvent ev) {
- + if (SystemProperties.getBoolean("persist.sys.disdropstatusbar", false)) {
- + return true;
- + }
- boolean intercept = false;
- if (mNotificationPanel.isFullyExpanded() && mScrollView.getVisibility() == View.VISIBLE) {
- intercept = mExpandHelper.onInterceptTouchEvent(ev);
- @@ -124,7 +127,11 @@ public class StatusBarWindowView extends FrameLayout
- super.onDraw(canvas);
- if (DEBUG) {
- Paint pt = new Paint();
- - pt.setColor(0x80FFFF00);
- + if (SystemProperties.getBoolean("persist.sys.disdropstatusbar", false)) {
- + pt.setColor(0x00000000);
- + } else {
- + pt.setColor(0x80FFFF00);
- + }
- pt.setStrokeWidth(12.0f);
- pt.setStyle(Paint.Style.STROKE);
- canvas.drawRect(0, 0, canvas.getWidth(), canvas.getHeight(), pt);
更改之后效果如图: