[TIMOB-28477] Android: Update "ti.nfc" module for Android 12
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2021-08-18T21:35:18.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 10.1.0 |
Components | Android |
Labels | android, intent, intent-filter, module, pendingintent |
Reporter | Joshua Quick |
Assignee | Gary Mathews |
Created | 2021-06-08T00:30:18.000+0000 |
Updated | 2021-08-18T21:35:18.000+0000 |
Description
*Summary:*
We need to update this module to address Android 12's breaking-changes.
https://developer.android.com/about/versions/12/behavior-changes-12#exported
https://developer.android.com/about/versions/12/behavior-changes-12#pending-intent-mutability
*Pending Intent Change:*
Pass the [PendingIntent.FLAG_IMMUTABLE](https://developer.android.com/reference/android/app/PendingIntent#FLAG_IMMUTABLE) constant to the
PendingIntent.getActivity()
method call in [NfcForegroundDispatchFilter.java](https://github.com/appcelerator-modules/ti.nfc/blob/master/android/src/ti/nfc/NfcForegroundDispatchFilter.java) to prevent an exception from being thrown.
*Intent-Filter Changes:*
Update the <intent-filter/>
examples to explicitly set the android:exported
attribute.
https://github.com/appcelerator-modules/ti.nfc/blob/master/apidoc/Nfc.yml
https://github.com/appcelerator-modules/ti.nfc/blob/master/android/example/TagViewer/app/controllers/index.js
https://github.com/appcelerator-modules/ti.nfc/blob/master/android/example/TagForeground/app/controllers/index.js
https://github.com/appcelerator-modules/ti.nfc/blob/master/android/example/TagWriter/app/controllers/index.js
master: https://github.com/appcelerator-modules/ti.nfc/pull/57