Commit 6b811691 authored by Peter Kotwicz's avatar Peter Kotwicz Committed by Commit Bot

[Android WebAPK] Fix showing lightweight FRE on WebAPK launch

Previously, if a user:
- with the --enable-lightweight-fre command line flag
- who has not previously gone through the first run experience
tried to launch a WebAPK the WebAPK did not launch and the FRE was not
shown.

This was occurring due to Intent.FLAG_ACTIVITY_NEW_TASK not being set
as part of the FRE launch intent. (The caller is
WebappLauncherActivity).

This CL:
- Makes LightweightFirstRunActivity "singleInstance" like
FirstRunActivity
- Removes LightweightFirstRunActivity-only logic which finishes the
current
  LightweightFirstRunActivity if one is already running

BUG=738133

Change-Id: Ifff19eb505f91efa5ea38ba2069f6159be7e7d4f
Reviewed-on: https://chromium-review.googlesource.com/563864Reviewed-by: default avatarYaron Friedman <yfriedman@chromium.org>
Reviewed-by: default avatarBernhard Bauer <bauerb@chromium.org>
Reviewed-by: default avatarGanggui Tang <gogerald@chromium.org>
Commit-Queue: Yaron Friedman <yfriedman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486840}
parent 4c865be6
......@@ -409,7 +409,7 @@ by a child template that "extends" this file.
</activity>
<activity android:name="org.chromium.chrome.browser.firstrun.LightweightFirstRunActivity"
android:theme="@style/SimpleDialog"
android:launchMode="singleTop"
android:launchMode="singleInstance"
android:autoRemoveFromRecents="true"
android:windowSoftInputMode="stateHidden|adjustPan"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize">
......
......@@ -376,17 +376,10 @@ public abstract class FirstRunFlowSequencer {
List<WeakReference<Activity>> activities = ApplicationStatus.getRunningActivities();
for (WeakReference<Activity> weakActivity : activities) {
Activity activity = weakActivity.get();
if (activity == null) {
continue;
} else if (activity instanceof LightweightFirstRunActivity) {
// A Generic or a new Lightweight First Run Experience will be launched
// below, so finish the old Lightweight First Run Experience.
activity.setResult(Activity.RESULT_CANCELED);
activity.finish();
continue;
} else if (activity instanceof FirstRunActivity) {
if (activity instanceof FirstRunActivity
&& !(activity instanceof LightweightFirstRunActivity)) {
isGenericFreActive = true;
continue;
break;
}
}
......
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