前言
隐藏下拉菜单还是很常见的作法,在此记录一下
平台:RK3368
Android版本:8.1
方法
路径:frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
修改:
/**
* State is one or more of the DISABLE constants from StatusBarManager.
*/
@Override
public void disable(int state1, int state2, boolean animate) {
animate &= mStatusBarWindowState != WINDOW_STATE_HIDDEN;
mDisabledUnmodified1 = state1;
mDisabledUnmodified2 = state2;
final int old1 = mDisabled1;
final int diff1 = state1 ^ old1;
//mDisabled1 = state1; //add StatusBarManager.DISABLE_EXPAND
mDisabled1 = state1 | StatusBarManager.DISABLE_EXPAND;
final int old2 = mDisabled2;
final int diff2 = state2 ^ old2;
mDisabled2 = state2;
if (DEBUG) {
Log.d(TAG, String.format("disable1: 0x%08x -> 0x%08x (diff1: 0x%08x)",
old1, state1, diff1));
Log.d(TAG, String.format("disable2: 0x%08x -> 0x%08x (diff2: 0x%08x)",
old2, state2, diff2));