New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 794334 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Dec 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug-Regression



Sign in to add a comment

[Chrome Home] Sheet opened from inactivity in tab switcher shows wrong toolbar

Project Member Reported by huayinz@chromium.org, Dec 12 2017

Issue description

Chrome Version: 65.0.3292.0
OS: Android

What steps will reproduce the problem?
(1) Have chrome opened in background
(2) I guess wait for 3 hours until inactivity experiment triggers?
(3) Launch chrome again. Observe that bottom sheet is opened in tab switcher.

What is the expected result?
Should show location bar

What happens instead?
The new tab button is shown

 
chrome_home_inactivity_sheet_open.png
313 KB View Download
Labels: -Type-Bug Hotlist-Chrome-Hom Needs-Bisect Type-Bug-Regression
I think this is a regression. If we can bisect and determine what broke it that would be ideal. The NTP should be opening.
Labels: OS-Android
Cc: k...@chromium.org
Components: UI>Browser>Mobile>NavPanel
Labels: -Pri-3 ReleaseBlock-Stable M-65 Pri-1
Marking as RBS since this is a regression and it looks pretty broken.

Since we added a way to control the inactivity duration via finch in M64, we should be able to make reproducing/bisecting faster and easier. I'll update the bug with instructions tomorrow.

Comment 4 by k...@chromium.org, Dec 14 2017

Labels: Fine-Pri-1.5
Labels: -M-65 -Hotlist-Chrome-Hom M-64 Hotlist-Chrome-Home
Command line flags to force 0 minute duration for inactivity timeout:

"--force-fieldtrials=InactivityDebugging/ShortDuration" "--force-fieldtrial-params=InactivityDebugging.ShortDuration:time_since_backgrounded_in_mins/0" "--enable-features=ChromeHomeInactivitySheetExpansion<InactivityDebugging"


This reproduces on the current Dev, 64.0.3282.29
Owner: thildebr@chromium.org
Status: Assigned (was: Untriaged)
tl;dr: The code in ChromeTabbedActivity that determines if an intent has an effect is preventing the tab model index from being set, which causes ChromeTabbedActivity to enter overview mode.

Troy, do you mind taking a look?


This reproduces on 64.0.3279.0, which is the first version that had the inactivity duration behind a feature flag, so an (easy) bisect isn't possible. This is happening even when there are tabs open.

After we set the sheet state to half, overview mode is being entered in ChromeTabbedActivity#setInitialOverviewState. In this method, #getActivityTab() is returning null. TabModelImpl.java has no mIndex set when this method is executed. The index isn't being set because we don't restore the active tab while loading tab state if mIntentWithEffect is true.




12-15 09:58:41.884 10861 10861 I cr_TMP  : java.lang.Thread.getStackTrace(Thread.java:1538)
12-15 09:58:41.884 10861 10861 I cr_TMP  : org.chromium.chrome.browser.compositor.layouts.LayoutManagerChrome.showOverview(LayoutManagerChrome.java:554)
12-15 09:58:41.884 10861 10861 I cr_TMP  : org.chromium.chrome.browser.ChromeTabbedActivity.toggleOverview(ChromeTabbedActivity.java:2078)
12-15 09:58:41.884 10861 10861 I cr_TMP  : org.chromium.chrome.browser.ChromeTabbedActivity.setInitialOverviewState(ChromeTabbedActivity.java:797)
12-15 09:58:41.884 10861 10861 I cr_TMP  : org.chromium.chrome.browser.ChromeTabbedActivity.onStartWithNative(ChromeTabbedActivity.java:743)
12-15 09:58:41.884 10861 10861 I cr_TMP  : org.chromium.chrome.browser.init.NativeInitializationController.startNowAndProcessPendingItems(NativeInitializationController.java:240)
12-15 09:58:41.884 10861 10861 I cr_TMP  : org.chromium.chrome.browser.init.NativeInitializationController.onNativeInitializationComplete(NativeInitializationController.java:144)
12-15 09:58:41.884 10861 10861 I cr_TMP  : org.chromium.chrome.browser.init.AsyncInitializationActivity.finishNativeInitialization(AsyncInitializationActivity.java:216)
12-15 09:58:41.884 10861 10861 I cr_TMP  : org.chromium.chrome.browser.ChromeActivity.finishNativeInitialization(ChromeActivity.java:1224)
12-15 09:58:41.884 10861 10861 I cr_TMP  : org.chromium.chrome.browser.ChromeTabbedActivity.finishNativeInitialization(ChromeTabbedActivity.java:602)
12-15 09:58:41.884 10861 10861 I cr_TMP  : org.chromium.chrome.browser.init.ChromeBrowserInitializer$9.run(ChromeBrowserInitializer.java:308)
12-15 09:58:41.884 10861 10861 I cr_TMP  : org.chromium.chrome.browser.init.ChainedTasks$1.run(ChainedTasks.java:28)
12-15 09:58:41.884 10861 10861 I cr_TMP  : android.os.Handler.handleCallback(Handler.java:790)
12-15 09:58:41.884 10861 10861 I cr_TMP  : android.os.Handler.dispatchMessage(Handler.java:99)
12-15 09:58:41.884 10861 10861 I cr_TMP  : android.os.Looper.loop(Looper.java:164)
12-15 09:58:41.884 10861 10861 I cr_TMP  : android.app.ActivityThread.main(ActivityThread.java:6494)
12-15 09:58:41.884 10861 10861 I cr_TMP  : java.lang.reflect.Method.invoke(Native Method)
12-15 09:58:41.884 10861 10861 I cr_TMP  : com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
12-15 09:58:41.884 10861 10861 I cr_TMP  : com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

Labels: -Needs-Bisect
I suspect this might be as easy as returning false at the end of the maybeLaunchNtpOrResetBottomSheetFromMainIntent block after we set the bottom sheet state to half. It looks that changed when we added the feature flag to control duration:

https://chromium.googlesource.com/chromium/src/+/9de6d42a79528c6b1672ee8b379a91b9fd17539f%5E%21/#F0
As an aside, opening the NTP on startup when the inactivity flags are set looks really odd. I think it's going to half-state then opening the NTP.

Maybe for M64 we should just shut off opening the NTP after inactivity since it's less likely that users are returning to Chrome while in the tab switcher?
ntp-after-inactivity.mp4
5.0 MB View Download
Status: Started (was: Assigned)
Project Member

Comment 10 by bugdroid1@chromium.org, Dec 19 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/70e9f46252e6732b25744ca62f7cf4af73d028aa

commit 70e9f46252e6732b25744ca62f7cf4af73d028aa
Author: Troy Hildebrandt <thildebr@chromium.org>
Date: Tue Dec 19 19:19:57 2017

[Home] Fix bottom sheet expansion after inactivity.

Fixes incorrect toolbar showing when expanding the bottom sheet to half
after inactivity, caused by an incorrect return value from
maybeLaunchNtpOrResetBottomSheetFromMainIntent.

Also fixes janky icons when launching NTP at full height when displaying
the tab switcher with zero tabs, caused by setting the bottom sheet
height to half unnecessarily.

Bug:  794334 
Change-Id: Ibc8edc6bd30bc3c9cd26c187cb9f596f4ca70ded
Reviewed-on: https://chromium-review.googlesource.com/832820
Reviewed-by: Theresa <twellington@chromium.org>
Reviewed-by: David Trainor <dtrainor@chromium.org>
Commit-Queue: Troy Hildebrandt <thildebr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#525100}
[modify] https://crrev.com/70e9f46252e6732b25744ca62f7cf4af73d028aa/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java

Status: Fixed (was: Started)
Labels: Merge-TBD
[Auto-generated comment by a script] We noticed that this issue is targeted for M-64; it appears the fix may have landed after branch point, meaning a merge might be required. Please confirm if a merge is required here - if so add Merge-Request-64 label, otherwise remove Merge-TBD label. Thanks.
Labels: Merge-Request-64
Status: Started (was: Fixed)
Requesting a merge for the +12 line -7 line patch in comment #10. This small CL fixes some behavior related to automatically expanding the Chrome Home bottom sheet after inactivity. It is completely hidden behind a finch flag that is disabled by default.
Project Member

Comment 14 by sheriffbot@chromium.org, Dec 19 2017

Labels: -Merge-Request-64 Hotlist-Merge-Review Merge-Review-64
This bug requires manual review: M64 has already been promoted to the beta branch, so this requires manual review
Please contact the milestone owner if you have questions.
Owners: cmasso@(Android), cmasso@(iOS), kbleicher@(ChromeOS), abdulsyed@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Hotlist-Merge-Review -Merge-TBD -Merge-Review-64 Merge-Approved-64
Project Member

Comment 16 by bugdroid1@chromium.org, Dec 20 2017

Labels: -merge-approved-64 merge-merged-3282
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4eded11134072855f41886db1ac6b60ef8d98c4c

commit 4eded11134072855f41886db1ac6b60ef8d98c4c
Author: Troy Hildebrandt <thildebr@chromium.org>
Date: Wed Dec 20 21:48:17 2017

[Home] Fix bottom sheet expansion after inactivity.

Fixes incorrect toolbar showing when expanding the bottom sheet to half
after inactivity, caused by an incorrect return value from
maybeLaunchNtpOrResetBottomSheetFromMainIntent.

Also fixes janky icons when launching NTP at full height when displaying
the tab switcher with zero tabs, caused by setting the bottom sheet
height to half unnecessarily.

Bug:  794334 
Change-Id: Ibc8edc6bd30bc3c9cd26c187cb9f596f4ca70ded
Reviewed-on: https://chromium-review.googlesource.com/832820
Reviewed-by: Theresa <twellington@chromium.org>
Reviewed-by: David Trainor <dtrainor@chromium.org>
Commit-Queue: Troy Hildebrandt <thildebr@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#525100}(cherry picked from commit 70e9f46252e6732b25744ca62f7cf4af73d028aa)
Reviewed-on: https://chromium-review.googlesource.com/837840
Cr-Commit-Position: refs/branch-heads/3282@{#307}
Cr-Branched-From: 5fdc0fab22ce7efd32532ee989b223fa12f8171e-refs/heads/master@{#520840}
[modify] https://crrev.com/4eded11134072855f41886db1ac6b60ef8d98c4c/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java

Status: Fixed (was: Started)
Verified on Chrome:64.0.3282.73 Device:Nexus 5X/7.0.0 

Sign in to add a comment