New issue
Advanced search Search tips

Issue 709893 link

Starred by 2 users

Issue metadata

Status: Verified
Owner:
Closed: Apr 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug



Sign in to add a comment

IsArcAllowedForProfile() returns false on the first login

Project Member Reported by nya@chromium.org, Apr 10 2017

Issue description

Chrome Version: ToT
OS: Chrome OS

What steps will reproduce the problem?
(1) Use a Chromebook with Android N.
(2) Create a new user and login.
(3) Enable ARC.

What is the expected result?

Media view is shown.

What happens instead?

Media view is not shown. After logging out and logging in again, media view is shown.


This is caused because arc::IsArcAllowedForProfile() returns false on the first login with following reason:
  Users with SDK version (25) are not supported when they postponed to migrate to dircrypto.
Since we can opt-in to ARC from UI even on the first login, I assume arc::IsArcAllowedForProfile() returns false only soon after login.

Due to this issue, VolumeManager does not install an observer for ARC opt-in, so media view is never shown even after the user opt-in to ARC.
https://cs.chromium.org/chromium/src/chrome/browser/chromeos/file_manager/volume_manager.cc?rcl=e6e6f3b0e2349ec13fed0603129bbecfd37389a4&l=414
 

Comment 1 by kinaba@chromium.org, Apr 10 2017

Cc: xiy...@chromium.org
Labels: -Pri-2 M-59 Pri-1
Owner: kinaba@chromium.org
Status: Assigned (was: Untriaged)
ProfileImpl::OnPrefsLoaded()
-> ProfileImpl::OnLocaleReady()
----> BrowserContextDependencyManager::CreateBrowserContextServices()   /// VolumeManager refers the value here.
----> ProfileImpl::DoFinalInit()
--------> ProfileManager::OnProfileCreated()
------------> UserSessionManager::OnProfileCreated(CREATE_STATUS_CREATED)
---------------> GetPrefs()->SetBoolean(prefs::kArcCompatibleFilesystemChosen, true)    /// Here it is initialized.
------------> ProfileManager::DoFinalInit()
------------> UserSessionManager::OnProfileCreated(CREATE_STATUS_INITIALIZED)

So, the point is still too late.


There's yet another chance of asynchronous operation here in UserSessionManager:
https://cs.chromium.org/chromium/src/chrome/browser/chromeos/login/session/user_session_manager.cc?type=cs&l=679

ProfileImpl::OnPrefsLoaded()
-> chromeos::UserSessionManager::GetInstance()->RespectLocalePreferenceWrapper()
----ASYNC----> ProfileImpl::OnLocaleReady()

So the next plan is to somehow a bit generalize RespectLocalePreference and insert this preference.

Comment 2 by xiy...@chromium.org, Apr 10 2017

If privacy is not a concern, how about moving prefs::kArcCompatibleFilesystemChosen into local state? This would make the value available pretty early in the startup.

We can use user_manager::known_user::Get(Set)BooleanPref for per-user values stored in local state.

Comment 3 by kinaba@chromium.org, Apr 12 2017

Thanks. That sounds like a feasible idea.
The value is only telling if the user's homedir is ext4crypto or not, and that info is completely visible to user by crbug.com/708015.

Comment 4 by kinaba@chromium.org, Apr 14 2017

Status: Started (was: Assigned)
Project Member

Comment 5 by bugdroid1@chromium.org, Apr 14 2017

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

commit 6ea2f510147f3bca05aea7024752e95dcf559912
Author: kinaba <kinaba@chromium.org>
Date: Fri Apr 14 07:24:38 2017

arc: kArcCompatibleFilesystemChosen pref to local state and integer.

For  bug 709893 ,
It needs to be established before profile's KeyedService starts working,
hence is moved to the local state which can be initialized earlier.

For  bug 711095 ,
to implement a one-time UI to show the success of navigation to the user,
this value needs to be tri-state (notyet, done, done-and-notified).
Taking this opportunity to move to local state, this CL changes the type
of the pref from boolean to integer as well.

BUG= 709893 
BUG= 711095 
TEST=ChromeArcUtilTest
TEST=Manually checked MediaView in Files app is working on the first run.

Review-Url: https://codereview.chromium.org/2808353008
Cr-Commit-Position: refs/heads/master@{#464699}

[modify] https://crrev.com/6ea2f510147f3bca05aea7024752e95dcf559912/chrome/browser/chromeos/arc/arc_session_manager.cc
[modify] https://crrev.com/6ea2f510147f3bca05aea7024752e95dcf559912/chrome/browser/chromeos/arc/arc_util.cc
[modify] https://crrev.com/6ea2f510147f3bca05aea7024752e95dcf559912/chrome/browser/chromeos/arc/arc_util.h
[modify] https://crrev.com/6ea2f510147f3bca05aea7024752e95dcf559912/chrome/browser/chromeos/arc/arc_util_unittest.cc
[modify] https://crrev.com/6ea2f510147f3bca05aea7024752e95dcf559912/chrome/browser/chromeos/login/session/user_session_manager.cc
[modify] https://crrev.com/6ea2f510147f3bca05aea7024752e95dcf559912/chrome/browser/chromeos/login/session/user_session_manager.h

Comment 6 by kinaba@chromium.org, Apr 14 2017

It probably has missed the branch point.
I'll request merge once the branch point is announced and the change is baked for some time.

Comment 7 by kinaba@chromium.org, Apr 22 2017

Labels: Merge-Request-59
Project Member

Comment 8 by sheriffbot@chromium.org, Apr 22 2017

Labels: -Merge-Request-59 Hotlist-Merge-Approved Merge-Approved-59
Your change meets the bar and is auto-approved for M59. Please go ahead and merge the CL to branch 3071 manually. Please contact milestone owner if you have questions.
Owners: amineer@(Android), cmasso@(iOS), gkihumba@(ChromeOS), Abdul Syed@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 9 by bugdroid1@chromium.org, Apr 24 2017

Labels: -merge-approved-59 merge-merged-3071
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/534138b6fa2d1f08dda69114567ec27cde498cd0

commit 534138b6fa2d1f08dda69114567ec27cde498cd0
Author: Kazuhiro Inaba <kinaba@chromium.org>
Date: Mon Apr 24 00:46:54 2017

arc: kArcCompatibleFilesystemChosen pref to local state and integer.

For  bug 709893 ,
It needs to be established before profile's KeyedService starts working,
hence is moved to the local state which can be initialized earlier.

For  bug 711095 ,
to implement a one-time UI to show the success of navigation to the user,
this value needs to be tri-state (notyet, done, done-and-notified).
Taking this opportunity to move to local state, this CL changes the type
of the pref from boolean to integer as well.

BUG= 709893 
BUG= 711095 
TEST=ChromeArcUtilTest
TEST=Manually checked MediaView in Files app is working on the first run.

Review-Url: https://codereview.chromium.org/2808353008
Cr-Commit-Position: refs/heads/master@{#464699}
(cherry picked from commit 6ea2f510147f3bca05aea7024752e95dcf559912)

Review-Url: https://codereview.chromium.org/2834323002 .
Cr-Commit-Position: refs/branch-heads/3071@{#150}
Cr-Branched-From: a106f0abbf69dad349d4aaf4bcc4f5d376dd2377-refs/heads/master@{#464641}

[modify] https://crrev.com/534138b6fa2d1f08dda69114567ec27cde498cd0/chrome/browser/chromeos/arc/arc_session_manager.cc
[modify] https://crrev.com/534138b6fa2d1f08dda69114567ec27cde498cd0/chrome/browser/chromeos/arc/arc_util.cc
[modify] https://crrev.com/534138b6fa2d1f08dda69114567ec27cde498cd0/chrome/browser/chromeos/arc/arc_util.h
[modify] https://crrev.com/534138b6fa2d1f08dda69114567ec27cde498cd0/chrome/browser/chromeos/arc/arc_util_unittest.cc
[modify] https://crrev.com/534138b6fa2d1f08dda69114567ec27cde498cd0/chrome/browser/chromeos/login/session/user_session_manager.cc
[modify] https://crrev.com/534138b6fa2d1f08dda69114567ec27cde498cd0/chrome/browser/chromeos/login/session/user_session_manager.h

Status: Fixed (was: Started)
Status: Verified (was: Fixed)
9557.0.0, 60.0.3101.0

Sign in to add a comment