Android P 禁止SystemUI 下拉状态栏和通知栏

时间:2025-01-28 09:09:15

1.未锁屏时禁止状态栏和通知栏下拉
vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/keyguard/

@@ -2179,7 +2179,7 @@ public class KeyguardViewMediator extends SystemUI {
                         + " isSecure=" + isSecure() + " force=" + forceHideHomeRecentsButtons
                         +  " --> flags=0x" + (flags));
             }
-
+            flags = StatusBarManager.DISABLE_EXPAND;
             (flags);
         }
     }

中不显示通知信息的icon。
vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/statusbar/phone/

@@ -162,7 +162,8 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
             if ((state1 & DISABLE_NOTIFICATION_ICONS) != 0) {
                 hideNotificationIconArea(animate);
             } else {
-                showNotificationIconArea(animate);
+                //showNotificationIconArea(animate);
+                hideNotificationIconArea(animate);
             }
         }

3.锁屏时禁止状态栏下拉
vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/statusbar/phone/

@@ -908,7 +908,7 @@ public class NotificationPanelView extends PanelView implements
         if (!isFullyCollapsed()) {
             handleQsDown(event);
         }
-        if (!mQsExpandImmediate && mQsTracking) {
+        if (!mKeyguardShowing && !mQsExpandImmediate && mQsTracking) {
             onQsTouch(event);
             if (!mConflictingQsExpansionGesture) {
                 return true;
@@ -1114,6 +1114,9 @@ public class NotificationPanelView extends PanelView implements
     }
 
     private void setQsExpanded(boolean expanded) {
+        if (mKeyguardShowing) {
+            return;
+        }
         boolean changed = mQsExpanded != expanded;
         if (changed) {
             mQsExpanded = expanded;
@@ -1508,7 +1511,7 @@ public class NotificationPanelView extends PanelView implements
         if (!mQsExpansionEnabled || mCollapsedOnDown) {
             return false;
         }
-        View header = mKeyguardShowing ? mKeyguardStatusBar : ();
+        View header = /*mKeyguardShowing ? mKeyguardStatusBar :*/ ();
         final boolean onHeader = x >= ()
                 && x <= () + ()
                 && y >= () && y <= ();

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

@@ -4239,7 +4239,7 @@ public class StatusBar extends SystemUI implements DemoMode,
     /* Only ever called as a consequence of a lockscreen expansion gesture. */
     @Override
     public boolean onDraggedDown(View startingChild, int dragLengthY) {
-        if (mState == 
+        if (mState ==  && false
                 && hasActiveNotifications() && (!isDozing() || isPulsing())) {
             (
                     MetricsEvent.ACTION_LS_SHADE,

4.锁屏时隐藏通知栏的显示
vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/statusbar/stack/

@@ -717,7 +717,8 @@ public class NotificationStackScrollLayout extends ViewGroup
     }
 
     private void setMaxLayoutHeight(int maxLayoutHeight) {
-        mMaxLayoutHeight = maxLayoutHeight;
+        //mMaxLayoutHeight = maxLayoutHeight;
+        mMaxLayoutHeight = 0;
         (maxLayoutHeight);
         updateAlgorithmHeightAndPadding();
     }
@@ -2590,9 +2591,10 @@ public class NotificationStackScrollLayout extends ViewGroup
         } else {
             mTopPaddingOverflow = 0;
         }
-        setTopPadding(ignoreIntrinsicPadding ? topPadding : clampPadding(topPadding),
-                animate);
-        setExpandedHeight(mExpandedHeight);
+        //setTopPadding(ignoreIntrinsicPadding ? topPadding : clampPadding(topPadding),
+        //        animate);
+        //setExpandedHeight(mExpandedHeight);
+        setTopPadding(-500,animate);
     }