diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2020-07-22 22:12:48 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2020-07-22 22:12:48 +0000 |
commit | a4c9aa2c776d45f16a301a2dd8f22a60a478068f (patch) | |
tree | e4010d509e4b8e54e4f5b85b61777b7d09d1743b | |
parent | 9ee117becd8a5ed4ea08ab1dff1021c93234df1b (diff) | |
parent | 94f77086590114e2a0c189044a78661c8f8340f1 (diff) | |
download | platform_cts-a4c9aa2c776d45f16a301a2dd8f22a60a478068f.tar.gz platform_cts-a4c9aa2c776d45f16a301a2dd8f22a60a478068f.tar.bz2 platform_cts-a4c9aa2c776d45f16a301a2dd8f22a60a478068f.zip |
Merge cherrypicks of [12212499, 12213565, 12213741, 12213742, 12213743, 12213702, 12213319, 12213491, 12213118, 12213065, 12213602, 12213603] into rvc-release
Change-Id: I9a22eb3e7b88531c3d5b4b79d5f22850d8a2552c
4 files changed, 31 insertions, 19 deletions
diff --git a/hostsidetests/appsecurity/test-apps/LocationPolicyApp/src/android/appsecurity/cts/locationpolicy/LocationPolicyTest.java b/hostsidetests/appsecurity/test-apps/LocationPolicyApp/src/android/appsecurity/cts/locationpolicy/LocationPolicyTest.java index 74ce0c582e4..a91948b43cc 100644 --- a/hostsidetests/appsecurity/test-apps/LocationPolicyApp/src/android/appsecurity/cts/locationpolicy/LocationPolicyTest.java +++ b/hostsidetests/appsecurity/test-apps/LocationPolicyApp/src/android/appsecurity/cts/locationpolicy/LocationPolicyTest.java @@ -49,14 +49,16 @@ public class LocationPolicyTest { PackageManager.PERMISSION_GRANTED, pm.checkPermission(Manifest.permission.ACCESS_COARSE_LOCATION, mContext.getPackageName())); - TelephonyManager tele = mContext.getSystemService(TelephonyManager.class); - try { - tele.getCellLocation(); - fail( - "ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION Permissions not granted. Should have" - + " received a security exception when invoking getCellLocation()."); - } catch (SecurityException ignore) { - // That's what we want! + if (pm.hasSystemFeature(PackageManager.FEATURE_TELEPHONY)) { + TelephonyManager tele = mContext.getSystemService(TelephonyManager.class); + try { + tele.getCellLocation(); + fail( + "ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION Permissions not granted. Should" + + " have received a security exception when invoking getCellLocation()."); + } catch (SecurityException ignore) { + // That's what we want! + } } } } diff --git a/hostsidetests/appsecurity/test-apps/ReadExternalStorageApp/src/com/android/cts/readexternalstorageapp/ReadExternalStorageTest.java b/hostsidetests/appsecurity/test-apps/ReadExternalStorageApp/src/com/android/cts/readexternalstorageapp/ReadExternalStorageTest.java index 14df3cfd98e..a43bbe7c521 100644 --- a/hostsidetests/appsecurity/test-apps/ReadExternalStorageApp/src/com/android/cts/readexternalstorageapp/ReadExternalStorageTest.java +++ b/hostsidetests/appsecurity/test-apps/ReadExternalStorageApp/src/com/android/cts/readexternalstorageapp/ReadExternalStorageTest.java @@ -60,6 +60,12 @@ public class ReadExternalStorageTest extends AndroidTestCase { path = path.getParentFile(); } + // Path is 'Android/<data|obb>'. These directories may not be executable, depending on + // the mount. However, these directories should never be writable, hence we only test + // for no-write access here. + assertDirNoWriteAccess(path); + path = path.getParentFile(); + // Keep walking up until we leave device while (path != null) { if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState(path))) { diff --git a/tests/framework/base/windowmanager/src/android/server/wm/WindowInsetsAnimationTests.java b/tests/framework/base/windowmanager/src/android/server/wm/WindowInsetsAnimationTests.java index 6bc90702747..d5b652f12ee 100644 --- a/tests/framework/base/windowmanager/src/android/server/wm/WindowInsetsAnimationTests.java +++ b/tests/framework/base/windowmanager/src/android/server/wm/WindowInsetsAnimationTests.java @@ -100,8 +100,10 @@ public class WindowInsetsAnimationTests extends WindowInsetsAnimationTestBase { @Test public void testAnimationCallbacks_overlapping() { - WindowInsets before = mActivity.mLastWindowInsets; + // Test requires navbar to create overlapping animations. + assumeTrue(hasWindowInsets(mRootView, navigationBars())); + WindowInsets before = mActivity.mLastWindowInsets; MultiAnimCallback callbackInner = new MultiAnimCallback(); MultiAnimCallback callback = mock(MultiAnimCallback.class, withSettings() @@ -188,8 +190,10 @@ public class WindowInsetsAnimationTests extends WindowInsetsAnimationTestBase { @Test public void testAnimationCallbacks_childInsetting() { - WindowInsets before = mActivity.mLastWindowInsets; + // test requires navbar. + assumeTrue(hasWindowInsets(mRootView, navigationBars())); + WindowInsets before = mActivity.mLastWindowInsets; boolean[] done = new boolean[1]; WindowInsetsAnimation.Callback childCallback = mock(WindowInsetsAnimation.Callback.class); WindowInsetsAnimation.Callback callback = new Callback(DISPATCH_MODE_CONTINUE_ON_SUBTREE) { diff --git a/tests/tests/wifi/src/android/net/wifi/cts/ConnectedNetworkScorerTest.java b/tests/tests/wifi/src/android/net/wifi/cts/ConnectedNetworkScorerTest.java index 8039f6f5517..0adf3b974ba 100644 --- a/tests/tests/wifi/src/android/net/wifi/cts/ConnectedNetworkScorerTest.java +++ b/tests/tests/wifi/src/android/net/wifi/cts/ConnectedNetworkScorerTest.java @@ -175,25 +175,25 @@ public class ConnectedNetworkScorerTest extends WifiJUnit4TestBase { assertThat(statsEntry.getTimeStampMillis()).isGreaterThan(0L); assertThat(statsEntry.getRssi()).isLessThan(0); - assertThat(statsEntry.getLinkSpeedMbps()).isGreaterThan(0); - assertThat(statsEntry.getTotalTxSuccess()).isGreaterThan(0L); + assertThat(statsEntry.getLinkSpeedMbps()).isAtLeast(0); + assertThat(statsEntry.getTotalTxSuccess()).isAtLeast(0L); assertThat(statsEntry.getTotalTxRetries()).isAtLeast(0L); assertThat(statsEntry.getTotalTxBad()).isAtLeast(0L); assertThat(statsEntry.getTotalRxSuccess()).isAtLeast(0L); if (mWifiManager.isEnhancedPowerReportingSupported()) { - assertThat(statsEntry.getTotalRadioOnTimeMillis()).isGreaterThan(0L); - assertThat(statsEntry.getTotalRadioTxTimeMillis()).isGreaterThan(0L); - assertThat(statsEntry.getTotalRadioRxTimeMillis()).isGreaterThan(0L); - assertThat(statsEntry.getTotalScanTimeMillis()).isGreaterThan(0L); + assertThat(statsEntry.getTotalRadioOnTimeMillis()).isAtLeast(0L); + assertThat(statsEntry.getTotalRadioTxTimeMillis()).isAtLeast(0L); + assertThat(statsEntry.getTotalRadioRxTimeMillis()).isAtLeast(0L); + assertThat(statsEntry.getTotalScanTimeMillis()).isAtLeast(0L); assertThat(statsEntry.getTotalNanScanTimeMillis()).isAtLeast(0L); assertThat(statsEntry.getTotalBackgroundScanTimeMillis()).isAtLeast(0L); assertThat(statsEntry.getTotalRoamScanTimeMillis()).isAtLeast(0L); assertThat(statsEntry.getTotalPnoScanTimeMillis()).isAtLeast(0L); assertThat(statsEntry.getTotalHotspot2ScanTimeMillis()).isAtLeast(0L); assertThat(statsEntry.getTotalCcaBusyFreqTimeMillis()).isAtLeast(0L); - assertThat(statsEntry.getTotalRadioOnTimeMillis()).isGreaterThan(0L); - assertThat(statsEntry.getTotalRadioOnFreqTimeMillis()).isGreaterThan(0L); - assertThat(statsEntry.getTotalBeaconRx()).isGreaterThan(0L); + assertThat(statsEntry.getTotalRadioOnTimeMillis()).isAtLeast(0L); + assertThat(statsEntry.getTotalRadioOnFreqTimeMillis()).isAtLeast(0L); + assertThat(statsEntry.getTotalBeaconRx()).isAtLeast(0L); assertThat(statsEntry.getProbeStatusSinceLastUpdate()) .isAnyOf(PROBE_STATUS_SUCCESS, PROBE_STATUS_FAILURE, |