Handle if the printing app is killed while saving to PDF.
When saving to PDF we bring up the file picker UI which covers the print UI. In this case the printing app may get killed as it is not in the forground (the system is bound to the print spooler so it cannot get killed). If that happens we are ending up with an empty file. However, if the file chooser UI is up we already have everything from the app we need and it dying does not matter. This change takes care if ignoring printing app death while saving to PDF. bug:17922948 Change-Id: I10d808e3c3e93e850dbc2a948f2482381a887928
This commit is contained in:
@@ -286,7 +286,9 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat
|
||||
mFileProvider, new RemotePrintDocument.RemoteAdapterDeathObserver() {
|
||||
@Override
|
||||
public void onDied() {
|
||||
if (isFinishing()) {
|
||||
// If we are finishing or we are in a state that we do not need any
|
||||
// data from the printing app, then no need to finish.
|
||||
if (isFinishing() || (isFinalState(mState) && !mPrintedDocument.isUpdating())) {
|
||||
return;
|
||||
}
|
||||
setState(STATE_PRINT_CANCELED);
|
||||
|
||||
Reference in New Issue
Block a user