mirror of
https://github.com/nextcloud/android.git
synced 2024-11-29 18:59:18 +03:00
Fix widget clicks for older Android versions
Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
parent
ae5bbf1ab8
commit
7e7c7e676c
1 changed files with 10 additions and 10 deletions
|
@ -84,7 +84,7 @@ class DashboardWidgetUpdater @Inject constructor(
|
||||||
context,
|
context,
|
||||||
0,
|
0,
|
||||||
intent,
|
intent,
|
||||||
getPendingIntentFlags()
|
pendingIntentFlags
|
||||||
)
|
)
|
||||||
|
|
||||||
remoteViews.setPendingIntentTemplate(R.id.list, pendingIntent)
|
remoteViews.setPendingIntentTemplate(R.id.list, pendingIntent)
|
||||||
|
@ -123,7 +123,7 @@ class DashboardWidgetUpdater @Inject constructor(
|
||||||
context,
|
context,
|
||||||
appWidgetId,
|
appWidgetId,
|
||||||
intent,
|
intent,
|
||||||
getPendingIntentFlags()
|
pendingIntentFlags
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,17 +138,17 @@ class DashboardWidgetUpdater @Inject constructor(
|
||||||
context,
|
context,
|
||||||
appWidgetId,
|
appWidgetId,
|
||||||
intent,
|
intent,
|
||||||
getPendingIntentFlags()
|
pendingIntentFlags
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getPendingIntentFlags(): Int {
|
private val pendingIntentFlags: Int = when {
|
||||||
return PendingIntent.FLAG_UPDATE_CURRENT or if (Build.VERSION.SDK_INT >= 34) {
|
Build.VERSION.SDK_INT >= 34 -> {
|
||||||
PendingIntent.FLAG_MUTABLE or PendingIntent.FLAG_ALLOW_UNSAFE_IMPLICIT_INTENT
|
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_MUTABLE or PendingIntent.FLAG_ALLOW_UNSAFE_IMPLICIT_INTENT
|
||||||
} else if (Build.VERSION.SDK_INT >= 31) {
|
}
|
||||||
PendingIntent.FLAG_MUTABLE
|
|
||||||
} else {
|
else -> {
|
||||||
PendingIntent.FLAG_IMMUTABLE
|
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_MUTABLE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// endregion
|
// endregion
|
||||||
|
|
Loading…
Reference in a new issue