1000字范文,内容丰富有趣,学习的好帮手!
1000字范文 > Android 10 禁止SystemUI 下拉状态栏和通知栏

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

时间:2019-01-31 17:26:13

相关推荐

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

1、未锁屏时禁止状态栏和通知栏下拉

代码路径:

frameworks/base/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java

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

2、StatusBar中不显示通知信息的icon。

代码路径:

frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragment.java

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

3、锁屏时禁止状态栏下拉

代码路径:

frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java

@@ -908,7 +908,7 @@ public class NotificationPanelView extends PanelView implementsif (!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 implementsif (!mQsExpansionEnabled || mCollapsedOnDown) {return false;}- View header = mKeyguardShowing ? mKeyguardStatusBar : mQs.getHeader();+ View header = /*mKeyguardShowing ? mKeyguardStatusBar :*/ mQs.getHeader();final boolean onHeader = x >= mQsFrame.getX()&& x <= mQsFrame.getX() + mQsFrame.getWidth()&& y >= header.getTop() && y <= header.getBottom();

frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java

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

4、锁屏时隐藏通知栏的显示

代码路径:

frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java

@@ -717,7 +717,8 @@ public class NotificationStackScrollLayout extends ViewGroup}private void setMaxLayoutHeight(int maxLayoutHeight) {- mMaxLayoutHeight = maxLayoutHeight;+ //mMaxLayoutHeight = maxLayoutHeight;+ mMaxLayoutHeight = 0;mShelf.setMaxLayoutHeight(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);}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。