Commit 6d00b3ba authored by tedchoc's avatar tedchoc Committed by Commit bot

Add workaround to remove elderberry tabs from recents (pre-L).

BUG=644953

Review-Url: https://codereview.chromium.org/2319963002
Cr-Commit-Position: refs/heads/master@{#417146}
parent b7c7b6b7
......@@ -22,6 +22,8 @@ import org.chromium.chrome.browser.webapps.ActivityAssigner;
* limited number of activities that we will cycle through.
*/
public class SeparateTaskManagedCustomTabActivity extends SeparateTaskCustomTabActivity {
private static final String FORCE_FINISH = "CCT.ForceFinish";
// Time at which an intent was received and handled.
private long mIntentHandlingTimeMs = 0;
......@@ -38,6 +40,10 @@ public class SeparateTaskManagedCustomTabActivity extends SeparateTaskCustomTabA
@Override
public void onNewIntent(Intent intent) {
mIntentHandlingTimeMs = SystemClock.uptimeMillis();
if (intent != null && intent.getBooleanExtra(FORCE_FINISH, false)) {
finish();
return;
}
super.onNewIntent(intent);
}
......@@ -80,4 +86,13 @@ public class SeparateTaskManagedCustomTabActivity extends SeparateTaskCustomTabA
String indexString = className.substring(baseClassName.length());
return Integer.parseInt(indexString);
}
@Override
public void finishAndClose() {
Intent intent = new Intent(getIntent());
intent.setFlags(intent.getFlags() & ~Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
intent.putExtra(FORCE_FINISH, true);
startActivity(intent);
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment