Commit 623e0d1b authored by Jana Grill's avatar Jana Grill Committed by Commit Bot

Show a different text for long-term support builds

When the DeviceReleaseLtsTag policy is set, display a different text in
Chrome OS settings to tell the user that they are currently using a
long-term support (LTS) build.

Additonally add the LTS-specific text to "Channel" entry when Build
Details are copied to clipboard.

Note: For the LTS pilot, we only check whether the DeviceReleaseLtsTag
policy is set and do not consider the value it is set to. This will
change for future LTS releases once the exact value is decided on.

Bug: 1105495
Change-Id: Ic1c11e14e690de8ab900337c81487d931ba9fd32
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2355925Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Reviewed-by: default avatarVictor-Gabriel Savu <vsavu@google.com>
Commit-Queue: Jana Grill <janagrill@chromium.org>
Cr-Commit-Position: refs/heads/master@{#800217}
parent 8a439013
......@@ -25,6 +25,7 @@ let RegulatoryInfo;
* @typedef {{
* currentChannel: BrowserChannel,
* targetChannel: BrowserChannel,
* isLts: boolean,
* }}
*/
let ChannelInfo;
......@@ -120,9 +121,14 @@ let TPMFirmwareUpdateStatusChangedEvent;
cr.define('settings', function() {
/**
* @param {!BrowserChannel} channel
* @param {boolean} isLts
* @return {string}
*/
function browserChannelToI18nId(channel) {
function browserChannelToI18nId(channel, isLts) {
if (isLts) {
return 'aboutChannelLongTermStable';
}
switch (channel) {
case BrowserChannel.BETA:
return 'aboutChannelBeta';
......
......@@ -63,7 +63,8 @@ Polymer({
// Display the target channel for the 'Currently on' message.
this.currentlyOnChannelText_ = this.i18n(
'aboutCurrentlyOnChannel',
this.i18n(settings.browserChannelToI18nId(info.targetChannel)));
this.i18n(
settings.browserChannelToI18nId(info.targetChannel, info.isLts)));
});
},
......@@ -114,7 +115,8 @@ Polymer({
const buildInfo = {
'application_label': loadTimeData.getString('aboutBrowserVersion'),
'platform': this.versionInfo_.osVersion,
'aboutChannelLabel': this.channelInfo_.targetChannel,
'aboutChannelLabel': this.channelInfo_.targetChannel +
(this.channelInfo_.isLts ? ' (trusted tester)' : ''),
'firmware_version': this.versionInfo_.osFirmware,
'aboutIsArcStatusTitle': loadTimeData.getBoolean('aboutIsArcEnabled'),
'arc_label': this.versionInfo_.arcVersion,
......
......@@ -54,6 +54,12 @@ Polymer({
/** @private {!BrowserChannel} */
targetChannel_: String,
/** @private */
isLts_: {
type: Boolean,
value: false,
},
/** @private {?RegulatoryInfo} */
regulatoryInfo_: Object,
......@@ -176,6 +182,7 @@ Polymer({
this.aboutBrowserProxy_.getChannelInfo().then(info => {
this.currentChannel_ = info.currentChannel;
this.targetChannel_ = info.targetChannel;
this.isLts_ = info.isLts;
this.startListening_();
});
......@@ -335,8 +342,8 @@ Polymer({
if (this.currentChannel_ != this.targetChannel_) {
return this.i18nAdvanced('aboutUpgradeUpdatingChannelSwitch', {
substitutions: [
this.i18nAdvanced(
settings.browserChannelToI18nId(this.targetChannel_)),
this.i18nAdvanced(settings.browserChannelToI18nId(
this.targetChannel_, this.isLts_)),
progressPercent
]
});
......
......@@ -565,6 +565,13 @@ void AboutHandler::OnGetTargetChannel(std::string callback_id,
channel_info->SetString("currentChannel", current_channel);
channel_info->SetString("targetChannel", target_channel);
// For the LTS pilot simply check whether the device policy is set and ignore
// its value.
std::string value;
bool is_lts = chromeos::CrosSettings::Get()->GetString(
chromeos::kReleaseLtsTag, &value);
channel_info->SetBoolean("isLts", is_lts);
ResolveJavascriptCallback(base::Value(callback_id), *channel_info);
}
......
......@@ -233,6 +233,8 @@ void AboutSection::AddLoadTimeData(content::WebUIDataSource* html_source) {
{"aboutChannelDev", IDS_SETTINGS_ABOUT_PAGE_CURRENT_CHANNEL_DEV},
{"aboutChannelLabel", IDS_SETTINGS_ABOUT_PAGE_CHANNEL},
{"aboutChannelStable", IDS_SETTINGS_ABOUT_PAGE_CURRENT_CHANNEL_STABLE},
{"aboutChannelLongTermStable",
IDS_SETTINGS_ABOUT_PAGE_CURRENT_CHANNEL_STABLE_TT},
{"aboutCheckForUpdates", IDS_SETTINGS_ABOUT_PAGE_CHECK_FOR_UPDATES},
{"aboutCurrentlyOnChannel", IDS_SETTINGS_ABOUT_PAGE_CURRENT_CHANNEL},
{"aboutDetailedBuildInfo", IDS_SETTINGS_ABOUT_PAGE_DETAILED_BUILD_INFO},
......
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