Allow permission controller to start background activities
Bug: 130827484
Test: Flash locally and run bugreport api with ag/7904826 reverted
- without this change, a notification showed up and logcat has a warning mesage
- with this change, a dialog popped up instead
Change-Id: Ia7930abff2f1875016c7e289bd74e1a133559831
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
package com.android.server.incident;
|
||||
|
||||
import android.app.AppOpsManager;
|
||||
import android.app.BroadcastOptions;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
@@ -358,10 +359,12 @@ class PendingReports {
|
||||
private void sendBroadcast(ComponentName receiver, int primaryUser) {
|
||||
final Intent intent = new Intent(Intent.ACTION_PENDING_INCIDENT_REPORTS_CHANGED);
|
||||
intent.setComponent(receiver);
|
||||
final BroadcastOptions options = BroadcastOptions.makeBasic();
|
||||
options.setBackgroundActivityStartsAllowed(true);
|
||||
|
||||
// Send it to the primary user.
|
||||
mContext.sendBroadcastAsUser(intent, UserHandle.getUserHandleForUid(primaryUser),
|
||||
android.Manifest.permission.APPROVE_INCIDENT_REPORTS);
|
||||
android.Manifest.permission.APPROVE_INCIDENT_REPORTS, options.toBundle());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user