Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28476] Android: Add PendingIntent constants FLAG_IMMUTABLE and FLAG_MUTABLE

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2021-08-25T15:29:31.000+0000
Affected Version/sn/a
Fix Version/sRelease 10.1.0
ComponentsAndroid
Labelsandroid, intent, pendingintent
ReporterJoshua Quick
AssigneeGary Mathews
Created2021-06-07T23:11:14.000+0000
Updated2021-08-25T15:29:31.000+0000

Description

*Summary:* When targeting Android 12 (aka: API Level 31), you must provide either a [FLAG_IMMUTABLE](https://developer.android.com/reference/android/app/PendingIntent#FLAG_IMMUTABLE) or [FLAG_MUTABLE](https://developer.android.com/reference/android/app/PendingIntent#FLAG_MUTABLE) when creating/getting a PendingIntent or else an exception will be thrown. This is a breaking-change made by Google. https://developer.android.com/about/versions/12/behavior-changes-12#pending-intent-mutability *To-Do:* Add the following constants to Titanium. * Ti.Android.FLAG_IMMUTABLE * Ti.Android.FLAG_MUTABLE When calling [Ti.Android.createPendingIntent()](https://developer.android.com/reference/android/app/PendingIntent#FLAG_MUTABLE), Titanium should automatically assign it the FLAG_IMMUTABLE constant unless the caller sets the FLAG_MUTABLE explicitly.

Comments

  1. Gary Mathews 2021-06-14

    master: https://github.com/appcelerator/titanium_mobile/pull/12890

JSON Source