项目有需求,禁用状态栏下拉菜单
修改方法
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
/*返回false禁用,返回true启用*/
@Override
public boolean panelEnabled() {
return mCommandQueue.panelsEnabled(); //修改该方法的实现逻辑即可
}
补充(虚拟导航栏禁用下拉)
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
@@ -1348,7 +1349,11 @@ public class NavigationBarView extends FrameLayout implements
if(!mStatusBar.isPresenterFullyCollapsed()) {
mStatusBarManager.collapsePanels();
} else {
- mStatusBarManager.expandNotificationsPanel();
+ boolean panelEnable = Settings.Global.getInt(mContext.getContentResolver(),
+ Settings.Global.NOTIFICATION_PANEL_ENABLE, 1)==1?true:false;
+ if(panelEnable){
+ mStatusBarManager.expandNotificationsPanel();
+ }
}
}
}