Commit 97a0231d authored by Victor-Gabriel Savu's avatar Victor-Gabriel Savu Committed by Commit Bot

extend DeviceRebootOnUserSignout to virtual machines

Add additional options for DeviceRebootOnUserSignout to allow rebooting
after a virtual machine (crostini or plugin VM) has been started.

Design Document:
https://docs.google.com/document/d/1cIZsPD6rwm6ca5r8GCXUqr2gT1axsoGe0S0Hl2-OgCE

Bug: 986755
Change-Id: Ida2a73e4d38897d13ddeeba53eb25c4311f2459d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1840634Reviewed-by: default avatarBartosz Fabianowski <bartfab@chromium.org>
Commit-Queue: Victor-Gabriel Savu <vsavu@google.com>
Cr-Commit-Position: refs/heads/master@{#708974}
parent e1bc1516
...@@ -780,6 +780,12 @@ TEST_F(DeviceSettingsProviderTest, DeviceRebootAfterUserSignout) { ...@@ -780,6 +780,12 @@ TEST_F(DeviceSettingsProviderTest, DeviceRebootAfterUserSignout) {
base::Value expected_value(PolicyProto::ALWAYS); base::Value expected_value(PolicyProto::ALWAYS);
VerifyPolicyValue(kDeviceRebootOnUserSignout, &expected_value); VerifyPolicyValue(kDeviceRebootOnUserSignout, &expected_value);
} }
{
SetDeviceRebootOnUserSignout(PolicyProto::VM_STARTED_OR_ARC_SESSION);
base::Value expected_value(PolicyProto::VM_STARTED_OR_ARC_SESSION);
VerifyPolicyValue(kDeviceRebootOnUserSignout, &expected_value);
}
} }
TEST_F(DeviceSettingsProviderTest, DeviceWilcoDtcAllowedSetting) { TEST_F(DeviceSettingsProviderTest, DeviceWilcoDtcAllowedSetting) {
......
...@@ -1388,6 +1388,9 @@ message DeviceRebootOnUserSignoutProto { ...@@ -1388,6 +1388,9 @@ message DeviceRebootOnUserSignoutProto {
ARC_SESSION = 2; ARC_SESSION = 2;
// Always reboot on signout. // Always reboot on signout.
ALWAYS = 3; ALWAYS = 3;
// Reboot on signout if an ARC session was active or a VM was started
// during the user session.
VM_STARTED_OR_ARC_SESSION = 4;
} }
optional RebootOnSignoutMode reboot_on_signout_mode = 1 [default = NEVER]; optional RebootOnSignoutMode reboot_on_signout_mode = 1 [default = NEVER];
......
...@@ -16922,7 +16922,7 @@ ...@@ -16922,7 +16922,7 @@
'type': 'int-enum', 'type': 'int-enum',
'schema': { 'schema': {
'type': 'integer', 'type': 'integer',
'enum': [ 1, 2, 3 ], 'enum': [ 1, 2, 3, 4 ],
}, },
'items': [ 'items': [
{ {
...@@ -16940,6 +16940,11 @@ ...@@ -16940,6 +16940,11 @@
'value': 3, 'value': 3,
'caption': '''Always reboot on user sign out.''', 'caption': '''Always reboot on user sign out.''',
}, },
{
'name': 'ArcSessionOrVMStart',
'value': 4,
'caption': '''Reboot on user sign out if Android or a VM has started.''',
},
], ],
'device_only': True, 'device_only': True,
'example_value': 2, 'example_value': 2,
...@@ -16952,6 +16957,7 @@ ...@@ -16952,6 +16957,7 @@
'tags': ['system-security'], 'tags': ['system-security'],
'desc': ''' 'desc': '''
This policy, when set to ArcSession, forces the device to reboot when a user sign out if Android has started. This policy, when set to ArcSession, forces the device to reboot when a user sign out if Android has started.
This policy, when set to ArcSessionOrVMStart, forces the device to reboot when a user sign out if Android or a VM has started.
When set to Always, it forces the device to reboot on every user sign out. When set to Always, it forces the device to reboot on every user sign out.
If left unset, it has no effect and no reboot is forced on user sign out. The same applies if set to Never. If left unset, it has no effect and no reboot is forced on user sign out. The same applies if set to Never.
This policy has effect only for unaffiliated users. This policy has effect only for unaffiliated users.
......
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