123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158 |
- package epson.print.screen;
- import android.app.Activity;
- import android.app.AlertDialog;
- import android.app.Dialog;
- import android.content.Context;
- import android.content.DialogInterface;
- import android.content.Intent;
- import android.content.IntentFilter;
- import android.content.ServiceConnection;
- import android.os.Bundle;
- import android.os.Handler;
- import android.os.RemoteException;
- import android.view.KeyEvent;
- import android.view.View;
- import android.widget.Button;
- import android.widget.ProgressBar;
- import android.widget.TextView;
- import com.epson.iprint.prtlogger.Analytics;
- import com.epson.iprint.prtlogger.PrintLog;
- import com.epson.mobilephone.common.escpr.MediaInfo;
- import com.epson.mobilephone.common.wifidirect.NfcTagUtils;
- import java.io.Serializable;
- import epson.common.Utils;
- import epson.print.CommonDefine;
- import epson.print.EPImageList;
- import epson.print.IprintApplication;
- import epson.print.MyPrinter;
- import epson.print.R;
- import epson.print.Util.EPLog;
- import epson.print.service.IEpsonService;
- import epson.print.service.IEpsonServiceCallback;
- import epson.print.widgets.CustomTitleAlertDialogBuilder;
- public class PrintProgress extends Activity implements CommonDefine {
- private static final int DIALOG_CONFIRM = 1;
- private static final int DIALOG_INFORM = 0;
- public static final int END_PRINT = 4;
- public static final String PARAM_DOCUMENT_MODE = "PRINT_DOCUMENT";
- public static final String PARAM_EPSON_COLOR = "epson_color";
- public static final String PARAM_EP_IMAGE_LIST = "EPImageList";
- public static final String PARAM_PRINT_LOG = "print_log";
- public static final String PARAM_PRINT_PROGRESS = "progress-params";
- public static final String PREFS_NAME = "PrintSetting";
- public static final int RESULT_ERROR = 1000;
- private static boolean bRestartactivity = false;
- static int copies = 0;
- static int curError = 0;
- static int fileIndex = 0;
- static boolean isBkRetry = false;
- static boolean isContinue = false;
- static boolean isDocument = false;
- private static final Object lockBCancel = new Object();
- private static IEpsonServiceCallback mCallback;
- private static ServiceConnection mEpsonConnection;
- private static IEpsonService mEpsonService = null;
- private static final Object mLock = new Object();
- private static final Object mLockInit = new Object();
- static ProgressBar mProgressCopies;
- static ProgressBar mProgressPage;
- static ProgressBar mProgressPercent;
- private final int CHECK_PRINTER = 6;
- private final int CHECK_PRINTER_CONTINUE = 10;
- private final int CONFIRM = 7;
- private final int CONFORM_MULTI = 2;
- private final int CONNECTED_SIMPLEAP = 1;
- private final int CONTINUE_PRINT = 3;
- private final int ECC_LIB_ERROR = 9;
- private final int EPS_DUPLEX_NONE = 0;
- private final int EPS_JOB_CANCELED = 40;
- private final int ERROR = 4;
- private final int FINISH = 5;
- private final String PERCENT = "PERCENT";
- private final int PRINT_NEXT_PAGE = 1;
- private final int SHOW_COMPLETE_DIALOG = 8;
- private final int START_PRINT = 2;
- private final int UPDATE_PERCENT = 0;
- boolean bCancel = false;
- private boolean bSearching = false;
- private boolean bSearchingPrinter = false;
- private Context context = null;
- private int curCopy = 1;
- private int curSheet = 1;
- int duplex = 0;
- private boolean isDialogOpen = false;
- private boolean isRemotePrinter = false;
- private boolean mApfProgressDisplay;
- Button mCancelButton;
- boolean mCanceled = false;
- TextView mCopies;
- private volatile boolean mError = false;
- Handler mHandler = new Handler(new Handler.Callback() {
- /* JADX WARNING: Can't fix incorrect switch cases order */
- /* JADX WARNING: Code restructure failed: missing block: B:40:0x01ec, code lost:
- if (com.epson.mobilephone.common.wifidirect.WiFiDirectManager.reconnect(r9.this$0, com.epson.mobilephone.common.wifidirect.WiFiDirectManager.DEVICE_TYPE_PRINTER, 1) == false) goto L_0x01f0;
- */
- /* Code decompiled incorrectly, please refer to instructions dump. */
- public boolean handleMessage(android.os.Message r10) {
- /*
- r9 = this;
- epson.print.screen.PrintProgress r0 = epson.print.screen.PrintProgress.this
- boolean r0 = r0.mCanceled
- r1 = 5
- r2 = 1
- if (r0 == 0) goto L_0x002a
- int r0 = r10.what
- if (r0 == r1) goto L_0x0019
- r10 = 8
- if (r0 == r10) goto L_0x0011
- return r2
- L_0x0011:
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this
- android.os.Handler r10 = r10.mHandler
- r10.sendEmptyMessage(r1)
- return r2
- L_0x0019:
- epson.print.screen.PrintProgress r0 = epson.print.screen.PrintProgress.this
- android.content.Context r0 = r0.context
- java.lang.String r3 = "printer"
- epson.print.screen.PrintProgress r4 = epson.print.screen.PrintProgress.this
- java.lang.String r4 = r4.printerIp
- com.epson.mobilephone.common.wifidirect.WiFiDirectManager.disconnect(r0, r3, r4)
- L_0x002a:
- epson.print.screen.PrintProgress r0 = epson.print.screen.PrintProgress.this
- boolean r0 = r0.isFinishing()
- r3 = 4
- r4 = 2
- if (r0 == 0) goto L_0x0041
- int r0 = r10.what
- if (r0 == 0) goto L_0x0040
- if (r0 == r4) goto L_0x0040
- if (r0 == r3) goto L_0x0040
- switch(r0) {
- case 6: goto L_0x0040;
- case 7: goto L_0x0040;
- case 8: goto L_0x0040;
- case 9: goto L_0x0040;
- case 10: goto L_0x0040;
- default: goto L_0x003f;
- }
- L_0x003f:
- goto L_0x0041
- L_0x0040:
- return r2
- L_0x0041:
- int r0 = r10.what
- r5 = 100
- r7 = 0
- switch(r0) {
- case 0: goto L_0x0429;
- case 1: goto L_0x0049;
- case 2: goto L_0x03e1;
- case 3: goto L_0x0049;
- case 4: goto L_0x0391;
- case 5: goto L_0x025d;
- case 6: goto L_0x01cb;
- case 7: goto L_0x0049;
- case 8: goto L_0x016a;
- case 9: goto L_0x004b;
- case 10: goto L_0x01f0;
- default: goto L_0x0049;
- }
- L_0x0049:
- goto L_0x0450
- L_0x004b:
- epson.print.screen.PrintProgress r0 = epson.print.screen.PrintProgress.this
- boolean unused = r0.mError = r2
- int r0 = r10.arg1
- r1 = -1100(0xfffffffffffffbb4, float:NaN)
- if (r0 == r1) goto L_0x0151
- r1 = -1056(0xfffffffffffffbe0, float:NaN)
- if (r0 == r1) goto L_0x0105
- switch(r0) {
- case -1209: goto L_0x00c5;
- case -1208: goto L_0x00c5;
- default: goto L_0x005d;
- }
- L_0x005d:
- switch(r0) {
- case -1206: goto L_0x00b1;
- case -1205: goto L_0x009d;
- case -1204: goto L_0x0105;
- case -1203: goto L_0x0089;
- case -1202: goto L_0x0075;
- case -1201: goto L_0x0061;
- case -1200: goto L_0x0105;
- default: goto L_0x0060;
- }
- L_0x0060:
- return r2
- L_0x0061:
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this
- r0 = 2131624025(0x7f0e0059, float:1.8875218E38)
- java.lang.String r10 = r10.getString(r0)
- epson.print.screen.PrintProgress r0 = epson.print.screen.PrintProgress.this
- r1 = 2131624024(0x7f0e0058, float:1.8875216E38)
- java.lang.String r0 = r0.getString(r1)
- goto L_0x0163
- L_0x0075:
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this
- r0 = 2131624028(0x7f0e005c, float:1.8875224E38)
- java.lang.String r10 = r10.getString(r0)
- epson.print.screen.PrintProgress r0 = epson.print.screen.PrintProgress.this
- r1 = 2131624027(0x7f0e005b, float:1.8875222E38)
- java.lang.String r0 = r0.getString(r1)
- goto L_0x0163
- L_0x0089:
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this
- r0 = 2131624023(0x7f0e0057, float:1.8875214E38)
- java.lang.String r10 = r10.getString(r0)
- epson.print.screen.PrintProgress r0 = epson.print.screen.PrintProgress.this
- r1 = 2131624022(0x7f0e0056, float:1.8875212E38)
- java.lang.String r0 = r0.getString(r1)
- goto L_0x0163
- L_0x009d:
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this
- r0 = 2131624016(0x7f0e0050, float:1.88752E38)
- java.lang.String r10 = r10.getString(r0)
- epson.print.screen.PrintProgress r0 = epson.print.screen.PrintProgress.this
- r1 = 2131624012(0x7f0e004c, float:1.8875192E38)
- java.lang.String r0 = r0.getString(r1)
- goto L_0x0163
- L_0x00b1:
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this
- r0 = 2131624787(0x7f0e0353, float:1.8876764E38)
- java.lang.String r10 = r10.getString(r0)
- epson.print.screen.PrintProgress r0 = epson.print.screen.PrintProgress.this
- r1 = 2131624786(0x7f0e0352, float:1.8876762E38)
- java.lang.String r0 = r0.getString(r1)
- goto L_0x0163
- L_0x00c5:
- epson.print.screen.PrintProgress r0 = epson.print.screen.PrintProgress.this
- r1 = 2131624009(0x7f0e0049, float:1.8875186E38)
- java.lang.String r0 = r0.getString(r1)
- java.lang.StringBuilder r1 = new java.lang.StringBuilder
- r1.<init>()
- epson.print.screen.PrintProgress r3 = epson.print.screen.PrintProgress.this
- r4 = 2131624007(0x7f0e0047, float:1.8875182E38)
- java.lang.String r3 = r3.getString(r4)
- r1.append(r3)
- java.lang.String r3 = "0X"
- r1.append(r3)
- int r10 = r10.arg1
- java.lang.String r10 = java.lang.Integer.toHexString(r10)
- java.lang.String r10 = r10.toUpperCase()
- r1.append(r10)
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this
- r3 = 2131624008(0x7f0e0048, float:1.8875184E38)
- java.lang.String r10 = r10.getString(r3)
- r1.append(r10)
- java.lang.String r10 = r1.toString()
- r8 = r0
- r0 = r10
- r10 = r8
- goto L_0x0163
- L_0x0105:
- epson.print.screen.PrintProgress r0 = epson.print.screen.PrintProgress.this
- r1 = 2131624021(0x7f0e0055, float:1.887521E38)
- java.lang.String r0 = r0.getString(r1)
- java.lang.StringBuilder r1 = new java.lang.StringBuilder
- r1.<init>()
- epson.print.screen.PrintProgress r3 = epson.print.screen.PrintProgress.this
- r4 = 2131624020(0x7f0e0054, float:1.8875208E38)
- java.lang.String r3 = r3.getString(r4)
- r1.append(r3)
- epson.print.screen.PrintProgress r3 = epson.print.screen.PrintProgress.this
- r4 = 2131624018(0x7f0e0052, float:1.8875204E38)
- java.lang.String r3 = r3.getString(r4)
- r1.append(r3)
- java.lang.String r3 = "0X"
- r1.append(r3)
- int r10 = r10.arg1
- java.lang.String r10 = java.lang.Integer.toHexString(r10)
- java.lang.String r10 = r10.toUpperCase()
- r1.append(r10)
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this
- r3 = 2131624019(0x7f0e0053, float:1.8875206E38)
- java.lang.String r10 = r10.getString(r3)
- r1.append(r10)
- java.lang.String r10 = r1.toString()
- r8 = r0
- r0 = r10
- r10 = r8
- goto L_0x0163
- L_0x0151:
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this
- r0 = 2131624032(0x7f0e0060, float:1.8875232E38)
- java.lang.String r10 = r10.getString(r0)
- epson.print.screen.PrintProgress r0 = epson.print.screen.PrintProgress.this
- r1 = 2131624031(0x7f0e005f, float:1.887523E38)
- java.lang.String r0 = r0.getString(r1)
- L_0x0163:
- epson.print.screen.PrintProgress r1 = epson.print.screen.PrintProgress.this
- r1.showErrorDialog(r10, r0)
- goto L_0x0450
- L_0x016a:
- android.app.AlertDialog$Builder r10 = new android.app.AlertDialog$Builder
- epson.print.screen.PrintProgress r0 = epson.print.screen.PrintProgress.this
- android.content.Context r0 = r0.context
- r10.<init>(r0)
- android.app.AlertDialog$Builder r10 = r10.setCancelable(r7)
- java.lang.StringBuilder r0 = new java.lang.StringBuilder
- r0.<init>()
- epson.print.screen.PrintProgress r1 = epson.print.screen.PrintProgress.this
- r3 = 2131624796(0x7f0e035c, float:1.8876782E38)
- java.lang.String r1 = r1.getString(r3)
- r0.append(r1)
- java.lang.String r1 = "\n"
- r0.append(r1)
- epson.print.screen.PrintProgress r1 = epson.print.screen.PrintProgress.this
- r3 = 2131624797(0x7f0e035d, float:1.8876784E38)
- java.lang.String r1 = r1.getString(r3)
- r0.append(r1)
- java.lang.String r1 = "\n\n"
- r0.append(r1)
- epson.print.screen.PrintProgress r1 = epson.print.screen.PrintProgress.this
- r3 = 2131624798(0x7f0e035e, float:1.8876786E38)
- java.lang.String r1 = r1.getString(r3)
- r0.append(r1)
- java.lang.String r0 = r0.toString()
- android.app.AlertDialog$Builder r10 = r10.setMessage(r0)
- epson.print.screen.PrintProgress r0 = epson.print.screen.PrintProgress.this
- r1 = 2131625202(0x7f0e04f2, float:1.8877605E38)
- java.lang.String r0 = r0.getString(r1)
- epson.print.screen.PrintProgress$4$1 r1 = new epson.print.screen.PrintProgress$4$1
- r1.<init>()
- android.app.AlertDialog$Builder r10 = r10.setPositiveButton(r0, r1)
- r10.show()
- goto L_0x0450
- L_0x01cb:
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this
- int unused = r10.curSheet = r2
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this
- int unused = r10.curCopy = r2
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this
- android.content.Context r10 = r10.context
- java.lang.String r0 = "printer"
- boolean r10 = com.epson.mobilephone.common.wifidirect.WiFiDirectManager.isNeedConnect(r10, r0)
- if (r10 != 0) goto L_0x01e4
- goto L_0x01f0
- L_0x01e4:
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this
- java.lang.String r0 = "printer"
- boolean r10 = com.epson.mobilephone.common.wifidirect.WiFiDirectManager.reconnect(r10, r0, r2)
- if (r10 == 0) goto L_0x01f0
- goto L_0x0450
- L_0x01f0:
- epson.print.service.IEpsonService r10 = epson.print.screen.PrintProgress.mEpsonService
- if (r10 == 0) goto L_0x0252
- java.lang.String r10 = "Epson"
- java.lang.String r0 = "begin probe printer before printing"
- epson.print.Util.EPLog.e((java.lang.String) r10, (java.lang.String) r0) // Catch:{ RemoteException -> 0x024c }
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this // Catch:{ RemoteException -> 0x024c }
- epson.print.MyPrinter r10 = epson.print.MyPrinter.getCurPrinter(r10) // Catch:{ RemoteException -> 0x024c }
- java.lang.String r0 = r10.getPrinterId() // Catch:{ RemoteException -> 0x024c }
- java.lang.String r1 = r10.getIp() // Catch:{ RemoteException -> 0x024c }
- if (r0 == 0) goto L_0x0221
- int r5 = r10.getLocation() // Catch:{ RemoteException -> 0x024c }
- if (r5 != r2) goto L_0x0221
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this // Catch:{ RemoteException -> 0x024c }
- boolean unused = r10.bSearching = r2 // Catch:{ RemoteException -> 0x024c }
- epson.print.service.IEpsonService r10 = epson.print.screen.PrintProgress.mEpsonService // Catch:{ RemoteException -> 0x024c }
- r10.searchPrinters(r0, r1, r2) // Catch:{ RemoteException -> 0x024c }
- goto L_0x0450
- L_0x0221:
- if (r1 == 0) goto L_0x0238
- int r10 = r10.getLocation() // Catch:{ RemoteException -> 0x024c }
- r5 = 3
- if (r10 != r5) goto L_0x0238
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this // Catch:{ RemoteException -> 0x024c }
- boolean unused = r10.bSearching = r2 // Catch:{ RemoteException -> 0x024c }
- epson.print.service.IEpsonService r10 = epson.print.screen.PrintProgress.mEpsonService // Catch:{ RemoteException -> 0x024c }
- r10.searchPrinters(r0, r1, r4) // Catch:{ RemoteException -> 0x024c }
- goto L_0x0450
- L_0x0238:
- epson.print.screen.PrintProgress.isContinue = r7 // Catch:{ RemoteException -> 0x024c }
- r10 = -1351(0xfffffffffffffab9, float:NaN)
- epson.print.screen.PrintProgress.curError = r10 // Catch:{ RemoteException -> 0x024c }
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this // Catch:{ RemoteException -> 0x024c }
- boolean unused = r10.mError = r2 // Catch:{ RemoteException -> 0x024c }
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this // Catch:{ RemoteException -> 0x024c }
- android.os.Handler r10 = r10.mHandler // Catch:{ RemoteException -> 0x024c }
- r10.sendEmptyMessage(r3) // Catch:{ RemoteException -> 0x024c }
- goto L_0x0450
- L_0x024c:
- r10 = move-exception
- r10.printStackTrace()
- goto L_0x0450
- L_0x0252:
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this
- android.os.Handler r10 = r10.mHandler
- r0 = 10
- r10.sendEmptyMessageDelayed(r0, r5)
- goto L_0x0450
- L_0x025d:
- java.lang.String r10 = "PrintProgress"
- java.lang.StringBuilder r0 = new java.lang.StringBuilder
- r0.<init>()
- java.lang.String r4 = "message FINISH : mError => "
- r0.append(r4)
- epson.print.screen.PrintProgress r4 = epson.print.screen.PrintProgress.this
- boolean r4 = r4.mError
- r0.append(r4)
- java.lang.String r4 = " mCanceled =>"
- r0.append(r4)
- epson.print.screen.PrintProgress r4 = epson.print.screen.PrintProgress.this
- boolean r4 = r4.mCanceled
- r0.append(r4)
- java.lang.String r0 = r0.toString()
- epson.print.Util.EPLog.d(r10, r0)
- epson.print.service.IEpsonService r10 = epson.print.screen.PrintProgress.mEpsonService
- if (r10 == 0) goto L_0x032b
- java.lang.Object r10 = epson.print.screen.PrintProgress.mLock // Catch:{ RemoteException -> 0x02fd }
- monitor-enter(r10) // Catch:{ RemoteException -> 0x02fd }
- epson.print.screen.PrintProgress r0 = epson.print.screen.PrintProgress.this // Catch:{ all -> 0x02fa }
- boolean r0 = r0.bSearchingPrinter // Catch:{ all -> 0x02fa }
- if (r0 == 0) goto L_0x02b8
- boolean r0 = epson.print.screen.PrintProgress.bRestartactivity // Catch:{ all -> 0x02fa }
- if (r0 != 0) goto L_0x02b8
- epson.print.service.IEpsonService r0 = epson.print.screen.PrintProgress.mEpsonService // Catch:{ all -> 0x02fa }
- boolean r0 = r0.isSearchingPrinter() // Catch:{ all -> 0x02fa }
- if (r0 == 0) goto L_0x02b8
- java.lang.String r0 = "PrintProgress"
- java.lang.String r4 = "message FINISH: mEpsonService.cancelSearchPrinter()"
- epson.print.Util.EPLog.e((java.lang.String) r0, (java.lang.String) r4) // Catch:{ all -> 0x02fa }
- epson.print.service.IEpsonService r0 = epson.print.screen.PrintProgress.mEpsonService // Catch:{ all -> 0x02fa }
- r0.cancelSearchPrinter() // Catch:{ all -> 0x02fa }
- r0 = 1
- goto L_0x02b9
- L_0x02b8:
- r0 = 0
- L_0x02b9:
- monitor-exit(r10) // Catch:{ all -> 0x02fa }
- epson.print.service.IEpsonService r10 = epson.print.screen.PrintProgress.mEpsonService // Catch:{ RemoteException -> 0x02fd }
- if (r10 == 0) goto L_0x02df
- epson.print.service.IEpsonService r10 = epson.print.screen.PrintProgress.mEpsonService // Catch:{ RemoteException -> 0x02fd }
- boolean r10 = r10.isPrinting() // Catch:{ RemoteException -> 0x02fd }
- if (r10 == 0) goto L_0x02df
- boolean r10 = epson.print.screen.PrintProgress.bRestartactivity // Catch:{ RemoteException -> 0x02fd }
- if (r10 != 0) goto L_0x02df
- java.lang.String r10 = "PrintProgress"
- java.lang.String r0 = "message FINISH: mEpsonService.confirmCancel(true) call"
- epson.print.Util.EPLog.d(r10, r0) // Catch:{ RemoteException -> 0x02fd }
- epson.print.service.IEpsonService r10 = epson.print.screen.PrintProgress.mEpsonService // Catch:{ RemoteException -> 0x02fd }
- r10.confirmCancel(r2) // Catch:{ RemoteException -> 0x02fd }
- r0 = 1
- L_0x02df:
- if (r0 == 0) goto L_0x0301
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this // Catch:{ RemoteException -> 0x02fd }
- boolean r10 = r10.mWaitEpsonServiceForFinish // Catch:{ RemoteException -> 0x02fd }
- if (r10 == 0) goto L_0x0301
- java.lang.String r10 = "PrintProgress"
- java.lang.String r0 = "on message FINISH: sendEmptyMessageDelayed(FINISH...)"
- epson.print.Util.EPLog.d(r10, r0) // Catch:{ RemoteException -> 0x02fd }
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this // Catch:{ RemoteException -> 0x02fd }
- android.os.Handler r10 = r10.mHandler // Catch:{ RemoteException -> 0x02fd }
- r4 = 500(0x1f4, double:2.47E-321)
- r10.sendEmptyMessageDelayed(r1, r4) // Catch:{ RemoteException -> 0x02fd }
- return r2
- L_0x02fa:
- r0 = move-exception
- monitor-exit(r10) // Catch:{ all -> 0x02fa }
- throw r0 // Catch:{ RemoteException -> 0x02fd }
- L_0x02fd:
- r10 = move-exception
- r10.printStackTrace()
- L_0x0301:
- epson.print.service.IEpsonService r10 = epson.print.screen.PrintProgress.mEpsonService // Catch:{ RemoteException -> 0x0327 }
- if (r10 == 0) goto L_0x032b
- java.lang.String r10 = "PrintProgress"
- java.lang.String r0 = "message FINISH: mEpsonService.unregisterCallback() call"
- epson.print.Util.EPLog.e((java.lang.String) r10, (java.lang.String) r0) // Catch:{ RemoteException -> 0x0327 }
- epson.print.service.IEpsonService r10 = epson.print.screen.PrintProgress.mEpsonService // Catch:{ RemoteException -> 0x0327 }
- epson.print.service.IEpsonServiceCallback r0 = epson.print.screen.PrintProgress.mCallback // Catch:{ RemoteException -> 0x0327 }
- r10.unregisterCallback(r0) // Catch:{ RemoteException -> 0x0327 }
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this // Catch:{ RemoteException -> 0x0327 }
- android.content.ServiceConnection r0 = epson.print.screen.PrintProgress.mEpsonConnection // Catch:{ RemoteException -> 0x0327 }
- r10.unbindService(r0) // Catch:{ RemoteException -> 0x0327 }
- r10 = 0
- epson.print.service.IEpsonService unused = epson.print.screen.PrintProgress.mEpsonService = r10 // Catch:{ RemoteException -> 0x0327 }
- goto L_0x032b
- L_0x0327:
- r10 = move-exception
- r10.printStackTrace()
- L_0x032b:
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this
- boolean r10 = r10.mCanceled
- if (r10 == 0) goto L_0x0333
- r3 = 0
- goto L_0x033d
- L_0x0333:
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this
- boolean r10 = r10.mError
- if (r10 == 0) goto L_0x033d
- r3 = 1000(0x3e8, float:1.401E-42)
- L_0x033d:
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this
- android.app.Activity r10 = r10.getParent()
- if (r10 != 0) goto L_0x034b
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this
- r10.setResult(r3)
- goto L_0x0354
- L_0x034b:
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this
- android.app.Activity r10 = r10.getParent()
- r10.setResult(r3)
- L_0x0354:
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this
- boolean unused = r10.bSearching = r7
- java.lang.String r10 = "PrintProgress"
- java.lang.StringBuilder r0 = new java.lang.StringBuilder
- r0.<init>()
- java.lang.String r1 = "finish with return code => "
- r0.append(r1)
- r0.append(r3)
- java.lang.String r0 = r0.toString()
- epson.print.Util.EPLog.d(r10, r0)
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this
- android.content.Context r10 = r10.context
- java.lang.String r0 = "printer"
- epson.print.screen.PrintProgress r1 = epson.print.screen.PrintProgress.this
- java.lang.String r1 = r1.printerIp
- com.epson.mobilephone.common.wifidirect.WiFiDirectManager.disconnect(r10, r0, r1)
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this
- r10.sendPrintLog()
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this
- r10.setPrintEnd()
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this
- r10.finish()
- goto L_0x0450
- L_0x0391:
- java.lang.String r10 = "Epson"
- java.lang.String r0 = "NOTIFY ERROR"
- epson.print.Util.EPLog.e((java.lang.String) r10, (java.lang.String) r0)
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this
- boolean r10 = r10.isDialogOpen
- if (r10 != 0) goto L_0x03b9
- java.lang.String r10 = "Epson"
- java.lang.StringBuilder r0 = new java.lang.StringBuilder
- r0.<init>()
- java.lang.String r1 = "Show Error code:"
- r0.append(r1)
- int r1 = epson.print.screen.PrintProgress.curError
- r0.append(r1)
- java.lang.String r0 = r0.toString()
- epson.print.Util.EPLog.e((java.lang.String) r10, (java.lang.String) r0)
- goto L_0x03d6
- L_0x03b9:
- java.lang.String r10 = "Epson"
- java.lang.StringBuilder r0 = new java.lang.StringBuilder
- r0.<init>()
- java.lang.String r1 = "Remove and show Error code:"
- r0.append(r1)
- int r1 = epson.print.screen.PrintProgress.curError
- r0.append(r1)
- java.lang.String r0 = r0.toString()
- epson.print.Util.EPLog.e((java.lang.String) r10, (java.lang.String) r0)
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this
- r10.removeDialog(r7)
- L_0x03d6:
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this
- boolean unused = r10.isDialogOpen = r2
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this
- r10.showDialog(r7)
- goto L_0x0450
- L_0x03e1:
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this
- boolean unused = r10.mError = r7
- epson.print.service.IEpsonService r10 = epson.print.screen.PrintProgress.mEpsonService
- if (r10 == 0) goto L_0x03f7
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this // Catch:{ Exception -> 0x03f2 }
- r10.startPrint() // Catch:{ Exception -> 0x03f2 }
- goto L_0x0450
- L_0x03f2:
- r10 = move-exception
- r10.printStackTrace()
- goto L_0x0450
- L_0x03f7:
- java.lang.String r10 = "Epson"
- java.lang.String r0 = "Service or resource file not ready, please wait..."
- epson.print.Util.EPLog.i(r10, r0)
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this
- android.widget.TextView r10 = r10.mPercent
- java.lang.StringBuilder r0 = new java.lang.StringBuilder
- r0.<init>()
- epson.print.screen.PrintProgress r1 = epson.print.screen.PrintProgress.this
- java.lang.String r1 = r1.percentString
- r0.append(r1)
- java.lang.String r1 = " 0%"
- r0.append(r1)
- java.lang.String r0 = r0.toString()
- r10.setText(r0)
- android.widget.ProgressBar r10 = epson.print.screen.PrintProgress.mProgressPercent
- r10.setProgress(r7)
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this
- android.os.Handler r10 = r10.mHandler
- r10.sendEmptyMessageDelayed(r4, r5)
- goto L_0x0450
- L_0x0429:
- int r0 = r10.arg2
- int r10 = r10.arg1
- java.lang.StringBuilder r1 = new java.lang.StringBuilder
- r1.<init>()
- java.lang.String r3 = "UPDATE_PERCENT "
- r1.append(r3)
- r1.append(r0)
- java.lang.String r1 = r1.toString()
- epson.print.Util.EPLog.m304d(r1)
- switch(r10) {
- case 1: goto L_0x044b;
- case 2: goto L_0x0445;
- default: goto L_0x0444;
- }
- L_0x0444:
- goto L_0x0450
- L_0x0445:
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this
- r10.updateApfProgress(r0)
- goto L_0x0450
- L_0x044b:
- epson.print.screen.PrintProgress r10 = epson.print.screen.PrintProgress.this
- r10.updatePrintProgress(r0)
- L_0x0450:
- return r2
- */
- throw new UnsupportedOperationException("Method not decompiled: epson.print.screen.PrintProgress.C23254.handleMessage(android.os.Message):boolean");
- }
- });
- TextView mPage;
- TextView mPercent;
- private boolean mPrintProgressDisplay;
- private ProgressParams mProgressParams;
- private volatile boolean mWaitEpsonServiceForFinish = false;
- private String percentString = "";
- private String printerIp;
- private int sheets;
- public interface ProgressParams extends Serializable {
- boolean getApfMode();
- boolean getEpsonColorMode();
- int getOriginalSheetSize();
- PrintLog getPrintLog();
- PrintSetting getPrintSetting(Context context);
- PrintSetting.Kind getPrintSettingType();
- boolean isPaperLandscape();
- boolean print(IEpsonService iEpsonService, boolean z) throws RemoteException;
- }
- public static boolean isPrintSuccess(int i) {
- return i == 4;
- }
- /* JADX WARNING: Code restructure failed: missing block: B:10:0x000e, code lost:
- epson.print.Util.EPLog.e("Epson", "mEpsonService = null");
- mCallback = new epson.print.screen.PrintProgress.C23181(r3);
- mEpsonConnection = new epson.print.screen.PrintProgress.C23232(r3);
- epson.print.Util.EPLog.e("Epson", "bindService() call");
- bindService(new android.content.Intent(r3, epson.print.service.EpsonService.class), mEpsonConnection, 1);
- epson.print.Util.EPLog.e("Epson", "bindService() finish");
- */
- /* JADX WARNING: Code restructure failed: missing block: B:18:?, code lost:
- return;
- */
- /* JADX WARNING: Code restructure failed: missing block: B:19:?, code lost:
- return;
- */
- /* JADX WARNING: Code restructure failed: missing block: B:9:0x000c, code lost:
- if (mEpsonService != null) goto L_?;
- */
- /* Code decompiled incorrectly, please refer to instructions dump. */
- private void init() {
- /*
- r3 = this;
- java.lang.Object r0 = mLockInit
- monitor-enter(r0)
- epson.print.service.IEpsonService r1 = mEpsonService // Catch:{ all -> 0x003f }
- if (r1 == 0) goto L_0x0009
- monitor-exit(r0) // Catch:{ all -> 0x003f }
- return
- L_0x0009:
- monitor-exit(r0) // Catch:{ all -> 0x003f }
- epson.print.service.IEpsonService r0 = mEpsonService
- if (r0 != 0) goto L_0x003e
- java.lang.String r0 = "Epson"
- java.lang.String r1 = "mEpsonService = null"
- epson.print.Util.EPLog.e((java.lang.String) r0, (java.lang.String) r1)
- epson.print.screen.PrintProgress$1 r0 = new epson.print.screen.PrintProgress$1
- r0.<init>()
- mCallback = r0
- epson.print.screen.PrintProgress$2 r0 = new epson.print.screen.PrintProgress$2
- r0.<init>()
- mEpsonConnection = r0
- java.lang.String r0 = "Epson"
- java.lang.String r1 = "bindService() call"
- epson.print.Util.EPLog.e((java.lang.String) r0, (java.lang.String) r1)
- android.content.Intent r0 = new android.content.Intent
- java.lang.Class<epson.print.service.EpsonService> r1 = epson.print.service.EpsonService.class
- r0.<init>(r3, r1)
- android.content.ServiceConnection r1 = mEpsonConnection
- r2 = 1
- r3.bindService(r0, r1, r2)
- java.lang.String r0 = "Epson"
- java.lang.String r1 = "bindService() finish"
- epson.print.Util.EPLog.e((java.lang.String) r0, (java.lang.String) r1)
- L_0x003e:
- return
- L_0x003f:
- r1 = move-exception
- monitor-exit(r0) // Catch:{ all -> 0x003f }
- throw r1
- */
- throw new UnsupportedOperationException("Method not decompiled: epson.print.screen.PrintProgress.init():void");
- }
- protected void onCreate(Bundle bundle) {
- EPLog.e("Epson", "PrintProgress.java: onCreate() call");
- EPLog.e("Epson", "addFlags : FLAG_KEEP_SCREEN_ON ");
- getWindow().addFlags(128);
- super.onCreate(bundle);
- ((IprintApplication) getApplication()).setPrinting(true);
- Analytics.cleanPrintNumber(this);
- try {
- mProgressParams = getParams(getIntent());
- int i = 0;
- Utils.setFInishOnTOuchOutside(this, false);
- mError = false;
- curError = 0;
- mWaitEpsonServiceForFinish = false;
- synchronized (mLockInit) {
- EPLog.e("Epson", "PrintProgress.java: onCreate() call init() funciton");
- init();
- }
- isDocument = getIntent().getExtras().getBoolean(PARAM_DOCUMENT_MODE, false);
- PrintSetting printSetting = mProgressParams.getPrintSetting(this);
- printSetting.loadSettings();
- copies = printSetting.copiesValue;
- duplex = printSetting.duplexValue;
- sheets = countSheet(printSetting.layoutMultiPageValue, mProgressParams.getOriginalSheetSize());
- isRemotePrinter = MyPrinter.isRemotePrinter(this);
- setContentView(R.layout.progress_layout);
- context = this;
- mProgressPercent = (ProgressBar) findViewById(R.id.progress_percent);
- mPercent = (TextView) findViewById(R.id.percent);
- mProgressCopies = (ProgressBar) findViewById(R.id.progress_copies);
- mCopies = (TextView) findViewById(R.id.copies);
- mPage = (TextView) findViewById(R.id.page);
- mProgressPage = (ProgressBar) findViewById(R.id.progress_page);
- if (sheets > 1) {
- TextView textView = mPage;
- textView.setText(getString(R.string.page) + ": " + curSheet + CommonDefine.SLASH + sheets);
- mProgressPage.setProgress((curSheet * 100) / sheets);
- } else {
- mProgressPage.setVisibility(4);
- mPage.setVisibility(4);
- }
- if (copies <= 1 || isRemotePrinter) {
- mProgressCopies.setVisibility(4);
- mCopies.setVisibility(4);
- copies = 1;
- } else {
- TextView textView2 = mCopies;
- textView2.setText(getString(R.string.copies) + ": " + curCopy + CommonDefine.SLASH + copies);
- mProgressCopies.setProgress((curCopy * 100) / copies);
- }
- mCancelButton = (Button) findViewById(R.id.cancel_button);
- mCancelButton.setOnClickListener(new View.OnClickListener() {
- public void onClick(View view) {
- CancelPrint();
- }
- });
- bSearching = false;
- if (isRemotePrinter) {
- percentString = getString(R.string.epsonconnect_str_remote_print_file_uploading);
- } else {
- percentString = getString(R.string.printing);
- }
- TextView textView3 = mPercent;
- textView3.setText(percentString + " 0%");
- mProgressPercent.setProgress(0);
- if (!mProgressParams.getEpsonColorMode()) {
- i = 8;
- }
- findViewById(R.id.epsonColorImageView).setVisibility(i);
- if (isRemotePrinter) {
- mHandler.sendEmptyMessage(2);
- } else {
- Intent intent = new Intent();
- intent.setClass(this, ConfirmMultiScr.class);
- boolean isPaperLandscape = mProgressParams.isPaperLandscape();
- int i2 = printSetting.layoutMultiPageValue;
- if (i2 == 65536) {
- if (isPaperLandscape) {
- intent.putExtra(ConfirmMultiScr.EXTRA_DRAWABLE_ID, R.drawable.multi_2in1p);
- } else {
- intent.putExtra(ConfirmMultiScr.EXTRA_DRAWABLE_ID, R.drawable.multi_2in1l);
- }
- startActivityForResult(intent, 2);
- } else if (i2 == 131072) {
- if (isPaperLandscape) {
- intent.putExtra(ConfirmMultiScr.EXTRA_DRAWABLE_ID, R.drawable.multi_4in1lz);
- } else {
- intent.putExtra(ConfirmMultiScr.EXTRA_DRAWABLE_ID, R.drawable.multi_4in1pz);
- }
- startActivityForResult(intent, 2);
- } else if (i2 != 262144) {
- mHandler.sendEmptyMessage(6);
- } else {
- if (isPaperLandscape) {
- intent.putExtra(ConfirmMultiScr.EXTRA_DRAWABLE_ID, R.drawable.multi_4in1ln);
- } else {
- intent.putExtra(ConfirmMultiScr.EXTRA_DRAWABLE_ID, R.drawable.multi_4in1pn);
- }
- startActivityForResult(intent, 2);
- }
- }
- EPLog.i("Epson", "printProgress.java: onCreate() finish");
- } catch (ClassCastException unused) {
- finish();
- }
- }
- private int countSheet(int i, int i2) {
- if (i == 65536) {
- int i3 = i2 / 2;
- return i2 % 2 > 0 ? i3 + 1 : i3;
- } else if (i != 131072 && i != 262144) {
- return i2;
- } else {
- int i4 = i2 / 4;
- return i2 % 4 > 0 ? i4 + 1 : i4;
- }
- }
- private void triggerPrint() {
- mHandler.sendEmptyMessage(2);
- }
- protected void onDestroy() {
- super.onDestroy();
- EPLog.e("Epson", "PrintProgress.java: onDestroy()call");
- EPLog.e("Epson", "clearFlags : FLAG_KEEP_SCREEN_ON ");
- getWindow().clearFlags(128);
- mHandler.removeMessages(1);
- mHandler.removeMessages(3);
- mHandler.removeMessages(2);
- mHandler.removeMessages(4);
- EPLog.e("Epson", "PrintProgress.java: onDestroy() finish");
- }
- protected void onStop() {
- super.onStop();
- if (mEpsonService == null) {
- EPLog.e("Epson", "set bRestartactivity = true (2)");
- }
- }
- protected void onResume() {
- super.onResume();
- EPLog.e("Epson", "PrintProgress.java call onResume()");
- NfcTagUtils.enableForegroundDispatch(this, (IntentFilter[]) null, (String[][]) null);
- }
- protected void onPause() {
- super.onPause();
- NfcTagUtils.disableForegroundDispatch(this);
- }
- private void setPrintEnd() {
- ((IprintApplication) getApplication()).setPrinting(false);
- }
- private void changePrintProgress() {
- if (sheets > 1) {
- mProgressPage.setVisibility(0);
- mPage.setVisibility(0);
- }
- if (copies <= 1 || isRemotePrinter) {
- mCopies.setVisibility(4);
- } else {
- mProgressCopies.setVisibility(0);
- mCopies.setVisibility(0);
- }
- if (isRemotePrinter) {
- percentString = getString(R.string.epsonconnect_str_remote_print_file_uploading);
- } else {
- percentString = getString(R.string.printing);
- }
- }
- private void changeApfProgress() {
- mProgressPage.setVisibility(4);
- mPage.setVisibility(4);
- mProgressCopies.setVisibility(4);
- mProgressCopies.setVisibility(4);
- mCopies.setVisibility(4);
- mPercent.setText(R.string.apf_processing);
- percentString = getString(R.string.apf_processing);
- }
- private void updatePrintProgress(int i) {
- if (!mPrintProgressDisplay) {
- changePrintProgress();
- mPrintProgressDisplay = true;
- }
- if (i >= 100) {
- i = 100;
- }
- if (i <= 0) {
- mProgressPercent.setProgress(0);
- mPercent.setText(percentString + " 0%");
- if (sheets > 1) {
- mPage.setText(getString(R.string.page) + ": " + curSheet + CommonDefine.SLASH + sheets);
- mProgressPage.setProgress((curSheet * 100) / sheets);
- }
- if (copies > 1) {
- mCopies.setText(getString(R.string.copies) + ": " + curCopy + CommonDefine.SLASH + copies);
- mProgressCopies.setProgress((curCopy * 100) / copies);
- }
- curSheet++;
- if (curSheet > sheets) {
- curSheet = 1;
- curCopy++;
- return;
- }
- return;
- }
- mProgressPercent.setProgress(i);
- mPercent.setText(percentString + " " + i + "%");
- }
- private void updateApfProgress(int i) {
- if (!mApfProgressDisplay) {
- changeApfProgress();
- mApfProgressDisplay = true;
- }
- mProgressPercent.setProgress(i);
- TextView textView = mPercent;
- textView.setText(percentString + " " + i + "%");
- }
- private void startPrint() throws RemoteException {
- bSearching = false;
- mProgressParams.print(mEpsonService, isBkRetry);
- }
- protected Dialog onCreateDialog(int i) {
- switch (i) {
- case 0:
- EPLog.e("Epson", "show dialog: " + curError + " cancontinue: " + isContinue);
- removeDialog(1);
- Integer[] stringId = MediaInfo.ErrorTable.getStringId(curError);
- if (stringId == null) {
- stringId = new Integer[]{Integer.valueOf(R.string.NOT_IMPLEMENT), Integer.valueOf(R.string.NOT_IMPLEMENT_TITLE), 1};
- }
- String[] replaceMessage = Utils.replaceMessage(stringId, curError, getApplicationContext());
- if (!isContinue) {
- EPLog.e("Epson", "show str_cancel button");
- AlertDialog.Builder negativeButton = new CustomTitleAlertDialogBuilder(this).setCancelable(false).setTitle(replaceMessage[1]).setMessage(replaceMessage[0]).setNegativeButton(getString(R.string.str_cancel), new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialogInterface, int i) {
- try {
- PrintProgress.mEpsonService.confirmContinueable(false);
- } catch (RemoteException e) {
- e.printStackTrace();
- }
- EPLog.e("Epson", "user click str_cancel button");
- PrintProgress.curError = 0;
- boolean unused = isDialogOpen = false;
- removeDialog(0);
- mHandler.sendEmptyMessage(5);
- }
- });
- negativeButton.setOnKeyListener(new DialogInterface.OnKeyListener() {
- public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) {
- return keyEvent.getKeyCode() == 84;
- }
- });
- return negativeButton.create();
- }
- AlertDialog.Builder negativeButton2 = new CustomTitleAlertDialogBuilder(this).setTitle((CharSequence) replaceMessage[1]).setMessage(replaceMessage[0]).setCancelable(false).setPositiveButton(getString(R.string.str_continue), new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialogInterface, int i) {
- try {
- if (PrintProgress.curError == 109) {
- PrintProgress.isBkRetry = true;
- triggerPrint();
- }
- PrintProgress.mEpsonService.confirmContinueable(true);
- PrintProgress.curError = 0;
- boolean unused = mError = false;
- } catch (RemoteException e) {
- e.printStackTrace();
- }
- boolean unused2 = isDialogOpen = false;
- removeDialog(0);
- }
- }).setNegativeButton(getString(R.string.str_cancel), new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialogInterface, int i) {
- boolean unused = isDialogOpen = false;
- removeDialog(0);
- try {
- PrintProgress.mEpsonService.confirmContinueable(false);
- PrintProgress.curError = 0;
- } catch (RemoteException e) {
- e.printStackTrace();
- }
- boolean unused2 = mWaitEpsonServiceForFinish = true;
- boolean unused3 = mError = true;
- EPLog.d("PrintProgress", "cont/cancel dialog. cancel clicked");
- mHandler.sendEmptyMessage(5);
- }
- });
- negativeButton2.setOnKeyListener(new DialogInterface.OnKeyListener() {
- public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) {
- return keyEvent.getKeyCode() == 84;
- }
- });
- return negativeButton2.create();
- case 1:
- if (isDialogOpen) {
- return null;
- }
- AlertDialog.Builder negativeButton3 = new AlertDialog.Builder(this).setTitle((CharSequence) null).setCancelable(false).setMessage(getString(R.string.str_msg_scan_cancel)).setPositiveButton(getString(R.string.str_yes), new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialogInterface, int i) {
- mHandler.removeMessages(1);
- try {
- EPLog.e("Epson", "user choice cancel print from GUI");
- if ((PrintProgress.mEpsonService != null ? PrintProgress.mEpsonService.confirmCancel(true) : 0) == 0) {
- synchronized (PrintProgress.lockBCancel) {
- EPLog.e("Epson", "===> set bCancel = true");
- }
- }
- } catch (RemoteException e) {
- e.printStackTrace();
- }
- removeDialog(1);
- PrintProgress printProgress = PrintProgress.this;
- printProgress.mCanceled = true;
- printProgress.mCancelButton.setVisibility(4);
- mCancelButton.setEnabled(false);
- if (bSearching) {
- mHandler.sendEmptyMessage(5);
- boolean unused = bSearching = false;
- }
- }
- }).setNegativeButton(getString(R.string.str_no), new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialogInterface, int i) {
- removeDialog(1);
- }
- });
- negativeButton3.setOnKeyListener(new DialogInterface.OnKeyListener() {
- public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) {
- return keyEvent.getKeyCode() == 84;
- }
- });
- return negativeButton3.create();
- default:
- return null;
- }
- }
- protected void onActivityResult(int i, int i2, Intent intent) {
- super.onActivityResult(i, i2, intent);
- switch (i) {
- case 1:
- switch (i2) {
- case -1:
- mHandler.sendEmptyMessage(10);
- return;
- case 0:
- mHandler.sendEmptyMessage(5);
- return;
- default:
- return;
- }
- case 2:
- if (i2 != -1) {
- mCanceled = true;
- mHandler.sendEmptyMessage(5);
- return;
- }
- mHandler.sendEmptyMessage(6);
- return;
- default:
- return;
- }
- }
- private void CancelPrint() {
- try {
- if (mEpsonService != null) {
- mEpsonService.cancelPrint();
- }
- } catch (RemoteException e) {
- e.printStackTrace();
- }
- showDialog(1);
- }
- public void onBackPressed() {
- EPLog.e("Epson", "onBackPressed()call");
- }
- public boolean onKeyDown(int i, KeyEvent keyEvent) {
- EPLog.e("Epson", "onKeyDown() call");
- if (keyEvent.getAction() != 0 || i != 84) {
- return false;
- }
- EPLog.e("Epson", "onKeyDown() KEYCODE_SEARCH key press");
- return true;
- }
- public void showErrorDialog(String str, String str2) {
- new CustomTitleAlertDialogBuilder(this).setCancelable(false).setTitle(str).setMessage(str2).setNegativeButton(getString(R.string.f343ok), new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialogInterface, int i) {
- dialogInterface.cancel();
- mHandler.sendEmptyMessage(5);
- }
- }).create().show();
- }
- private void sendPrintLog() {
- Analytics.sendPrintLog(this, mProgressParams);
- }
- public static Intent getPdfPrintIntent(Context context2, ProgressParams progressParams) {
- Intent intent = new Intent(context2, PrintProgress.class);
- intent.putExtra("progress-params", progressParams);
- return intent;
- }
- public static Intent getPrintIntent(@NonNull Context context2, @NonNull EPImageList ePImageList, boolean z, boolean z2, @Nullable PrintLog printLog) {
- Intent intent = new Intent(context2, PrintProgress.class);
- intent.putExtra(PARAM_EP_IMAGE_LIST, ePImageList);
- intent.putExtra(PARAM_DOCUMENT_MODE, z);
- intent.putExtra(PARAM_EPSON_COLOR, z2);
- if (printLog != null) {
- intent.putExtra("print_log", printLog);
- }
- return intent;
- }
- private static ProgressParams getParams(Intent intent) {
- ProgressParams progressParams = (ProgressParams) intent.getSerializableExtra("progress-params");
- if (progressParams != null) {
- return progressParams;
- }
- return new PrintProgressParams(intent);
- }
- }
|