+++ b/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
@@ -114,6 +114,7 @@ import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.function.BiConsumer;
+import android.os.SystemProperties;
/**
* A layout which handles a dynamic amount of notifications and presents them in a scrollable stack.
@@ -717,7 +718,11 @@ public class NotificationStackScrollLayout extends ViewGroup
}
private void setMaxLayoutHeight(int maxLayoutHeight) {
- mMaxLayoutHeight = maxLayoutHeight;
+ if(SystemProperties.get("persist.sys.notification.enable", "1").equals("0")){
+ mMaxLayoutHeight = 0;
+ }else {
+ mMaxLayoutHeight = maxLayoutHeight;
+ }
mShelf.setMaxLayoutHeight(maxLayoutHeight);
updateAlgorithmHeightAndPadding();
}
@@ -2590,9 +2595,13 @@ public class NotificationStackScrollLayout extends ViewGroup
} else {
mTopPaddingOverflow = 0;
}
- setTopPadding(ignoreIntrinsicPadding ? topPadding : clampPadding(topPadding),
- animate);
- setExpandedHeight(mExpandedHeight);
+ if(SystemProperties.get("persist.sys.notification.enable", "1").equals("0")){
+ setTopPadding(-500,animate);
+ }else {
+ setTopPadding(ignoreIntrinsicPadding ? topPadding : clampPadding(topPadding),
+ animate);
+ setExpandedHeight(mExpandedHeight);
+ }
}
:
在device项目对应的目录下的System.prop文件声明 persist.sys.notification.enable = 0