commit | 2566eae1833de34db5fd75eeb225e0a997ce72b4 | [log] [tgz] |
---|---|---|
author | Amith Yamasani <yamasani@google.com> | Wed Mar 09 10:39:37 2016 -0800 |
committer | Amith Yamasani <yamasani@google.com> | Wed Mar 09 10:39:37 2016 -0800 |
tree | b397cdd68e5e565efc82c7bfa0455c8cc861a8f0 | |
parent | 7faf69ef025d577f2a7d29d63d278f4517ac5b51 [diff] |
Don't try to remove user 0 in CTS tests There was a change in the usermanager that results in failure when a non-removable/stoppable user is attempted to be removed. Adjusting CTS test accordingly. Bug: 27550623 Change-Id: I88409a632e333e863bb2df37e4bc7751246cd07c
diff --git a/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/BaseDevicePolicyTest.java b/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/BaseDevicePolicyTest.java index 71f11a7..80a94c7 100644 --- a/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/BaseDevicePolicyTest.java +++ b/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/BaseDevicePolicyTest.java
@@ -166,7 +166,9 @@ } protected void removeUser(int userId) throws Exception { - assertTrue("Couldn't remove user", getDevice().removeUser(userId)); + if (listUsers().contains(userId) && userId != 0) { + assertTrue("Couldn't remove user", getDevice().removeUser(userId)); + } } protected void removeTestUsers() throws Exception {