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

Unified Diff: chrome/browser/chromeos/policy/device_status_collector.cc

Issue 2869673003: Fix system active time reporting for app kiosks (Closed)
Patch Set: Removed a duplicate test Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/policy/device_status_collector.cc
diff --git a/chrome/browser/chromeos/policy/device_status_collector.cc b/chrome/browser/chromeos/policy/device_status_collector.cc
index 521edf74c16c0b7264f2a219fc564c84db2b45a9..3c7445ea4ef6dacb789da7ef349881d971e6c99d 100644
--- a/chrome/browser/chromeos/policy/device_status_collector.cc
+++ b/chrome/browser/chromeos/policy/device_status_collector.cc
@@ -48,6 +48,7 @@
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/update_engine_client.h"
#include "chromeos/disks/disk_mount_manager.h"
+#include "chromeos/login/login_state.h"
#include "chromeos/network/device_state.h"
#include "chromeos/network/network_handler.h"
#include "chromeos/network/network_state.h"
@@ -301,6 +302,12 @@ int ConvertWifiSignalStrength(int signal_strength) {
return signal_strength - 120;
}
+bool IsKioskApp() {
+ auto user_type = chromeos::LoginState::Get()->GetLoggedInUserType();
+ return user_type == chromeos::LoginState::LOGGED_IN_USER_KIOSK_APP ||
+ user_type == chromeos::LoginState::LOGGED_IN_USER_ARC_KIOSK_APP;
+}
+
} // namespace
namespace policy {
@@ -668,7 +675,8 @@ void DeviceStatusCollector::IdleStateCallback(ui::IdleState state) {
Time now = GetCurrentTime();
- if (state == ui::IDLE_STATE_ACTIVE) {
+ // For kiosk apps we report total uptime instead of active time.
+ if (state == ui::IDLE_STATE_ACTIVE || IsKioskApp()) {
// If it's been too long since the last report, or if the activity is
// negative (which can happen when the clock changes), assume a single
// interval of activity.

Powered by Google App Engine
This is Rietveld 408576698