Merge "Removing multiwindow debug flag."
This commit is contained in:
@@ -116,9 +116,8 @@ public class Recents extends SystemUI
|
||||
|
||||
/** Preloads the next task */
|
||||
public void run() {
|
||||
// Temporarily skip this if multi stack is enabled
|
||||
if (mConfig.multiWindowEnabled) return;
|
||||
|
||||
// TODO: Temporarily skip this if multi stack is enabled
|
||||
/*
|
||||
RecentsConfiguration config = RecentsConfiguration.getInstance();
|
||||
if (config.svelteLevel == RecentsConfiguration.SVELTE_NONE) {
|
||||
RecentsTaskLoader loader = RecentsTaskLoader.getInstance();
|
||||
@@ -127,7 +126,7 @@ public class Recents extends SystemUI
|
||||
|
||||
// Load the next task only if we aren't svelte
|
||||
RecentsTaskLoadPlan plan = loader.createLoadPlan(mContext);
|
||||
loader.preloadTasks(plan, true /* isTopTaskHome */);
|
||||
loader.preloadTasks(plan, true);
|
||||
RecentsTaskLoadPlan.Options launchOpts = new RecentsTaskLoadPlan.Options();
|
||||
// This callback is made when a new activity is launched and the old one is paused
|
||||
// so ignore the current activity and try and preload the thumbnail for the
|
||||
@@ -141,6 +140,7 @@ public class Recents extends SystemUI
|
||||
launchOpts.onlyLoadPausedActivities = true;
|
||||
loader.loadTasks(mContext, plan, launchOpts);
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -111,22 +111,11 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
// Finish Recents
|
||||
if (mLaunchIntent != null) {
|
||||
try {
|
||||
if (mLaunchOpts != null) {
|
||||
startActivityAsUser(mLaunchIntent, mLaunchOpts.toBundle(), UserHandle.CURRENT);
|
||||
} else {
|
||||
startActivityAsUser(mLaunchIntent, UserHandle.CURRENT);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Console.logError(RecentsActivity.this,
|
||||
getString(R.string.recents_launch_error_message, "Home"));
|
||||
}
|
||||
} else {
|
||||
finish();
|
||||
overridePendingTransition(R.anim.recents_to_launcher_enter,
|
||||
R.anim.recents_to_launcher_exit);
|
||||
try {
|
||||
startActivityAsUser(mLaunchIntent, mLaunchOpts.toBundle(), UserHandle.CURRENT);
|
||||
} catch (Exception e) {
|
||||
Console.logError(RecentsActivity.this,
|
||||
getString(R.string.recents_launch_error_message, "Home"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -144,7 +133,7 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
|
||||
dismissRecentsToFocusedTaskOrHome(false);
|
||||
} else if (intent.getBooleanExtra(Recents.EXTRA_TRIGGERED_FROM_HOME_KEY, false)) {
|
||||
// Otherwise, dismiss Recents to Home
|
||||
dismissRecentsToHomeRaw(true);
|
||||
dismissRecentsToHome(true);
|
||||
} else {
|
||||
// Do nothing
|
||||
}
|
||||
@@ -170,7 +159,7 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
|
||||
String action = intent.getAction();
|
||||
if (action.equals(Intent.ACTION_SCREEN_OFF)) {
|
||||
// When the screen turns off, dismiss Recents to Home
|
||||
dismissRecentsToHome(false);
|
||||
dismissRecentsToHomeIfVisible(false);
|
||||
} else if (action.equals(SearchManager.INTENT_GLOBAL_SEARCH_ACTIVITY_CHANGED)) {
|
||||
// When the search activity changes, update the search widget view
|
||||
SystemServicesProxy ssp = RecentsTaskLoader.getInstance().getSystemServicesProxy();
|
||||
@@ -286,25 +275,28 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
|
||||
if (mRecentsView.launchFocusedTask()) return true;
|
||||
// If we launched from Home, then return to Home
|
||||
if (launchState.launchedFromHome) {
|
||||
dismissRecentsToHomeRaw(true);
|
||||
dismissRecentsToHome(true);
|
||||
return true;
|
||||
}
|
||||
// Otherwise, try and return to the Task that Recents was launched from
|
||||
if (mRecentsView.launchPreviousTask()) return true;
|
||||
// If none of the other cases apply, then just go Home
|
||||
dismissRecentsToHomeRaw(true);
|
||||
dismissRecentsToHome(true);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Dismisses Recents directly to Home. */
|
||||
void dismissRecentsToHomeRaw(boolean animated) {
|
||||
/**
|
||||
* Dismisses Recents directly to Home without checking whether it is currently visible.
|
||||
*/
|
||||
void dismissRecentsToHome(boolean animated) {
|
||||
if (animated) {
|
||||
ReferenceCountedTrigger exitTrigger = new ReferenceCountedTrigger(this,
|
||||
null, mFinishLaunchHomeRunnable, null);
|
||||
mRecentsView.startExitToHomeAnimation(
|
||||
new ViewAnimation.TaskViewExitContext(exitTrigger));
|
||||
mScrimViews.startExitRecentsAnimation();
|
||||
} else {
|
||||
mFinishLaunchHomeRunnable.run();
|
||||
}
|
||||
@@ -317,11 +309,11 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
|
||||
}
|
||||
|
||||
/** Dismisses Recents directly to Home if we currently aren't transitioning. */
|
||||
boolean dismissRecentsToHome(boolean animated) {
|
||||
boolean dismissRecentsToHomeIfVisible(boolean animated) {
|
||||
SystemServicesProxy ssp = RecentsTaskLoader.getInstance().getSystemServicesProxy();
|
||||
if (ssp.isRecentsTopMost(ssp.getTopMostTask(), null)) {
|
||||
// Return to Home
|
||||
dismissRecentsToHomeRaw(animated);
|
||||
dismissRecentsToHome(animated);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -421,7 +413,6 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
MetricsLogger.hidden(this, MetricsLogger.OVERVIEW_ACTIVITY);
|
||||
RecentsActivityLaunchState launchState = mConfig.getLaunchState();
|
||||
RecentsTaskLoader loader = RecentsTaskLoader.getInstance();
|
||||
SystemServicesProxy ssp = loader.getSystemServicesProxy();
|
||||
Recents.notifyVisibilityChanged(this, ssp, false);
|
||||
@@ -438,6 +429,7 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
|
||||
// Workaround for b/22542869, if the RecentsActivity is started again, but without going
|
||||
// through SystemUI, we need to reset the config launch flags to ensure that we do not
|
||||
// wait on the system to send a signal that was never queued.
|
||||
RecentsActivityLaunchState launchState = mConfig.getLaunchState();
|
||||
launchState.launchedFromHome = false;
|
||||
launchState.launchedFromSearchHome = false;
|
||||
launchState.launchedFromAppWithThumbnail = false;
|
||||
@@ -560,7 +552,7 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
|
||||
@Override
|
||||
public void onTaskLaunchFailed() {
|
||||
// Return to Home
|
||||
dismissRecentsToHomeRaw(true);
|
||||
dismissRecentsToHome(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -78,7 +78,6 @@ public class RecentsConfiguration {
|
||||
public int searchBarSpaceHeightPx;
|
||||
|
||||
/** Dev options and global settings */
|
||||
public boolean multiWindowEnabled;
|
||||
public boolean lockToAppEnabled;
|
||||
|
||||
/** Private constructor */
|
||||
@@ -115,7 +114,6 @@ public class RecentsConfiguration {
|
||||
// settings or via multi window
|
||||
lockToAppEnabled = ssp.getSystemSetting(context,
|
||||
Settings.System.LOCK_TO_APP_ENABLED) != 0;
|
||||
multiWindowEnabled = "true".equals(ssp.getSystemProperty("persist.sys.debug.multi_window"));
|
||||
hasDockedTasks = ssp.hasDockedTask();
|
||||
|
||||
// Recompute some values based on the given state, since we can not rely on the resource
|
||||
|
||||
@@ -235,11 +235,9 @@ public class RecentsResizeTaskDialog extends DialogFragment {
|
||||
|
||||
// In debug mode, we force all task to be resizeable regardless of the
|
||||
// current app configuration.
|
||||
if (RecentsConfiguration.getInstance().multiWindowEnabled) {
|
||||
for (int i = additionalTasks; i >= 0; --i) {
|
||||
if (mTasks[i] != null) {
|
||||
mSsp.setTaskResizeable(mTasks[i].key.id);
|
||||
}
|
||||
for (int i = additionalTasks; i >= 0; --i) {
|
||||
if (mTasks[i] != null) {
|
||||
mSsp.setTaskResizeable(mTasks[i].key.id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1296,9 +1296,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
|
||||
RecentsTaskLoader.getInstance().loadTaskData(task);
|
||||
|
||||
// If the doze trigger has already fired, then update the state for this task view
|
||||
if (mUIDozeTrigger.hasTriggered() || mConfig.multiWindowEnabled) {
|
||||
tv.setNoUserInteractionState();
|
||||
}
|
||||
tv.setNoUserInteractionState();
|
||||
|
||||
// If we've finished the start animation, then ensure we always enable the focus animations
|
||||
if (mStartEnterAnimationCompleted) {
|
||||
|
||||
@@ -627,8 +627,12 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
|
||||
|
||||
/** Compute the dim as a function of the scale of this view. */
|
||||
int getDimFromTaskProgress() {
|
||||
// TODO: Temporarily disable the dim on the stack
|
||||
/*
|
||||
float dim = mMaxDimScale * mDimInterpolator.getInterpolation(1f - mTaskProgress);
|
||||
return (int) (dim * 255);
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** Update the dim as a function of the scale of this view. */
|
||||
|
||||
@@ -244,11 +244,9 @@ public class TaskViewHeader extends FrameLayout
|
||||
mLightDismissDrawable : mDarkDismissDrawable);
|
||||
mDismissButton.setContentDescription(String.format(mDismissContentDescription,
|
||||
t.contentDescription));
|
||||
mMoveTaskButton.setVisibility((mConfig.multiWindowEnabled) ? View.VISIBLE : View.INVISIBLE);
|
||||
if (mConfig.multiWindowEnabled) {
|
||||
updateResizeTaskBarIcon(t);
|
||||
mMoveTaskButton.setOnClickListener(this);
|
||||
}
|
||||
updateResizeTaskBarIcon(t);
|
||||
mMoveTaskButton.setVisibility(View.VISIBLE);
|
||||
mMoveTaskButton.setOnClickListener(this);
|
||||
|
||||
// In accessibility, a single click on the focused app info button will show it
|
||||
AccessibilityManager am = (AccessibilityManager) getContext().
|
||||
@@ -263,10 +261,7 @@ public class TaskViewHeader extends FrameLayout
|
||||
mTask = null;
|
||||
mApplicationIcon.setImageDrawable(null);
|
||||
mApplicationIcon.setOnClickListener(null);
|
||||
|
||||
if (mConfig.multiWindowEnabled) {
|
||||
mMoveTaskButton.setOnClickListener(null);
|
||||
}
|
||||
mMoveTaskButton.setOnClickListener(null);
|
||||
}
|
||||
|
||||
/** Updates the resize task bar button. */
|
||||
|
||||
Reference in New Issue
Block a user