Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(196)

Issue 2762873003: Fix: long-tapping a WebAPK in recents shows Chrome.

Created:
3 years, 9 months ago by Xi Han
Modified:
3 years, 8 months ago
Reviewers:
Ted C, pkotwicz, Yaron, Yusuf, gone
CC:
chromium-reviews, dominickn+watch_chromium.org, pkotwicz+watch_chromium.org, zpeng+watch_chromium.org, agrieve+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix: long-tapping a WebAPK in recents shows Chrome. The icon shown in the recents is the application icon of the root activity in the task stack. For WebApks, the root activity is WebApkActivity, which is a Chrome's activity. Therefore, ChromeApplication's icon and title are shown instead. To fix this, we need to make one of the WebAPK's activity be the root acitvity and lives in the same task stack with WebApkActivity. Therefore, we have to remove android:documentLaunchMode="InfoExisting" attribute from WebApkActivity, since this attribute makes the WebApkActivity always be instanciated in a new task, not in the same task stack of WebAPK's activity. Besides, we keep WebAPK's main activity unchanged, but we will launch another activity, called ShellActivity on L+. The ShellActivity will remains in the recents. We also increase the shell_version, which will result in updates of all existing installed WebAPKs after WebAPK Server synced with the shell_apk changes. To not break existing WebAPKs, we check the shell APK version in WebappLauncherActivity and add proper flag when creating a launch Intent for WebAPKs. This CL fix the bug on L+. New version of WebAPKs will be fixed directly, existing installed WebAPKs which will be fixed after updating to the new version. BUG=700157

Patch Set 1 : 1 #

Patch Set 2 #

Total comments: 4

Patch Set 3 : dfalcantara@'s comments. #

Patch Set 4 : Fix on K. #

Total comments: 4

Patch Set 5 : Fix on post L only. #

Patch Set 6 : Update shell_apk version. #

Patch Set 7 : Change back to CLEAR_TOP flag. #

Total comments: 10

Patch Set 8 : yfriedman@'s comments. #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+112 lines, -324 lines) Patch
M chrome/android/java/AndroidManifest.xml View 1 2 3 4 1 chunk +0 lines, -1 line 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java View 1 2 3 4 5 6 7 2 chunks +24 lines, -3 lines 1 comment Download
M chrome/android/webapk/shell_apk/AndroidManifest.xml View 1 2 3 4 5 6 7 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/android/webapk/shell_apk/BUILD.gn View 1 2 3 4 5 6 7 2 chunks +3 lines, -1 line 0 comments Download
D chrome/android/webapk/shell_apk/junit/src/org/chromium/webapk/shell_apk/MainActivityTest.java View 1 2 3 4 1 chunk +0 lines, -100 lines 0 comments Download
A + chrome/android/webapk/shell_apk/junit/src/org/chromium/webapk/shell_apk/RecentsPlaceholderActivityTest.java View 1 2 3 4 5 6 7 3 chunks +6 lines, -6 lines 0 comments Download
M chrome/android/webapk/shell_apk/shell_apk_version.gni View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
A + chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/LaunchWebApkHelper.java View 1 2 3 4 5 6 7 10 chunks +34 lines, -51 lines 0 comments Download
M chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/MainActivity.java View 1 2 3 4 5 6 7 2 chunks +13 lines, -161 lines 1 comment Download
A chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/RecentsPlaceholderActivity.java View 1 2 3 4 5 6 7 1 chunk +27 lines, -0 lines 1 comment Download

Messages

Total messages: 31 (16 generated)
gone
https://codereview.chromium.org/2762873003/diff/80001/chrome/android/java/AndroidManifest.xml File chrome/android/java/AndroidManifest.xml (left): https://codereview.chromium.org/2762873003/diff/80001/chrome/android/java/AndroidManifest.xml#oldcode567 chrome/android/java/AndroidManifest.xml:567: android:documentLaunchMode="intoExisting" Removing this flag means you can end up ...
3 years, 9 months ago (2017-03-22 22:20:07 UTC) #9
gone
https://codereview.chromium.org/2762873003/diff/80001/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java File chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java (right): https://codereview.chromium.org/2762873003/diff/80001/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java#newcode176 chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java:176: } else { On 2017/03/22 22:20:07, dfalcantara (load balance ...
3 years, 9 months ago (2017-03-22 22:23:28 UTC) #10
Xi Han
Hi Dan, PTAL, thanks!
3 years, 9 months ago (2017-03-23 15:24:17 UTC) #12
Yaron
I don't know this stuff well enough to know whether this could cause other issues ...
3 years, 9 months ago (2017-03-23 15:29:54 UTC) #14
Xi Han
+yusufo@ and tedchoc@: Do you have any idea why the WebApkActivity{i} behaviors differently from SeparateTaskCustomTabActivity{i}? ...
3 years, 9 months ago (2017-03-23 21:07:42 UTC) #16
Ted C
What do you mean SeparateTaskCustomTabActivity behaves differently from WebApkActivity? SeparateTaskCustomTabActivity is only NEW_TASK so I ...
3 years, 9 months ago (2017-03-23 23:16:08 UTC) #17
Xi Han
On 2017/03/23 23:16:08, Ted C wrote: > What do you mean SeparateTaskCustomTabActivity behaves differently from ...
3 years, 9 months ago (2017-03-24 16:05:24 UTC) #18
Xi Han
https://codereview.chromium.org/2762873003/diff/140001/chrome/android/java/AndroidManifest.xml File chrome/android/java/AndroidManifest.xml (right): https://codereview.chromium.org/2762873003/diff/140001/chrome/android/java/AndroidManifest.xml#newcode578 chrome/android/java/AndroidManifest.xml:578: android:launchMode="singleTop" On 2017/03/23 23:16:07, Ted C wrote: > The ...
3 years, 9 months ago (2017-03-24 16:05:36 UTC) #19
Xi Han
I have update my CL and description. PTAL, thanks!
3 years, 8 months ago (2017-03-28 18:21:48 UTC) #23
Yaron
I'm not familiar with this stuff enough to know whether the extra activity is needed ...
3 years, 8 months ago (2017-03-29 14:07:34 UTC) #24
Xi Han
Hi Yaron, PTAL, thanks! https://codereview.chromium.org/2762873003/diff/230001/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java File chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java (right): https://codereview.chromium.org/2762873003/diff/230001/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java#newcode170 chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java:170: launchIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK On 2017/03/29 14:07:33, Yaron ...
3 years, 8 months ago (2017-03-29 15:16:44 UTC) #26
gone
https://codereview.chromium.org/2762873003/diff/270001/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java File chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java (right): https://codereview.chromium.org/2762873003/diff/270001/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java#newcode162 chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java:162: > SHELL_APK_VERSION_BEFORE_REMOVE_DOCUMENT_LAUNCH_MODE) { This conditional logic should be a ...
3 years, 8 months ago (2017-03-29 18:48:41 UTC) #27
pkotwicz
I am still looking at this CL. This CL breaks opening the WebAPK at a ...
3 years, 8 months ago (2017-03-29 20:20:11 UTC) #29
pkotwicz
This CL makes the launch intent sent by the WebAPK too complex. I dread documenting ...
3 years, 8 months ago (2017-03-30 03:13:05 UTC) #30
Yaron
3 years, 8 months ago (2017-03-30 14:09:55 UTC) #31
On 2017/03/30 03:13:05, pkotwicz wrote:
> This CL makes the launch intent sent by the WebAPK too complex. I dread
> documenting this intent so that non-Chrome browsers can implement WebAPK
> functionality. Can we leave things as is?
> 
The status quo doesn't work on recent versions of Android. That doesn't mean we
need this solution but we definitely need to do something. Additionally, a lot
of this is implementation details of the WebApk. I agree that we want to have a
clear rule for what the browser needs to do. Currently it appears that they will
only need to unconditionally perform CLEAR_TOP because they won't have to worry
about legacy.

> In order to support deep links, you will need to pass Intent#getDataString()
as
> an extra to RecentsPlaceholderActivity.java You can't pass it as the data
string
> because that will not play nicely with the intent matching done by
> Intent.FLAG_ACTIVITY_NEW_DOCUMENT
> I don't have a better suggestion because I was not able to get deep links to
> work despite trying. Based on my understanding of
> Intent.FLAG_ACTIVITY_NEW_DOCUMENT it should not be necessary. However, based
on
> trying it out, it seems necessary

Powered by Google App Engine
This is Rietveld 408576698