Merge "Rescind PrintManager BAL privilege" into udc-dev
This commit is contained in:
@@ -23,6 +23,7 @@ import android.annotation.RequiresPermission;
|
||||
import android.annotation.SystemApi;
|
||||
import android.annotation.SystemService;
|
||||
import android.app.Activity;
|
||||
import android.app.ActivityOptions;
|
||||
import android.app.Application.ActivityLifecycleCallbacks;
|
||||
import android.compat.annotation.UnsupportedAppUsage;
|
||||
import android.content.ComponentName;
|
||||
@@ -535,7 +536,11 @@ public final class PrintManager {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
mContext.startIntentSender(intent, null, 0, 0, 0);
|
||||
ActivityOptions activityOptions = ActivityOptions.makeBasic()
|
||||
.setPendingIntentBackgroundActivityStartMode(
|
||||
ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED);
|
||||
mContext.startIntentSender(intent, null, 0, 0, 0,
|
||||
activityOptions.toBundle());
|
||||
return new PrintJob(printJob, this);
|
||||
} catch (SendIntentException sie) {
|
||||
Log.e(LOG_TAG, "Couldn't start print job config activity.", sie);
|
||||
|
||||
@@ -31,6 +31,7 @@ import static com.android.internal.util.function.pooled.PooledLambda.obtainMessa
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.annotation.UserIdInt;
|
||||
import android.app.ActivityOptions;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
@@ -245,10 +246,13 @@ final class UserState implements PrintSpoolerCallbacks, PrintServiceCallbacks,
|
||||
intent.putExtra(PrintManager.EXTRA_PRINT_JOB, printJob);
|
||||
intent.putExtra(Intent.EXTRA_PACKAGE_NAME, packageName);
|
||||
|
||||
ActivityOptions activityOptions = ActivityOptions.makeBasic()
|
||||
.setPendingIntentCreatorBackgroundActivityStartMode(
|
||||
ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_DENIED);
|
||||
IntentSender intentSender = PendingIntent.getActivityAsUser(
|
||||
mContext, 0, intent, PendingIntent.FLAG_ONE_SHOT
|
||||
| PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE,
|
||||
null, new UserHandle(mUserId)) .getIntentSender();
|
||||
| PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE,
|
||||
activityOptions.toBundle(), new UserHandle(mUserId)).getIntentSender();
|
||||
|
||||
Bundle result = new Bundle();
|
||||
result.putParcelable(PrintManager.EXTRA_PRINT_JOB, printJob);
|
||||
|
||||
Reference in New Issue
Block a user