Skip to content

Add consent-independent device attribute sync (Android/iOS parity) - #155

Merged
namArora3112 merged 23 commits into
dev-v3.2.0from
feature/device-attributes-parity
Oct 21, 2026
Merged

namArora3112 merged 23 commits into
dev-v3.2.0from
feature/device-attributes-parity

Conversation

@sagar-sharma-adobe

Copy link
Copy Markdown
Contributor

Description

Adds consent-independent device attribute sync to Edge Identity Android, in parity with Edge Identity iOS. This branch includes the work from #150 plus the review, parity and stability changes made on top of it.

API

  • Identity.updateDeviceAttributesBypassConsent(Map<String, Object>) is the only new public API.
  • It dispatches a request that the forward-operational-data rule turns into a device attributes request to Edge, independent of collect consent.

Deduplication (edgeidentity.optimizeOperationalProfileDataSync, default true)

  • Only timezone and tokens.pushNotification are deduplicated and stored. All other values are always sent and never stored.
  • The order of checks:
    1. A value already confirmed by Edge is skipped at any consent state.
    2. When collect consent is y, a value that matches its owner (Messaging for the push token, profileAttributes for timezone) is also skipped and saved as confirmed. If the Consent extension isn't registered, consent counts as y, the same as Edge.
  • A value at a known path is compared and stored as a whole, and arrays are compared ignoring order.

Queue and results

  • One request is in flight at a time. The next one starts when the matching Edge response arrives, whatever its status.
  • Reset fails the in-flight request and every queued one.
  • Each request ends with one result event (edgeIdentity/responseContent) with {status, reason, attributes}.
    • reason is "" on success.
    • When nothing is sent to Edge: unchanged, identityReset, missingAppIdentifier or internalError.
    • Otherwise, on failure: Edge's reason, or unknown.
  • On success, if the request carried tokens, a "Device attributes confirmed" event (messaging/responseContent, {tokens}) is sent for Messaging.

Shared state

  • Synced device attributes are published in the standard shared state.
  • The XDM profileAttributes (consent-path timezone) is unchanged from 3.1.0.

Crash safety

  • The public API never throws.
  • Reset always resolves the XDM shared state.
  • A failure while building or sending a request fails only that request, and the queue continues.
  • Store writes catch all exceptions.

Reverted from #150 to match main

  • the DeviceAttributes class and overload
  • the readyForEvent bootup bypass
  • IANA validation and the AttributeHandler rename on the consent path
  • the never-shipped "deviceAttributes" migration
  • the test app datastream and forced consent

Related Issue

MOB-25063. Builds on #150. iOS counterpart: adobe/aepsdk-edgeidentity-ios#154.

Motivation and Context

Timezone and push tokens are operational data that must reach the profile even without collect consent. The device attributes path sends them through Edge's dedicated endpoint (adobe/aepsdk-edge-android#205), deduplicates the known values so unchanged data isn't resent, and reports every outcome so callers and Messaging can react.

Known limitation: Messaging Android doesn't forward rotated tokens, so apps must call the API again when the push token changes (onNewToken).

How Has This Been Tested?

  • ./code/gradlew -p code/edgeidentity testPhoneDebugUnitTest: 345 tests, 0 failures.
  • spotlessCheck, checkstyle and compilePhoneDebugAndroidTestJavaWithJavac pass (JDK 17).

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

namArora3112 and others added 16 commits September 30, 2026 09:36
- Use the nested synced store with deep-merge commits and order-insensitive array comparison
- Dedup against the synced store first, and against owner values only when collect consent is y; treat an unregistered Consent extension as y
- Copy values that match an owner into the synced store
- Release the active request on any matching Edge result, matched by parentID or requestEventId
- Publish the Device Attributes Sync Result event from Edge Identity on success and on failure
- Publish profileAttributes in the standard shared state and keep XDM as released
- Restore main's startup gating, timezone handler and test app; remove the unused migration and DeviceAttributes API
@namArora3112
namArora3112 merged commit 382454e into dev-v3.2.0 Oct 21, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants