Skip to content

Commit 629c004

Browse files
committed
update doc
Signed-off-by: alperozturk <[email protected]>
1 parent f0c7da7 commit 629c004

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

app/src/main/java/it/niedermann/owncloud/notes/shared/util/WidgetUtil.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ private WidgetUtil() {
1616
}
1717

1818
/**
19-
* Android S requires either {@link PendingIntent#FLAG_MUTABLE} or
20-
* {@link PendingIntent#FLAG_IMMUTABLE} to be set on a {@link PendingIntent}.
21-
* This is enforced by Android and will lead to an app crash if neither of those flags is
22-
* present.
23-
* To keep the app working, this compatibility method can be used to add the
24-
* {@link PendingIntent#FLAG_MUTABLE} flag on Android S and higher to restore the behavior of
25-
* older SDK versions.
19+
* Android 14 (API 34) and above require FLAG_IMMUTABLE
2620
*
27-
* @param flags wanted flags for {@link PendingIntent}
28-
* @return {@param flags} | {@link PendingIntent#FLAG_MUTABLE}
21+
* <p>
22+
* Android 12 (API 31) and above allow FLAG_MUTABLE
23+
*
24+
* <p>
25+
* Ensures compatibility with different Android API levels by setting appropriate flags for a PendingIntent.
26+
*
27+
* @param flags The original flags to be used for the PendingIntent.
28+
* @return The modified flags with compatibility adjustments based on the Android API level.
2929
*/
3030
public static int pendingIntentFlagCompat(int flags) {
3131
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {

0 commit comments

Comments
 (0)