路径:frameworks/base/services/core/java/com/android/server/policy/GlobalActions.java

【思路】


  • 1、自定义一个对话框去替换
  • 2、使用旧版的对话框

这里我们选择最快的方法使用旧版对话框去显示

public void showDialog(boolean keyguardShowing, boolean deviceProvisioned) {
if (DEBUG) Slog.d(TAG, "showDialog " + keyguardShowing + " " + deviceProvisioned);
if (mGlobalActionsProvider != null && mGlobalActionsProvider.isGlobalActionsDisabled()) {
return;
}
mKeyguardShowing = keyguardShowing;
mDeviceProvisioned = deviceProvisioned;
mShowing = true;
if (mGlobalActionsAvailable && !"box".equals(SystemProperties.get("ro.target.product","unkonw"))) {
++ // mHandler.postDelayed(mShowTimeout, 5000);
++ // mGlobalActionsProvider.showGlobalActions();
++ // } else {
++ // SysUI isn't alive, show legacy menu.
ensureLegacyCreated();
mLegacyGlobalActions.showDialog(mKeyguardShowing, mDeviceProvisioned);
}
}