Android 屏蔽下拉状态栏(StatusBar)

Android 屏蔽下拉状态栏(StatusBar)

最近收到项目需求,需要屏蔽设备下拉状态栏(StatusBar),总结出两种修改方法,具体如下:

第一种:

/vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java

-        if (!mQsExpandImmediate && mQsTracking) {
+        if (!mKeyguardShowing && !mQsExpandImmediate && mQsTracking) {

/vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java

    public boolean panelEnabled() {
+	    if(Settings.System.getInt(getContext().getContentResolver(),"intercept_pull_down", 0) == 1){
+		    return false;
+		}else{
            return mBar.panelsEnabled();
+        }
    }

第二种方法:

/vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
 

 boolean panelsEnabled() {
+        return false;
-        return (mDisabled1 & StatusBarManager.DISABLE_EXPAND) == 0 && !ONLY_CORE_APPS;
    }

重新编译验证,修改生效,下拉状态栏(StatusBar)已屏蔽

你可能感兴趣的:(Android,android)