|
22 | 22 | import android.app.ActivityManagerNative; |
23 | 23 | import android.app.AppOpsManager; |
24 | 24 | import android.app.IUiModeManager; |
25 | | -import android.app.KeyguardManager; |
26 | | -import android.app.ProgressDialog; |
27 | 25 | import android.app.SearchManager; |
28 | 26 | import android.app.StatusBarManager; |
29 | 27 | import android.app.UiModeManager; |
|
37 | 35 | import android.content.IntentFilter; |
38 | 36 | import android.content.ServiceConnection; |
39 | 37 | import android.content.pm.ActivityInfo; |
| 38 | +import android.content.pm.ApplicationInfo; |
40 | 39 | import android.content.pm.PackageManager; |
41 | 40 | import android.content.pm.ResolveInfo; |
42 | 41 | import android.content.res.CompatibilityInfo; |
|
138 | 137 | import com.android.server.policy.keyguard.KeyguardServiceDelegate; |
139 | 138 | import com.android.server.policy.keyguard.KeyguardServiceDelegate.DrawnListener; |
140 | 139 |
|
| 140 | +import org.cyanogenmod.internal.BootDexoptDialog; |
| 141 | + |
141 | 142 | import java.io.File; |
142 | 143 | import java.io.FileReader; |
143 | 144 | import java.io.IOException; |
@@ -7014,68 +7015,18 @@ public void systemBooted() { |
7014 | 7015 | screenTurnedOn(); |
7015 | 7016 | } |
7016 | 7017 |
|
7017 | | - ProgressDialog mBootMsgDialog = null; |
| 7018 | + BootDexoptDialog mBootMsgDialog = null; |
7018 | 7019 |
|
7019 | 7020 | /** {@inheritDoc} */ |
7020 | 7021 | @Override |
7021 | | - public void showBootMessage(final CharSequence msg, final boolean always) { |
| 7022 | + public void updateBootProgress(final int stage, final ApplicationInfo optimizedApp, |
| 7023 | + final int currentAppPos, final int totalAppCount) { |
7022 | 7024 | mHandler.post(new Runnable() { |
7023 | 7025 | @Override public void run() { |
7024 | 7026 | if (mBootMsgDialog == null) { |
7025 | | - int theme; |
7026 | | - if (mContext.getPackageManager().hasSystemFeature( |
7027 | | - PackageManager.FEATURE_WATCH)) { |
7028 | | - theme = com.android.internal.R.style.Theme_Micro_Dialog_Alert; |
7029 | | - } else if (mContext.getPackageManager().hasSystemFeature( |
7030 | | - PackageManager.FEATURE_TELEVISION)) { |
7031 | | - theme = com.android.internal.R.style.Theme_Leanback_Dialog_Alert; |
7032 | | - } else { |
7033 | | - theme = 0; |
7034 | | - } |
7035 | | - |
7036 | | - mBootMsgDialog = new ProgressDialog(mContext, theme) { |
7037 | | - // This dialog will consume all events coming in to |
7038 | | - // it, to avoid it trying to do things too early in boot. |
7039 | | - @Override public boolean dispatchKeyEvent(KeyEvent event) { |
7040 | | - return true; |
7041 | | - } |
7042 | | - @Override public boolean dispatchKeyShortcutEvent(KeyEvent event) { |
7043 | | - return true; |
7044 | | - } |
7045 | | - @Override public boolean dispatchTouchEvent(MotionEvent ev) { |
7046 | | - return true; |
7047 | | - } |
7048 | | - @Override public boolean dispatchTrackballEvent(MotionEvent ev) { |
7049 | | - return true; |
7050 | | - } |
7051 | | - @Override public boolean dispatchGenericMotionEvent(MotionEvent ev) { |
7052 | | - return true; |
7053 | | - } |
7054 | | - @Override public boolean dispatchPopulateAccessibilityEvent( |
7055 | | - AccessibilityEvent event) { |
7056 | | - return true; |
7057 | | - } |
7058 | | - }; |
7059 | | - if (mContext.getPackageManager().isUpgrade()) { |
7060 | | - mBootMsgDialog.setTitle(R.string.android_upgrading_title); |
7061 | | - } else { |
7062 | | - mBootMsgDialog.setTitle(R.string.android_start_title); |
7063 | | - } |
7064 | | - mBootMsgDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); |
7065 | | - mBootMsgDialog.setIndeterminate(true); |
7066 | | - mBootMsgDialog.getWindow().setType( |
7067 | | - WindowManager.LayoutParams.TYPE_BOOT_PROGRESS); |
7068 | | - mBootMsgDialog.getWindow().addFlags( |
7069 | | - WindowManager.LayoutParams.FLAG_DIM_BEHIND |
7070 | | - | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN); |
7071 | | - mBootMsgDialog.getWindow().setDimAmount(1); |
7072 | | - WindowManager.LayoutParams lp = mBootMsgDialog.getWindow().getAttributes(); |
7073 | | - lp.screenOrientation = ActivityInfo.SCREEN_ORIENTATION_NOSENSOR; |
7074 | | - mBootMsgDialog.getWindow().setAttributes(lp); |
7075 | | - mBootMsgDialog.setCancelable(false); |
7076 | | - mBootMsgDialog.show(); |
7077 | | - } |
7078 | | - mBootMsgDialog.setMessage(msg); |
| 7027 | + mBootMsgDialog = BootDexoptDialog.create(mContext); |
| 7028 | + } |
| 7029 | + mBootMsgDialog.setProgress(stage, optimizedApp, currentAppPos, totalAppCount); |
7079 | 7030 | } |
7080 | 7031 | }); |
7081 | 7032 | } |
|
0 commit comments