界面效果图
源代码路径:
frameworks/base/ore/res/res/values-zh-rCN/strings.xml
frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java
设置正在启动…字段文字路径
frameworks/base/ore/res/res/values-zh-rCN/strings.xml
<string name="android_start_title" msgid="8418054686415318207">"设备正在启动…"</string>
设置正在启动…弹出对话框的处理
frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java
ProgressDialog mBootMsgDialog = null;
/** {@inheritDoc} */
@Override
public void showBootMessage(final CharSequence msg, final boolean always) {
mHandler.post(new Runnable() {
@Override public void run() {
if (mBootMsgDialog == null) {
int theme;
if (mContext.getPackageManager().hasSystemFeature(FEATURE_LEANBACK)) {
theme = com.android.internal.R.style.Theme_Leanback_Dialog_Alert;
} else {
theme = 0;
}
mBootMsgDialog = new ProgressDialog(mContext, theme) {
// This dialog will consume all events coming in to
// it, to avoid it trying to do things too early in boot.
@Override public boolean dispatchKeyEvent(KeyEvent event) {
return true;
}
@Override public boolean dispatchKeyShortcutEvent(KeyEvent event) {
return true;
}
@Override public boolean dispatchTouchEvent(MotionEvent ev) {
return true;
}
@Override public boolean dispatchTrackballEvent(MotionEvent ev) {
return true;
}
@Override public boolean dispatchGenericMotionEvent(MotionEvent ev) {
return true;
}
@Override public boolean dispatchPopulateAccessibilityEvent(
AccessibilityEvent event) {
return true;
}
};
if (mContext.getPackageManager().isUpgrade()) {
mBootMsgDialog.setTitle(R.string.android_upgrading_title);
} else {
mBootMsgDialog.setTitle(R.string.android_start_title);
}
mBootMsgDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
mBootMsgDialog.setIndeterminate(true);
mBootMsgDialog.getWindow().setType(
WindowManager.LayoutParams.TYPE_BOOT_PROGRESS);
mBootMsgDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_DIM_BEHIND
| WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN);
mBootMsgDialog.getWindow().setDimAmount(1);
WindowManager.LayoutParams lp = mBootMsgDialog.getWindow().getAttributes();
lp.screenOrientation = ActivityInfo.SCREEN_ORIENTATION_NOSENSOR;
mBootMsgDialog.getWindow().setAttributes(lp);
mBootMsgDialog.setCancelable(false);
mBootMsgDialog.show();
}
mBootMsgDialog.setMessage(msg);
}
});
}