Skip to content

Commit 2596ef9

Browse files
committed
fix: using different mutability flags lead to different intents
1 parent d14b2a7 commit 2596ef9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/internal/activity-recognition/recognizers/abstract-manager.android.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ export abstract class AndroidAbstractRecognizerManager
7070
}
7171

7272
const pendingIntent = this.getPendingIntent();
73-
const task = this.handleStop(Utils.android.getApplicationContext(), pendingIntent);
73+
const task = this.handleStop(
74+
Utils.android.getApplicationContext(),
75+
pendingIntent
76+
);
7477

7578
pendingIntent.cancel();
7679
this.pendingIntent = null;
@@ -94,7 +97,9 @@ export abstract class AndroidAbstractRecognizerManager
9497
Utils.android.getApplicationContext(),
9598
0,
9699
this.getReceiverIntent(),
97-
android.os.Build.VERSION.SDK_INT >= 23 ? PendingIntent.FLAG_NO_CREATE | PendingIntent.FLAG_IMMUTABLE : PendingIntent.FLAG_NO_CREATE
100+
android.os.Build.VERSION.SDK_INT >= 31
101+
? PendingIntent.FLAG_NO_CREATE | PendingIntent.FLAG_MUTABLE
102+
: PendingIntent.FLAG_NO_CREATE
98103
);
99104
return pendingIntent !== null;
100105
}

0 commit comments

Comments
 (0)