Fixing issue with broadcast being sent before boot completed.
Bug: 15444478
Bug: 15109101
Change-Id: I0fd5d32761c84ff237bce8328f23907bbf12ee6a
diff --git a/packages/SystemUI/src/com/android/systemui/recent/Recents.java b/packages/SystemUI/src/com/android/systemui/recent/Recents.java
index 0cc09c8..116d755d 100644
--- a/packages/SystemUI/src/com/android/systemui/recent/Recents.java
+++ b/packages/SystemUI/src/com/android/systemui/recent/Recents.java
@@ -61,6 +61,11 @@
@Override
protected void onBootCompleted() {
+ if (mUseAlternateRecents) {
+ if (mAlternateRecents != null) {
+ mAlternateRecents.onBootCompleted();
+ }
+ }
mBootCompleted = true;
}
diff --git a/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java b/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
index bb19415..2f6d58f 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
@@ -153,6 +153,7 @@
Messenger mService = null;
Messenger mMessenger;
RecentsMessageHandler mHandler;
+ boolean mBootCompleted = false;
boolean mServiceIsBound = false;
boolean mToggleRecentsUponServiceBound;
RecentsServiceConnection mConnection = new RecentsServiceConnection();
@@ -182,6 +183,10 @@
bindToRecentsService(false);
}
+ public void onBootCompleted() {
+ mBootCompleted = true;
+ }
+
/** Shows the recents */
public void onShowRecents(boolean triggeredFromAltTab, View statusBarView) {
if (Console.Enabled) {
@@ -208,7 +213,7 @@
if (Console.Enabled) {
Console.log(Constants.Log.App.RecentsComponent, "[RecentsComponent|hideRecents]");
}
- if (mServiceIsBound) {
+ if (mServiceIsBound && mBootCompleted) {
// Notify recents to close it
try {
Bundle data = new Bundle();
@@ -278,7 +283,7 @@
/** Updates each of the task animation rects. */
void updateAnimationRects() {
- if (mServiceIsBound) {
+ if (mServiceIsBound && mBootCompleted) {
Resources res = mContext.getResources();
int statusBarHeight = res.getDimensionPixelSize(
com.android.internal.R.dimen.status_bar_height);