说明
车机要求禁止状态栏的通知栏下拉,以下是该需求的实现。
实现
zhoujy@TP:~/data/android/sc826_cn_01_00/msm_8953_git/frameworks$ git show 824d2bc48b61da7403b370011e83fae5cba2cdfe
commit 824d2bc48b61da7403b370011e83fae5cba2cdfe
Author: zhoujinyan <zhoujy@ibumobile.com>
Date: Sun Jun 28 19:44:13 2020 +0800
[SystemUI]禁止下拉状态栏
diff --git a/device/qcom/msm8953_64/system.prop b/device/qcom/msm8953_64/system.prop
index 52ca082..d9c8669 100755
--- a/device/qcom/msm8953_64/system.prop
+++ b/device/qcom/msm8953_64/system.prop
@@ -208,4 +208,4 @@ ro.cutoff_voltage_mv=3400
persist.debug.set.fixedfps=25
#add by zhoujinyan
ro.sf.lcd_density=160
-
+ro.lock.qs.enable=false
diff --git a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
index 9c700b4..c073c1a 100644
--- a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
+++ b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
@@ -66,7 +66,8 @@ import com.android.systemui.statusbar.stack.NotificationStackScrollLayout;
import com.android.systemui.statusbar.stack.StackStateAnimator;
import java.util.List;
-
+import android.os.SystemProperties;
+import android.util.Log;
public class NotificationPanelView extends PanelView implements
ExpandableView.OnHeightChangedListener,
View.OnClickListener, NotificationStackScrollLayout.OnOverscrollTopChangedListener,
@@ -497,7 +498,12 @@ public class NotificationPanelView extends PanelView implements
@Override
public void resetViews() {
mIsLaunchTransitionFinished = false;
- mBlockTouches = false;
+ if(!SystemProperties.getBoolean("ro.lock.qs.enable", true)) {
+ mBlockTouches = true;
+ } else {
+ mBlockTouches = false;
+ }
+ // mBlockTouches = false;
mUnlockIconActive = false;
if (!mLaunchingAffordance) {
mAfforanceHelper.reset(false);
@@ -778,7 +784,13 @@ public class NotificationPanelView extends PanelView implements
if (!isFullyCollapsed()) {
handleQsDown(event);
}
- if (!mQsExpandImmediate && mQsTracking) {
+ boolean notificationShow = !mQsExpandImmediate && mQsTracking;
+ Log.d("Nofication","zjy handleQsTouch notificationShow:"+notificationShow);
+ if(!SystemProperties.getBoolean("ro.lock.qs.enable", true)) {
+ notificationShow = !mKeyguardShowing && !mQsExpandImmediate && mQsTracking;
+ Log.d("Nofication","zjy handleQsTouch notificationShow2:"+notificationShow);
+ }
+ if (notificationShow) {
onQsTouch(event);
if (!mConflictingQsExpansionGesture) {
return true;
@@ -981,6 +993,11 @@ public class NotificationPanelView extends PanelView implements
}
private void setQsExpanded(boolean expanded) {
+ Log.d("Notification", "zjy setQsExpanded expanded:"+expanded);
+ if(!SystemProperties.getBoolean("ro.lock.qs.enable" ,true)) {
+ Log.d("Notification", "zjy setQsExpanded mKeyguardShowing:"+mKeyguardShowing);
+ if(mKeyguardShowing) return;
+ }
boolean changed = mQsExpanded != expanded;
if (changed) {
mQsExpanded = expanded;
@@ -1356,6 +1373,11 @@ public class NotificationPanelView extends PanelView implements
return false;
}
View header = mKeyguardShowing ? mKeyguardStatusBar : mQsContainer.getHeader();
+ Log.d("Notification", "zjy shouldQuickSettingsIntercept header:"+header);
+ if(!SystemProperties.getBoolean("ro.lock.qs.enable" ,true)) {
+ header = mQsContainer.getHeader();
+ Log.d("Notification", "zjy shouldQuickSettingsIntercept header2:"+header);
+ }
boolean onHeader = x >= mQsAutoReinflateContainer.getX()
&& x <= mQsAutoReinflateContainer.getX() + mQsAutoReinflateContainer.getWidth()
&& y >= header.getTop() && y <= header.getBottom();
diff --git a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index 4b694a0..af1b28d 100755
--- a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -4703,7 +4703,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
/* Only ever called as a consequence of a lockscreen expansion gesture. */
@Override
public boolean onDraggedDown(View startingChild, int dragLengthY) {
- if (hasActiveNotifications()) {
+ if (hasActiveNotifications() && SystemProperties.getBoolean("ro.lock.qs.enable", true)) {
EventLogTags.writeSysuiLockscreenGesture(
EventLogConstants.SYSUI_LOCKSCREEN_GESTURE_SWIPE_DOWN_FULL_SHADE,
(int) (dragLengthY / mDisplayMetrics.density),