Commit a1fadc8f authored by Bartosz Fabianowski's avatar Bartosz Fabianowski Committed by Commit Bot

Start app push-install logging for regular users only

App push-install log uploads are authenticated with the user's
DMToken. It makes no sense to collect logs for any other users
(e.g. kiosks, public sessions) as we would be unable to upload
them anyway.

Plus, trying to instantiate the logging framework in kiosk
sessions leads to crashes as some singletons come up in an
unexpected order.

Bug: 811398
Test: Manual
Change-Id: I827f3cd85accb423ac61bc5f6450753e9c6418cf
Reviewed-on: https://chromium-review.googlesource.com/952904Reviewed-by: default avatarAchuith Bhandarkar <achuith@chromium.org>
Commit-Queue: Bartosz Fabianowski <bartfab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541915}
parent 5da1390c
......@@ -40,6 +40,7 @@
#include "components/signin/core/account_id/account_id.h"
#include "components/user_manager/user_manager.h"
#include "components/user_manager/user_names.h"
#include "components/user_manager/user_type.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/notification_service.h"
#include "content/public/common/content_switches.h"
......@@ -119,9 +120,13 @@ void StartUserSession(Profile* user_profile, const std::string& login_user_id) {
if (lock_screen_apps::StateController::IsEnabled())
lock_screen_apps::StateController::Get()->SetPrimaryProfile(user_profile);
// The |AppInstallEventLogManagerWrapper| manages its own lifetime and
// self-destructs on logout.
policy::AppInstallEventLogManagerWrapper::CreateForProfile(user_profile);
if (user->GetType() == user_manager::USER_TYPE_REGULAR) {
// App install logs are uploaded via the user's communication channel with
// the management server. This channel exists for regular users only.
// The |AppInstallEventLogManagerWrapper| manages its own lifetime and
// self-destructs on logout.
policy::AppInstallEventLogManagerWrapper::CreateForProfile(user_profile);
}
arc::ArcServiceLauncher::Get()->OnPrimaryUserProfilePrepared(user_profile);
#if BUILDFLAG(ENABLE_CROS_ASSISTANT)
......
......@@ -1358,9 +1358,13 @@ void UserSessionManager::FinalizePrepareProfile(Profile* profile) {
if (lock_screen_apps::StateController::IsEnabled())
lock_screen_apps::StateController::Get()->SetPrimaryProfile(profile);
// The |AppInstallEventLogManagerWrapper| manages its own lifetime and
// self-destructs on logout.
policy::AppInstallEventLogManagerWrapper::CreateForProfile(profile);
if (user->GetType() == user_manager::USER_TYPE_REGULAR) {
// App install logs are uploaded via the user's communication channel with
// the management server. This channel exists for regular users only.
// The |AppInstallEventLogManagerWrapper| manages its own lifetime and
// self-destructs on logout.
policy::AppInstallEventLogManagerWrapper::CreateForProfile(profile);
}
arc::ArcServiceLauncher::Get()->OnPrimaryUserProfilePrepared(profile);
#if BUILDFLAG(ENABLE_CROS_ASSISTANT)
......
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