Commit 40e9d3e4 authored by yilkal's avatar yilkal Committed by Commit Bot

Use android chrome time limit for chrome time limit.

For the bug bash, if time limit is set for chrome android
app id, then use it for chromeos chrome app.

Bug: 1015661
Change-Id: I578114daa291a8e85ea27fd56712f0760a3f9f9a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2050037Reviewed-by: default avatarAga Wronska <agawronska@chromium.org>
Commit-Queue: Yilkal Abe <yilkal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#740505}
parent ef827442
......@@ -62,6 +62,11 @@ enterprise_management::AppActivity::AppState AppStateForReporting(
}
}
chromeos::app_time::AppId GetAndroidChromeAppId() {
return chromeos::app_time::AppId(apps::mojom::AppType::kArc,
"com.android.chrome");
}
} // namespace
AppActivityRegistry::TestApi::TestApi(AppActivityRegistry* registry)
......@@ -325,6 +330,13 @@ void AppActivityRegistry::UpdateAppLimits(
base::Optional<AppLimit> new_limit;
if (base::Contains(app_limits, app_id))
new_limit = app_limits.at(app_id);
// TODO(yilkal): Remove the following if statement after bug bash.
if (app_id == GetChromeAppId() && !base::Contains(app_limits, app_id) &&
base::Contains(app_limits, GetAndroidChromeAppId())) {
new_limit = app_limits.at(GetAndroidChromeAppId());
}
SetAppLimit(app_id, new_limit);
}
}
......
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