Index: chrome/browser/chromeos/arc/arc_util.cc |
diff --git a/chrome/browser/chromeos/arc/arc_util.cc b/chrome/browser/chromeos/arc/arc_util.cc |
index 7723792c34c6f22bc5eecadd693adb496c8f206d..3fbdd7aa9e3a0093fd5b6ce6928b1eb8ac29c2a5 100644 |
--- a/chrome/browser/chromeos/arc/arc_util.cc |
+++ b/chrome/browser/chromeos/arc/arc_util.cc |
@@ -19,6 +19,7 @@ |
#include "chrome/common/pref_names.h" |
#include "components/arc/arc_util.h" |
#include "components/prefs/pref_service.h" |
+#include "components/user_manager/known_user.h" |
#include "components/user_manager/user.h" |
#include "components/user_manager/user_manager.h" |
@@ -121,10 +122,20 @@ bool IsArcAllowedInAppListForProfile(const Profile* profile) { |
} |
bool IsArcCompatibleFileSystemUsedForProfile(const Profile* profile) { |
- // chromeos::UserSessionManager::PrepareProfile does the actual file system |
- // check and stores the result to prefs, so that it survives crash-restart. |
+ const user_manager::User* user = |
+ chromeos::ProfileHelper::Get()->GetUserByProfile(profile); |
+ if (!user) |
+ return false; |
hidehiko
2017/04/13 12:38:27
IIUC, this case is not expected even for testing?
xiyuan
2017/04/13 16:35:59
Think this should only happen in tests. GetUserByP
kinaba
2017/04/14 04:33:55
For instance, the sign-in profile does not have an
|
+ |
+ // chromeos::UserSessionManager does the actual file system check and stores |
+ // the result to prefs, so that it survives crash-restart. |
+ int filesystem_compatibility = kFileSystemIncompatible; |
+ user_manager::known_user::GetIntegerPref( |
+ user->GetAccountId(), prefs::kArcCompatibleFilesystemChosen, |
+ &filesystem_compatibility); |
+ |
const bool is_filesystem_compatible = |
- profile->GetPrefs()->GetBoolean(prefs::kArcCompatibleFilesystemChosen); |
+ filesystem_compatibility >= kFileSystemCompatible; |
hidehiko
2017/04/13 12:38:27
Could you use "==" instead, just in case that a ne
kinaba
2017/04/14 04:33:55
changed to "!= Incompatible" (to align with the us
|
std::string arc_sdk_version; |
const bool is_M = base::SysInfo::GetLsbReleaseValue(kLsbReleaseArcVersionKey, |
&arc_sdk_version) && |