Crash in print spooler when back pressed before content update complted.
We are updating the printed content asynchronously. If the user cancels printing before the first update is complete the spooler components are in a destroyed state but we attempt to handle the completed update resulting in a crash. Now if printing is cancelled we ignore the update result. bug:18525491 Change-Id: I1ef47a17de19896cba2c7a1dd2bfc205065e0a5a
This commit is contained in:
committed by
Svetoslav Ganov
parent
5aeed158df
commit
eaaf0512fc
@@ -486,7 +486,9 @@ public final class PageContentRepository {
|
|||||||
protected Void doInBackground(Void... params) {
|
protected Void doInBackground(Void... params) {
|
||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
try {
|
try {
|
||||||
mRenderer.closeDocument();
|
if (mRenderer != null) {
|
||||||
|
mRenderer.closeDocument();
|
||||||
|
}
|
||||||
} catch (RemoteException re) {
|
} catch (RemoteException re) {
|
||||||
/* ignore */
|
/* ignore */
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -487,6 +487,10 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat
|
|||||||
requestCreatePdfFileOrFinish();
|
requestCreatePdfFileOrFinish();
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
case STATE_PRINT_CANCELED: {
|
||||||
|
updateOptionsUi();
|
||||||
|
} break;
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
updatePrintPreviewController(document.changed);
|
updatePrintPreviewController(document.changed);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user