Revert "Bump up preloading recents on boot up to user unlocked." am: 501d59dcea
am: 1fb2e3db87
Change-Id: I5036fb13c02b91ec13138eba86b6bd9f617ed552
diff --git a/packages/SystemUI/src/com/android/systemui/recents/Recents.java b/packages/SystemUI/src/com/android/systemui/recents/Recents.java
index 7207463..5b25f052 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/Recents.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/Recents.java
@@ -18,12 +18,10 @@
import android.app.ActivityManager;
import android.app.UiModeManager;
-import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
-import android.content.IntentFilter;
import android.content.ServiceConnection;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
@@ -99,7 +97,7 @@
// and does not reside in the home stack.
private String mOverrideRecentsPackageName;
- private Handler mHandler = new Handler();
+ private Handler mHandler;
private RecentsImpl mImpl;
private int mDraggingInRecentsCurrentUser;
@@ -165,20 +163,6 @@
}
};
-
- private BroadcastReceiver mSystemUserUnlockedReceiver = new BroadcastReceiver() {
- @Override
- public void onReceive(Context context, Intent intent) {
- if (Intent.ACTION_USER_UNLOCKED.equals(intent.getAction())) {
- int userId = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, UserHandle.USER_NULL);
- if (userId != UserHandle.USER_NULL) {
- mImpl.onUserUnlocked(userId);
- }
- }
- }
- };
-
-
/**
* Returns the callbacks interface that non-system users can call.
*/
@@ -208,7 +192,7 @@
sSystemServicesProxy = SystemServicesProxy.getInstance(mContext);
sTaskLoader = new RecentsTaskLoader(mContext);
sConfiguration = new RecentsConfiguration(mContext);
-
+ mHandler = new Handler();
UiModeManager uiModeManager = (UiModeManager) mContext.
getSystemService(Context.UI_MODE_SERVICE);
if (uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_TELEVISION) {
@@ -238,12 +222,6 @@
// For the system user, initialize an instance of the interface that we can pass to the
// secondary user
mSystemToUserCallbacks = new RecentsSystemUser(mContext, mImpl);
-
- // Listen for user-unlocked to kick off preloading recents
- IntentFilter filter = new IntentFilter();
- filter.addAction(Intent.ACTION_USER_UNLOCKED);
- mContext.registerReceiverAsUser(mSystemUserUnlockedReceiver, UserHandle.SYSTEM, filter,
- null /* permission */, null /* scheduler */);
} else {
// For the secondary user, bind to the primary user's service to get a persistent
// interface to register its implementation and to later update its state
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java
index a412966..42d1b61 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java
@@ -187,7 +187,7 @@
reloadResources();
}
- public void onUserUnlocked(int userId) {
+ public void onBootCompleted() {
// When we start, preload the data associated with the previous recent tasks.
// We can use a new plan since the caches will be the same.
RecentsTaskLoader loader = Recents.getTaskLoader();
@@ -200,10 +200,6 @@
loader.loadTasks(mContext, plan, launchOpts);
}
- public void onBootCompleted() {
- // Do nothing
- }
-
public void onConfigurationChanged() {
Resources res = mContext.getResources();
reloadResources();