feat: [SDK-5193] let an app opt out of subscription ID copy in its manifest - #2744
Merged
Conversation
Contributor
📊 Diff Coverage ReportDiff Coverage Report (Changed Lines Only)Gate: aggregate coverage on changed executable lines must be ≥ 80% (JaCoCo line data for lines touched in the diff). Changed Files Coverage
Overall (aggregate gate)3/3 touched executable lines covered (100.0% — requires ≥ 80%) |
nan-li
marked this pull request as ready for review
September 10, 2026 23:46
nan-li
force-pushed
the
nan/sdk-5088
branch
from
September 11, 2026 17:03
03042cd to
c2f0ef1
Compare
nan-li
force-pushed
the
nan/sdk-5193
branch
from
September 11, 2026 17:03
e0e24ad to
4b47947
Compare
abdulraqeeb33
left a comment
Contributor
There was a problem hiding this comment.
The opt-out matches the ticket: com.onesignal.subscriptionIdCopyDisabled=true returns from start() before the lifecycle handler, so nothing is counted, copied, or recorded. That is stricter than the remote kill switch, as intended.
Two nits on how we pin and confirm the key (inline).
abdulraqeeb33
approved these changes
Sep 11, 2026
abdulraqeeb33
left a comment
Contributor
There was a problem hiding this comment.
Approving with the two nits already on the diff. Neither blocks the opt-out.
…nifest The gesture is on by default and, until now, only OneSignal could turn it off, through the remote kill switch. An app that does not want a clipboard write in production can now set the manifest meta-data com.onesignal.subscriptionIdCopyDisabled to true, read the same way as com.onesignal.preferHMS. With the key set the detector never registers its lifecycle handler, so nothing is counted, copied or recorded. That is deliberately stricter than the remote kill switch, which still records disabled so attempts can be counted: an app that opted out has said no. One INFO line at start says the key was honored, so a typo in it is not silent. No public API, so wrapper SDKs need no change to expose it.
nan-li
force-pushed
the
nan/sdk-5193
branch
from
September 11, 2026 17:28
4b47947 to
7a1ad3a
Compare
The opt-out test stubbed the manifest read with the detector's own constant, so a typo in com.onesignal.subscriptionIdCopyDisabled would have left it green. The string is the whole contract an app has, so the test now spells it out, the way DeviceServiceTests does for com.onesignal.preferHMS. With a wrong key the stub misses, the real read finds no meta-data, the handler gets added, and the test fails. Nothing else reads the constant, so it is private now. The start-up comment no longer claims the log line confirms the key, since the default WARN level hides it. The level stays INFO, matching the copy line and the iOS opt-out.
Contributor
Author
thanks addressed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
One Line Summary
Lets an app turn off subscription ID copy with a manifest key.
Details
Motivation
The gesture in #2727 is on by default, and the only switch is OneSignal's remote kill switch. An app that doesn't want a clipboard write in production should be able to say so itself, in its own manifest, without a support ticket.
Ticket SDK-5193. Stacked on #2727, which this PR targets.
Scope
com.onesignal.subscriptionIdCopyDisabledset totruein the app's manifest meta-dataDeviceGestureDetector.start()throughAndroidUtils.getManifestMetaBoolean, the same waycom.onesignal.preferHMSis read.disabledso we can count attempts; an app that opted out has said no.The key names the outcome, not the gesture, so the docs can call the feature one thing. No public API, so the wrapper SDKs expose it with no change.
Other
The docs page and release notes need to say the feature is on by default and name the key.
Testing
Unit testing
One new test in
DeviceGestureDetectorTestsmocks the manifest read the wayDeviceServiceTestsdoes and asserts no lifecycle handler, no clip, no event. 22 tests, Spotless and detekt pass.Manual testing
Not run on a device. The read goes through the helper every other manifest switch uses.
Affected code checklist
Checklist
Overview
Testing
Final pass