diff --git a/.github/workflows/cross-platform-tests.yml b/.github/workflows/cross-platform-tests.yml index d093b709b..de5bed35d 100644 --- a/.github/workflows/cross-platform-tests.yml +++ b/.github/workflows/cross-platform-tests.yml @@ -10,21 +10,48 @@ jobs: uses: actions/checkout@v3 with: repository: mParticle/crossplatform-sdk-tests + - name: "Checkout Android SDK Branch" uses: actions/checkout@v3 with: repository: ${{github.event.pull_request.head.repo.full_name}} ref: ${{github.head_ref}} path: .sdks/android + + - name: Gradle cache + uses: gradle/gradle-build-action@842c587ad8aa4c68eeba24c396e15af4c2e9f30a #v2.9.0 + + - name: AVD cache + uses: actions/cache@v3 + id: avd-cache + with: + path: | + ~/.android/avd/* + ~/.android/adb* + key: avd-cache + + - name: create AVD and generate snapshot for caching + if: steps.avd-cache.outputs.cache-hit != 'true' + uses: reactivecircus/android-emulator-runner@d94c3fbe4fe6a29e4a5ba47c12fb47677c73656b #v2.28.0 + with: + api-level: 29 + force-avd-creation: false + emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + disable-animations: false + script: echo "Generated AVD snapshot for caching." + - name: "Install JDK 11" uses: actions/setup-java@v3 with: distribution: "zulu" java-version: "11" - name: "Run Crossplatform Tests" - uses: reactivecircus/android-emulator-runner@b35b1c6e6921ebfd3f980c2236ac298f019df53a #v2.28.0 + uses: reactivecircus/android-emulator-runner@d94c3fbe4fe6a29e4a5ba47c12fb47677c73656b #v2.28.0 with: api-level: 29 + force-avd-creation: false + emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + disable-animations: true script: ./gradlew runAndroid - name: "Archive Test Results" if: ${{ always() }} diff --git a/android-core/src/main/java/com/mparticle/internal/Constants.java b/android-core/src/main/java/com/mparticle/internal/Constants.java index 406fe71e4..c34fa26c5 100644 --- a/android-core/src/main/java/com/mparticle/internal/Constants.java +++ b/android-core/src/main/java/com/mparticle/internal/Constants.java @@ -36,7 +36,6 @@ public static void setMaxMessagePerBatch(int max) { // preferences persistence public static final String PREFS_FILE = "mParticlePrefs"; - public static final int LIMIT_ATTR_COUNT = 100; public static final int LIMIT_ATTR_KEY = 256; public static final int LIMIT_ATTR_VALUE = 4096; public static final int LIMIT_MAX_MESSAGE_SIZE = 100 * 1024; diff --git a/android-core/src/main/java/com/mparticle/internal/MPUtility.java b/android-core/src/main/java/com/mparticle/internal/MPUtility.java index b31f9a15b..aebeec65d 100644 --- a/android-core/src/main/java/com/mparticle/internal/MPUtility.java +++ b/android-core/src/main/java/com/mparticle/internal/MPUtility.java @@ -719,11 +719,6 @@ public static Boolean setCheckedAttribute(JSONObject attributes, String key, Obj if (caseInsensitive) { key = findCaseInsensitiveKey(attributes, key); } - - if (Constants.LIMIT_ATTR_COUNT == attributes.length() && !attributes.has(key)) { - Logger.error("Attribute count exceeds limit. Discarding attribute: " + key); - return false; - } if (value != null) { String stringValue = value.toString(); if (stringValue.length() > Constants.LIMIT_ATTR_VALUE) {