@@ -241,6 +241,7 @@ public void testSensorsRelatedPermissionsNotGrantedViaPolicy() throws Exception
241241 @ RequiresDevice
242242 @ Test
243243 public void testAlwaysOnVpn () throws Exception {
244+ assumeIsNotWatch ();
244245 int userId = getUserIdForAlwaysOnVpnTests ();
245246 installAppAsUser (VPN_APP_APK , userId );
246247 executeDeviceTestClassNoRestrictBackground (".AlwaysOnVpnTest" , userId );
@@ -253,6 +254,7 @@ protected int getUserIdForAlwaysOnVpnTests() {
253254 @ RequiresDevice
254255 @ Test
255256 public void testAlwaysOnVpnLockDown () throws Exception {
257+ assumeIsNotWatch ();
256258 int userId = getUserIdForAlwaysOnVpnTests ();
257259 installAppAsUser (VPN_APP_APK , userId );
258260 try {
@@ -267,6 +269,7 @@ public void testAlwaysOnVpnLockDown() throws Exception {
267269 @ RequiresDevice
268270 @ Test
269271 public void testAlwaysOnVpnAcrossReboot () throws Exception {
272+ assumeIsNotWatch ();
270273 int userId = getUserIdForAlwaysOnVpnTests ();
271274 try {
272275 installAppAsUser (VPN_APP_APK , userId );
@@ -286,6 +289,7 @@ public void testAlwaysOnVpnAcrossReboot() throws Exception {
286289 @ RequiresDevice
287290 @ Test
288291 public void testAlwaysOnVpnPackageUninstalled () throws Exception {
292+ assumeIsNotWatch ();
289293 int userId = getUserIdForAlwaysOnVpnTests ();
290294 installAppAsUser (VPN_APP_APK , userId );
291295 try {
@@ -303,6 +307,7 @@ public void testAlwaysOnVpnPackageUninstalled() throws Exception {
303307 @ RequiresDevice
304308 @ Test
305309 public void testAlwaysOnVpnUnsupportedPackage () throws Exception {
310+ assumeIsNotWatch ();
306311 int userId = getUserIdForAlwaysOnVpnTests ();
307312 try {
308313 // Target SDK = 23: unsupported
@@ -328,6 +333,7 @@ public void testAlwaysOnVpnUnsupportedPackage() throws Exception {
328333 @ RequiresDevice
329334 @ Test
330335 public void testAlwaysOnVpnUnsupportedPackageReplaced () throws Exception {
336+ assumeIsNotWatch ();
331337 int userId = getUserIdForAlwaysOnVpnTests ();
332338 try {
333339 // Target SDK = 24: supported
@@ -350,6 +356,7 @@ public void testAlwaysOnVpnUnsupportedPackageReplaced() throws Exception {
350356 @ RequiresDevice
351357 @ Test
352358 public void testAlwaysOnVpnPackageLogged () throws Exception {
359+ assumeIsNotWatch ();
353360 int userId = getUserIdForAlwaysOnVpnTests ();
354361 // Will be uninstalled in tearDown().
355362 installAppAsUser (VPN_APP_APK , userId );
@@ -598,7 +605,7 @@ private void setDefaultContentCaptureServiceEnabled(boolean enabled)
598605 @ Test
599606 public void testSetMeteredDataDisabledPackages () throws Exception {
600607 assumeHasWifiFeature ();
601- assumeFalse ( "is watch" , hasDeviceFeature ( "android.hardware.type.watch" ) );
608+ assumeIsNotWatch ( );
602609
603610 installAppAsUser (METERED_DATA_APP_APK , mUserId );
604611
@@ -1567,4 +1574,8 @@ private void restoreRestrictBackgroundPolicyTo(boolean restricted) throws Except
15671574 getDevice ().executeShellCommand (
15681575 restricted ? RESTRICT_BACKGROUND_ON_CMD : RESTRICT_BACKGROUND_OFF_CMD );
15691576 }
1577+
1578+ private void assumeIsNotWatch () throws Exception {
1579+ assumeFalse ("is watch" , hasDeviceFeature ("android.hardware.type.watch" ));
1580+ }
15701581}
0 commit comments