Rescind PrintManager BAL privilege
When PrintManager.print is called, it calls PrintMangerService that creates a PendingIntent to start the print dialog with system uid, and returns the IntentSender from that PendingIntent. Then PrintManager starts the returned IntentSender. As a result, any background app that calls this method could start bring itself to the foreground. Fix it by passing an ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_DENIED when PrintManagerService creates the PendingIntent so that its system privilege is not passed on to any client. Also, the PrintManager adds MODE_BACKGROUND_ACTIVITY_START_ALLOWED when it calls startIntentSender so that if the client app is in the foreground, the print dialog will not be blocked simply because the creator of the PI (system) is in the background. Bug: 232799700 Test: Manual test, CTS WorkflowTest and IPrintManagerParametersTest Change-Id: Iae3f583aae8570e566464f17b8ad7b2024946099
Loading
Please register or sign in to comment