5.1状态栏要禁止下拉请按如下方案修改:
PanelBar.java(alps\frameworks\base\packages\SystemUI\src\com\android\systemui\statusbar\phone)中的两个方法。
public void startOpeningPanel(PanelView panel) {
//begin 添加下面三行
if(XXX){
return;
}
//end
if (DEBUG) LOG("startOpeningPanel: " + panel);
mTouchingPanel = panel;
mPanelHolder.setSelectedPanel(mTouchingPanel);
for (PanelView pv : mPanels) {
if (pv != panel) {
pv.collapse(false /* delayed */);
}
}
}
(1)
private void setQsExpanded(boolean expanded) {
if(mKeyguardShowing)
{
return;
}
boolean changed = mQsExpanded != expanded;
if (changed) {
mQsExpanded = expanded;
updateQsState();
requestPanelHeightUpdate();
mNotificationStackScroller.setInterceptDelegateEnabled(expanded);
mStatusBar.setQsExpanded(expanded);
}
}
(2)
private boolean shouldQuickSettingsIntercept(float x, float y, float yDiff) {
if (!mQsExpansionEnabled) {
return false;
}
View header = mHeader;
&& y >= header.getTop() && y <= header.getBottom();
if (mQsExpanded) {
return onHeader || (mScrollView.isScrolledToBottom() && yDiff < 0) && isInQsArea(x, y);
} else {
return onHeader;
}
}
{
...
if (!mQsExpandImmediate && mQsTracking) {
if(!mKeyguardShowing){
onQsTouch(event);
if (!mConflictingQsExpansionGesture) {
return true;
}
}
}
...
}
滑动锁屏状态下如何禁止下拉状态栏?
[SOLUTION]
JB/KK
滑动锁屏状态下状态栏可以下拉是google 4.0 默认的设计。如果要禁止此功能,请修改
请修改KeyguardViewMediator.java的adjustStatusBarLocked()方法,将
if (isSecure() || !ENABLE_INSECURE_STATUS_BAR_EXPAND) {
// showing secure lockscreen; disable expanding.
flags |= StatusBarManager.DISABLE_EXPAND;
}
修改为:
if (isSecure() || ENABLE_INSECURE_STATUS_BAR_EXPAND) {
// showing secure lockscreen; disable expanding.
flags |= StatusBarManager.DISABLE_EXPAND;
}
L上
(1)
private void setQsExpanded(boolean expanded) {
if(mKeyguardShowing)
{
return;
}
boolean changed = mQsExpanded != expanded;
if (changed) {
mQsExpanded = expanded;
updateQsState();
requestPanelHeightUpdate();
mNotificationStackScroller.setInterceptDelegateEnabled(expanded);
mStatusBar.setQsExpanded(expanded);
}
}
(2)
private boolean shouldQuickSettingsIntercept(float x, float y, float yDiff) {
if (!mQsExpansionEnabled) {
return false;
}
View header = mHeader;
&& y >= header.getTop() && y <= header.getBottom();
if (mQsExpanded) {
return onHeader || (mScrollView.isScrolledToBottom() && yDiff < 0) && isInQsArea(x, y);
} else {
return onHeader;
}
}
{
...
if (!mTwoFingerQsExpand && mQsTracking) {
if(!mKeyguardShowing){
onQsTouch(event);
if (!mConflictingQsExpansionGesture) {
return true;
}
}
}
...
}