Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f5563e0d authored by Kyunglyul Hyun's avatar Kyunglyul Hyun
Browse files

Enable a skipped PBAP test

PBAP/PSE/GOEP/SRMP/BI-02-C requires a first GET request
is being continued until the second GET request is received.

Sometimes it fails if the first request is handled quickly.

This change adds notes to delay the GET requests.

Flag: EXEMPT, test only
Bug: 293353312
Test: atest pts-bot:PBAP
Change-Id: I0c7f6bf0644fc8ba5b522010bf7698afd4bd481d
parent b98008c9
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -550,6 +550,7 @@
    "PBAP/PSE/GOEP/SRM/BI-03-C",
    "PBAP/PSE/GOEP/SRM/BI-05-C",
    "PBAP/PSE/GOEP/SRM/BV-08-C",
    "PBAP/PSE/GOEP/SRMP/BI-02-C",
    "PBAP/PSE/GOEP/SRMP/BV-02-C",
    "PBAP/PSE/PBB/BI-01-C",
    "PBAP/PSE/PBB/BI-07-C",
@@ -994,7 +995,6 @@
    "PAN/NAP/MISC/UUID/BV-02-C",
    "PAN/PANU/IP/APP/BV-04-I",
    "PAN/PANU/IPv4/AUTONET/BV-01-I",
    "PBAP/PSE/GOEP/SRMP/BI-02-C",
    "PBAP/PSE/SSM/BV-07-C",
    "RFCOMM/DEVA-DEVB/RFC/BV-21-C",
    "RFCOMM/DEVA-DEVB/RFC/BV-22-C",
+16 −0
Original line number Diff line number Diff line
@@ -94,6 +94,7 @@ class Pbap(val context: Context) : PBAPImplBase(), Closeable {
        val displayName = String.format(DEFAULT_DISPLAY_NAME, contactIndex)
        val phoneNumber = generatePhoneNumber(PHONE_NUM_LENGTH)
        val emailID = String.format(DEFAULT_EMAIL_ID, contactIndex)
        val note = String.format(DEFAULT_NOTE, contactIndex)

        val rawContactInsertIndex = operations.size
        operations.add(
@@ -129,6 +130,14 @@ class Pbap(val context: Context) : PBAPImplBase(), Closeable {
                .build()
        )

        operations.add(
            ContentProviderOperation.newInsert(Data.CONTENT_URI)
                .withValueBackReference(Data.RAW_CONTACT_ID, rawContactInsertIndex)
                .withValue(Data.MIMETYPE, Note.CONTENT_ITEM_TYPE)
                .withValue(Note.NOTE, note)
                .build()
        )

        context.getContentResolver().applyBatch(ContactsContract.AUTHORITY, operations)
    }

@@ -146,5 +155,12 @@ class Pbap(val context: Context) : PBAPImplBase(), Closeable {
        const val DEFAULT_EMAIL_ID = "user%d@example.com"
        const val CONTACT_LIST_SIZE = 125
        const val PHONE_NUM_LENGTH = 10
        const val DEFAULT_NOTE =
            """
                %d Lorem ipsum dolor sit amet, consectetur adipiscing elit.
                Vivamus condimentum rhoncus est volutpat venenatis.
                Fusce semper, sapien ut venenatis pellentesque,
                lorem dui aliquam sapien, non pharetra diam neque id mi.
            """
    }
}