1.屏蔽锁屏页面从中间位置(时间位置)下拉
路径:SystemUI\src\com\android\systemui\statusbar\notification\stack\NotificationStackScrollLayout.java
@ShadeViewRefactor(RefactorComponent.INPUT)
private final DragDownCallback mDragDownCallback = new DragDownCallback() {
/* Only ever called as a consequence of a lockscreen expansion gesture. */
@Override
public boolean onDraggedDown(View startingChild, int dragLengthY) {
Log.e(TAG, "onDraggedDown: "+mStatusBarState);
// 新增此处代码----start
if (mStatusBarState == StatusBarState.KEYGUARD) {
return false;
}
// 新增此处代码----end
boolean canDragDown = hasActiveNotifications()
|| mKeyguardMediaController.getView().getVisibility() == VISIBLE;
if (mStatusBarState == StatusBarState.KEYGUARD && canDragDown) {
mLockscreenGestureLogger.write(
MetricsEvent.ACTION_LS_SHADE,
(int) (dragLengthY / mDisplayMetrics.density),
0 /* velocityDp - N/A */);
mLockscreenGestureLogger.log(LockscreenUiEvent.LOCKSCREEN_PULL_SHADE_OPEN);
if (!mAmbientState.isDozing() || startingChild != null) {
// We have notifications, go to locked shade.
Dependency.get(ShadeController.class).goToLockedShade(startingChild);
if (startingChild instanceof ExpandableNotificationRow) {
ExpandableNotificationRow row = (ExpandableNotificationRow) startingChild;
row.onExpandedByGesture(true /* drag down is always an open */);
}
}
return true;
} else if (mDynamicPrivacyController.isInLockedDownShade()) {
mStatusbarStateController.setLeaveOpenOnKeyguardHide(true);
mStatusBar.dismissKeyguardThenExecute(() -> false /* dismissAction */,
null /* cancelRunnable */, false /* afterKeyguardGone */);
return true;
} else {
// abort gesture.
return false;
}
}
2.屏蔽状态栏下拉
路径:SystemUI\src\com\android\systemui\statusbar\phone\PhoneStatusBarView.java
@Override
public boolean panelEnabled() {
//修改此处
return false;
//return mCommandQueue.panelsEnabled();
}
3.屏蔽锁屏页面状态下拉
路径:SystemUI\src\com\android\systemui\statusbar\phone\NotificationPanelViewController.java
private void setQsExpansion(float height) {
//新增代码----start
if(mQs != null){
return;
}
//新增代码----end
height = Math.min(Math.max(height, mQsMinExpansionHeight), mQsMaxExpansionHeight);
mQsFullyExpanded = height == mQsMaxExpansionHeight && mQsMaxExpansionHeight != 0;
if (height > mQsMinExpansionHeight && !mQsExpanded && !mStackScrollerOverscrolling
&& !mDozing) {
setQsExpanded(true);
} else if (height <= mQsMinExpansionHeight && mQsExpanded) {
setQsExpanded(false);
}
mQsExpansionHeight = height;
updateQsExpansion();
requestScrollerTopPaddingUpdate(false /* animate */);
updateHeaderKeyguardAlpha();
if (mBarState == StatusBarState.SHADE_LOCKED || mBarState == StatusBarState.KEYGUARD) {
updateKeyguardBottomAreaAlpha();
updateBigClockAlpha();
}
if (mBarState == StatusBarState.SHADE && mQsExpanded && !mStackScrollerOverscrolling
&& mQsScrimEnabled) {
mQsNavbarScrim.setAlpha(getQsExpansionFraction());
}
if (mAccessibilityManager.isEnabled()) {
mView.setAccessibilityPaneTitle(determineAccessibilityPaneTitle());
}
if (!mFalsingManager.isUnlockingDisabled() && mQsFullyExpanded
&& mFalsingManager.shouldEnforceBouncer()) {
mStatusBar.executeRunnableDismissingKeyguard(null, null /* cancelAction */,
false /* dismissShade */, true /* afterKeyguardGone */, false /* deferred */);
}
for (int i = 0; i < mExpansionListeners.size(); i++) {
mExpansionListeners.get(i).onQsExpansionChanged(
mQsMaxExpansionHeight != 0 ? mQsExpansionHeight / mQsMaxExpansionHeight : 0);
}
if (DEBUG) {
mView.invalidate();
}
}