Set intent flag required by Android 12 (SDK 31)

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2022-06-22 10:59:38 +02:00 committed by Tim Krüger
parent 738ed94f98
commit 331309405d
No known key found for this signature in database
GPG Key ID: FECE3A7222C52A4E

View File

@ -161,6 +161,7 @@ import me.zhanghai.android.effortlesspermissions.OpenAppDetailsDialogFragment;
import okhttp3.Cache;
import pub.devrel.easypermissions.AfterPermissionGranted;
import static android.app.PendingIntent.FLAG_MUTABLE;
import static android.app.PendingIntent.FLAG_MUTABLE;
import static com.nextcloud.talk.webrtc.Globals.JOB_ID;
import static com.nextcloud.talk.webrtc.Globals.PARTICIPANTS_UPDATE;
@ -2606,22 +2607,19 @@ public class CallActivity extends CallBaseActivity {
final ArrayList<RemoteAction> actions = new ArrayList<>();
final Icon icon = Icon.createWithResource(this, iconId);
PendingIntent intent;
int intentFlag;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
intent =
PendingIntent.getBroadcast(
this,
requestCode,
new Intent(MICROPHONE_PIP_INTENT_NAME).putExtra(MICROPHONE_PIP_INTENT_EXTRA_ACTION, requestCode),
FLAG_MUTABLE);
intentFlag = FLAG_MUTABLE;
} else {
intent =
PendingIntent.getBroadcast(
this,
requestCode,
new Intent(MICROPHONE_PIP_INTENT_NAME).putExtra(MICROPHONE_PIP_INTENT_EXTRA_ACTION, requestCode),
0);
intentFlag = 0;
}
final PendingIntent intent =
PendingIntent.getBroadcast(
this,
requestCode,
new Intent(MICROPHONE_PIP_INTENT_NAME).putExtra(MICROPHONE_PIP_INTENT_EXTRA_ACTION, requestCode),
intentFlag);
actions.add(new RemoteAction(icon, title, title, intent));