当通知栏消息大于等于三条时,下拉两次通知栏,"通知设置"/“清除”按钮失效
事件冲突导致
解决事件冲突,修改事件获取优先级
/frameworks/base / packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
@Override
public boolean onTouchEvent(MotionEvent event) {
....
---------------------------------------
if(MotionEvent.ACTION_UP == event.getAction()) {
mStatusBar.performNotificationShelfClick(event.getRawX(), event.getRawY());
}
------------------
}
/frameworks/base / packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
public void performNotificationShelfClick(float x, float y) {
View settingView = mNotificationShelf.getNotiSettingsButtonView();
RectF setRect = getViewLocation(settingView);
if(setRect.contains(x, y)) {
settingView.performClick();
return;
}
View clearView = mNotificationShelf.getClearAllButtonView();
RectF clearRect = getViewLocation(clearView);
if(clearRect.contains(x, y)) {
clearView.performClick();
return;
}
}
private RectF getViewLocation(View v) {
int[] location = new int[2];
v.getLocationOnScreen(location);
return new RectF(location[0],location[1],location[0] + v.getWidth(),location[1] + v.getHeight());
}
}