Fix bypass BAL via LocationManager.requestFlush

Bug: 235823542
Test: atest LocationProviderManagerTest and manual tests
Change-Id: I2a0fa7b99c3ad5ae839d8018ec70cb5c26e33240
This commit is contained in:
Kate Montgomery
2023-01-26 18:31:45 +00:00
parent 61c27bb464
commit 750af79d5c

View File

@@ -258,6 +258,7 @@ public class LocationProviderManager extends
public void deliverOnFlushComplete(int requestCode) throws PendingIntent.CanceledException {
BroadcastOptions options = BroadcastOptions.makeBasic();
options.setDontSendToRestrictedApps(true);
options.setPendingIntentBackgroundActivityLaunchAllowed(false);
mPendingIntent.send(mContext, 0, new Intent().putExtra(KEY_FLUSH_COMPLETE, requestCode),
null, null, null, options.toBundle());