Merge "Don't mix UI and print job state" into nyc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
b9893ec603
@@ -159,7 +159,6 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat
|
||||
private static final int STATE_PRINTER_UNAVAILABLE = 6;
|
||||
private static final int STATE_UPDATE_SLOW = 7;
|
||||
private static final int STATE_PRINT_COMPLETED = 8;
|
||||
private static final int STATE_FINISHING = 9;
|
||||
|
||||
private static final int UI_STATE_PREVIEW = 0;
|
||||
private static final int UI_STATE_ERROR = 1;
|
||||
@@ -255,6 +254,9 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat
|
||||
/** Whether at least one print services is enabled or not */
|
||||
private boolean mArePrintServicesEnabled;
|
||||
|
||||
/** Is doFinish() already in progress */
|
||||
private boolean mIsFinishing;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -2035,11 +2037,11 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat
|
||||
return;
|
||||
}
|
||||
|
||||
if (mState == STATE_FINISHING) {
|
||||
if (mIsFinishing) {
|
||||
return;
|
||||
}
|
||||
|
||||
mState = STATE_FINISHING;
|
||||
mIsFinishing = true;
|
||||
|
||||
if (mPrinterRegistry != null) {
|
||||
mPrinterRegistry.setTrackedPrinter(null);
|
||||
|
||||
Reference in New Issue
Block a user