summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/tests/contactsprovider/src/android/provider/cts/contacts/ContactsContractIntentsTest.java7
-rw-r--r--tests/tests/permission3/src/android/permission3/cts/PermissionTest23.kt3
-rw-r--r--tests/tests/permission3/src/android/permission3/cts/PermissionTest30WithBluetooth.kt16
-rw-r--r--tests/tests/telephony/current/src/android/telephony/cts/SmsUsageMonitorShortCodeTest.java12
4 files changed, 26 insertions, 12 deletions
diff --git a/tests/tests/contactsprovider/src/android/provider/cts/contacts/ContactsContractIntentsTest.java b/tests/tests/contactsprovider/src/android/provider/cts/contacts/ContactsContractIntentsTest.java
index 9edc805da2e..a7fd23289e1 100644
--- a/tests/tests/contactsprovider/src/android/provider/cts/contacts/ContactsContractIntentsTest.java
+++ b/tests/tests/contactsprovider/src/android/provider/cts/contacts/ContactsContractIntentsTest.java
@@ -57,8 +57,11 @@ public class ContactsContractIntentsTest extends AndroidTestCase {
public void testSetDefaultAccount() {
PackageManager packageManager = getContext().getPackageManager();
- if (packageManager.hasSystemFeature(PackageManager.FEATURE_WATCH)) {
- return; // Skip test on watch since the intent is not required.
+ if (
+ packageManager.hasSystemFeature(PackageManager.FEATURE_WATCH)
+ || packageManager.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE)
+ ) {
+ return; // Skip test on watch and automotive since the intent is not required.
}
Intent intent = new Intent(ContactsContract.Settings.ACTION_SET_DEFAULT_ACCOUNT);
diff --git a/tests/tests/permission3/src/android/permission3/cts/PermissionTest23.kt b/tests/tests/permission3/src/android/permission3/cts/PermissionTest23.kt
index f9c449634e2..e6788a4305b 100644
--- a/tests/tests/permission3/src/android/permission3/cts/PermissionTest23.kt
+++ b/tests/tests/permission3/src/android/permission3/cts/PermissionTest23.kt
@@ -112,6 +112,9 @@ class PermissionTest23 : BaseUsePermissionTest() {
clickPermissionRequestAllowButton()
}
+ // Wait for PermissionController's LiveData to catch up
+ Thread.sleep(5_000)
+
// Request the permission and do nothing
// Expect the permission is granted
requestAppPermissionsAndAssertResult(android.Manifest.permission.WRITE_CONTACTS to true) {}
diff --git a/tests/tests/permission3/src/android/permission3/cts/PermissionTest30WithBluetooth.kt b/tests/tests/permission3/src/android/permission3/cts/PermissionTest30WithBluetooth.kt
index 448405db392..9c86f4f5ea2 100644
--- a/tests/tests/permission3/src/android/permission3/cts/PermissionTest30WithBluetooth.kt
+++ b/tests/tests/permission3/src/android/permission3/cts/PermissionTest30WithBluetooth.kt
@@ -57,9 +57,9 @@ class PermissionTest30WithBluetooth : BaseUsePermissionTest() {
private val TEST_APP_PKG =
"android.permission3.cts.usepermission"
private lateinit var bluetoothAdapter: BluetoothAdapter
- private var bluetoothAdapterWasEnabled: Boolean = false
+ private var bluetoothAdapterWasEnabled: Boolean? = null
private val locationManager = context.getSystemService(LocationManager::class.java)!!
- private var locationWasEnabled: Boolean = false
+ private var locationWasEnabled: Boolean? = null
private enum class BluetoothScanResult {
UNKNOWN, ERROR, EXCEPTION, EMPTY, FILTERED, FULL
@@ -79,8 +79,10 @@ class PermissionTest30WithBluetooth : BaseUsePermissionTest() {
assumeTrue(supportsBluetooth())
bluetoothAdapter = context.getSystemService(BluetoothManager::class.java).adapter
bluetoothAdapterWasEnabled = bluetoothAdapter.isEnabled()
- runWithShellPermissionIdentity {
- assertTrue(BTAdapterUtils.enableAdapter(bluetoothAdapter, context))
+ if (bluetoothAdapterWasEnabled == false) {
+ runWithShellPermissionIdentity {
+ assertTrue(BTAdapterUtils.enableAdapter(bluetoothAdapter, context))
+ }
}
enableTestMode()
}
@@ -89,7 +91,7 @@ class PermissionTest30WithBluetooth : BaseUsePermissionTest() {
fun enableLocation() {
val userHandle: UserHandle = Process.myUserHandle()
locationWasEnabled = locationManager.isLocationEnabledForUser(userHandle)
- if (!locationWasEnabled) {
+ if (locationWasEnabled == false) {
runWithShellPermissionIdentity {
locationManager.setLocationEnabledForUser(true, userHandle)
}
@@ -100,7 +102,7 @@ class PermissionTest30WithBluetooth : BaseUsePermissionTest() {
fun disableLocation() {
val userHandle: UserHandle = Process.myUserHandle()
- if (!locationWasEnabled) {
+ if (locationWasEnabled == false) {
runWithShellPermissionIdentity {
locationManager.setLocationEnabledForUser(false, userHandle)
}
@@ -111,7 +113,7 @@ class PermissionTest30WithBluetooth : BaseUsePermissionTest() {
fun disableBluetooth() {
assumeTrue(supportsBluetooth())
disableTestMode()
- if (!bluetoothAdapterWasEnabled) {
+ if (bluetoothAdapterWasEnabled == false) {
runWithShellPermissionIdentity {
assertTrue(BTAdapterUtils.disableAdapter(bluetoothAdapter, context))
}
diff --git a/tests/tests/telephony/current/src/android/telephony/cts/SmsUsageMonitorShortCodeTest.java b/tests/tests/telephony/current/src/android/telephony/cts/SmsUsageMonitorShortCodeTest.java
index 27e7664687b..955661f9ace 100644
--- a/tests/tests/telephony/current/src/android/telephony/cts/SmsUsageMonitorShortCodeTest.java
+++ b/tests/tests/telephony/current/src/android/telephony/cts/SmsUsageMonitorShortCodeTest.java
@@ -126,6 +126,10 @@ public class SmsUsageMonitorShortCodeTest {
new ShortCodeTest("be", "6566", SMS_CATEGORY_PREMIUM_SHORT_CODE),
new ShortCodeTest("be", "7777", SMS_CATEGORY_PREMIUM_SHORT_CODE),
+ new ShortCodeTest("bf", "35696", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("bf", "3681", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
+ new ShortCodeTest("bf", "3558", SMS_CATEGORY_FREE_SHORT_CODE),
+
new ShortCodeTest("bg", "112", SMS_CATEGORY_NOT_SHORT_CODE),
new ShortCodeTest("bg", "116117", SMS_CATEGORY_FREE_SHORT_CODE),
new ShortCodeTest("bg", "1234", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
@@ -349,10 +353,12 @@ public class SmsUsageMonitorShortCodeTest {
new ShortCodeTest("il", "6688", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
new ShortCodeTest("il", "6681", SMS_CATEGORY_FREE_SHORT_CODE),
- new ShortCodeTest("ir", "7007924", SMS_CATEGORY_NOT_SHORT_CODE),
- new ShortCodeTest("ir", "700799", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
+ new ShortCodeTest("ir", "300086178", SMS_CATEGORY_NOT_SHORT_CODE),
+ new ShortCodeTest("ir", "30008790",SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
new ShortCodeTest("ir", "700792", SMS_CATEGORY_FREE_SHORT_CODE),
new ShortCodeTest("ir", "700791", SMS_CATEGORY_FREE_SHORT_CODE),
+ new ShortCodeTest("ir", "100016", SMS_CATEGORY_FREE_SHORT_CODE),
+ new ShortCodeTest("ir", "30008360", SMS_CATEGORY_FREE_SHORT_CODE),
new ShortCodeTest("it", "112", SMS_CATEGORY_NOT_SHORT_CODE),
new ShortCodeTest("it", "116117", SMS_CATEGORY_FREE_SHORT_CODE),
@@ -655,7 +661,7 @@ public class SmsUsageMonitorShortCodeTest {
new ShortCodeTest("ye", "50824", SMS_CATEGORY_NOT_SHORT_CODE),
new ShortCodeTest("ye", "5084", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),
- new ShortCodeTest("ye", "5081", SMS_CATEGORY_FREE_SHORT_CODE),
+ new ShortCodeTest("ye", "5079", SMS_CATEGORY_FREE_SHORT_CODE),
new ShortCodeTest("za", "330092", SMS_CATEGORY_NOT_SHORT_CODE),
new ShortCodeTest("za", "33001", SMS_CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE),