Merge "DO NOT MERGE. Ensure screen pinning UI appears immediately after setting changes." into lmp-mr1-dev

This commit is contained in:
Winson Chung
2015-01-13 18:16:21 +00:00
committed by Android (Google) Code Review
4 changed files with 17 additions and 12 deletions

View File

@@ -642,12 +642,13 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
/** Starts the recents activity */ /** Starts the recents activity */
void startRecentsActivity(ActivityManager.RunningTaskInfo topTask, boolean isTopTaskHome) { void startRecentsActivity(ActivityManager.RunningTaskInfo topTask, boolean isTopTaskHome) {
RecentsTaskLoader loader = RecentsTaskLoader.getInstance();
RecentsConfiguration.reinitialize(mContext, mSystemServicesProxy);
if (sInstanceLoadPlan == null) { if (sInstanceLoadPlan == null) {
// Create a new load plan if onPreloadRecents() was never triggered // Create a new load plan if onPreloadRecents() was never triggered
RecentsTaskLoader loader = RecentsTaskLoader.getInstance();
sInstanceLoadPlan = loader.createLoadPlan(mContext); sInstanceLoadPlan = loader.createLoadPlan(mContext);
} }
RecentsTaskLoader loader = RecentsTaskLoader.getInstance();
loader.preloadTasks(sInstanceLoadPlan, isTopTaskHome); loader.preloadTasks(sInstanceLoadPlan, isTopTaskHome);
TaskStack stack = sInstanceLoadPlan.getTaskStack(); TaskStack stack = sInstanceLoadPlan.getTaskStack();

View File

@@ -361,12 +361,11 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
// For the non-primary user, ensure that the SystemSericesProxy is initialized // For the non-primary user, ensure that the SystemServicesProxy and configuration is
// initialized
RecentsTaskLoader.initialize(this); RecentsTaskLoader.initialize(this);
SystemServicesProxy ssp = RecentsTaskLoader.getInstance().getSystemServicesProxy();
// Initialize the loader and the configuration mConfig = RecentsConfiguration.reinitialize(this, ssp);
mConfig = RecentsConfiguration.reinitialize(this,
RecentsTaskLoader.getInstance().getSystemServicesProxy());
// Initialize the widget host (the host id is static and does not change) // Initialize the widget host (the host id is static and does not change)
mAppWidgetHost = new RecentsAppWidgetHost(this, Constants.Values.App.AppWidgetHostId); mAppWidgetHost = new RecentsAppWidgetHost(this, Constants.Values.App.AppWidgetHostId);
@@ -421,9 +420,6 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
super.onNewIntent(intent); super.onNewIntent(intent);
setIntent(intent); setIntent(intent);
// Reinitialize the configuration
RecentsConfiguration.reinitialize(this, RecentsTaskLoader.getInstance().getSystemServicesProxy());
// Clear any debug rects // Clear any debug rects
if (mDebugOverlay != null) { if (mDebugOverlay != null) {
mDebugOverlay.clear(); mDebugOverlay.clear();
@@ -450,6 +446,12 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
// Update the recent tasks // Update the recent tasks
updateRecentsTasks(getIntent()); updateRecentsTasks(getIntent());
// If this is a new instance from a configuration change, then we have to manually trigger
// the enter animation state
if (mConfig.launchedHasConfigurationChanged) {
onEnterAnimationTriggered();
}
} }
@Override @Override

View File

@@ -252,6 +252,8 @@ public class TaskStack {
if (group.getTaskCount() == 0) { if (group.getTaskCount() == 0) {
removeGroup(group); removeGroup(group);
} }
// Update the lock-to-app state
t.lockToThisTask = false;
if (mCb != null) { if (mCb != null) {
// Notify that a task has been removed // Notify that a task has been removed
mCb.onStackTaskRemoved(this, t, null); mCb.onStackTaskRemoved(this, t, null);
@@ -480,4 +482,4 @@ public class TaskStack {
} }
return str; return str;
} }
} }

View File

@@ -542,7 +542,7 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV
loader.deleteTaskData(t, false); loader.deleteTaskData(t, false);
// Remove the old task from activity manager // Remove the old task from activity manager
RecentsTaskLoader.getInstance().getSystemServicesProxy().removeTask(t.key.id); loader.getSystemServicesProxy().removeTask(t.key.id);
} }
@Override @Override