CameraPrintProgress.java 57 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074
  1. package com.epson.cameracopy.ui;
  2. import android.app.Activity;
  3. import android.app.AlertDialog;
  4. import android.app.Dialog;
  5. import android.content.Context;
  6. import android.content.DialogInterface;
  7. import android.content.Intent;
  8. import android.content.IntentFilter;
  9. import android.content.ServiceConnection;
  10. import android.os.Bundle;
  11. import android.os.Handler;
  12. import android.os.RemoteException;
  13. import android.view.KeyEvent;
  14. import android.view.View;
  15. import android.widget.Button;
  16. import android.widget.ProgressBar;
  17. import android.widget.TextView;
  18. import com.epson.cameracopy.printlayout.ImageAndLayout;
  19. import com.epson.iprint.prtlogger.Analytics;
  20. import com.epson.mobilephone.common.escpr.MediaInfo;
  21. import com.epson.mobilephone.common.wifidirect.NfcTagUtils;
  22. import epson.common.Utils;
  23. import epson.print.CommonDefine;
  24. import epson.print.MyPrinter;
  25. import epson.print.Util.EPLog;
  26. import epson.print.screen.PrintProgress;
  27. import epson.print.screen.PrintSetting;
  28. import epson.print.service.IEpsonService;
  29. import epson.print.service.IEpsonServiceCallback;
  30. import epson.print.widgets.CustomTitleAlertDialogBuilder;
  31. import java.util.ArrayList;
  32. /* renamed from: com.epson.cameracopy.ui.CameraPrintProgress */
  33. public class CameraPrintProgress extends Activity implements CommonDefine {
  34. private static final int DIALOG_CONFIRM = 1;
  35. private static final int DIALOG_INFORM = 0;
  36. public static final int END_PRINT = 4;
  37. public static final String KEY_IMAGE_AND_LAYOUT = "image_and_layout";
  38. public static final String PARAM_PRINT_PROGRESS = "progress-params";
  39. public static final String PREFS_NAME = "PrintSetting";
  40. public static final int RESULT_ERROR = 1000;
  41. private static boolean bRestartactivity = false;
  42. static int copies = 0;
  43. static int curError = 0;
  44. static int fileIndex = 0;
  45. static boolean isBkRetry = false;
  46. static boolean isContinue = false;
  47. static boolean isDocument = false;
  48. private static final Object lockBCancel = new Object();
  49. private static IEpsonServiceCallback mCallback;
  50. private static ServiceConnection mEpsonConnection;
  51. private static IEpsonService mEpsonService = null;
  52. private static final Object mLock = new Object();
  53. private static final Object mLockInit = new Object();
  54. static ProgressBar mProgressCopies;
  55. static ProgressBar mProgressPage;
  56. static ProgressBar mProgressPercent;
  57. private final int CHECK_PRINTER = 6;
  58. private final int CHECK_PRINTER_CONTINUE = 10;
  59. private final int CONFIRM = 7;
  60. private final int CONNECTED_SIMPLEAP = 1;
  61. private final int CONTINUE_PRINT = 3;
  62. private final int ECC_LIB_ERROR = 9;
  63. private final int EPS_DUPLEX_NONE = 0;
  64. private final int EPS_JOB_CANCELED = 40;
  65. private final int ERROR = 4;
  66. private final int FINISH = 5;
  67. private final String PERCENT = "PERCENT";
  68. private final int PRINT_NEXT_PAGE = 1;
  69. private final int SHOW_COMPLETE_DIALOG = 8;
  70. private final int START_PRINT = 2;
  71. private final int UPDATE_PERCENT = 0;
  72. boolean bCancel = false;
  73. private boolean bSearching = false;
  74. private boolean bSearchingPrinter = false;
  75. private Context context = null;
  76. private int curCopy = 1;
  77. private int curSheet = 1;
  78. int duplex = 0;
  79. private boolean isDialogOpen = false;
  80. private boolean isRemotePrinter = false;
  81. Button mCancelButton;
  82. boolean mCanceled = false;
  83. TextView mCopies;
  84. private volatile boolean mError = false;
  85. Handler mHandler = new Handler(new Handler.Callback() {
  86. /* JADX WARNING: Can't fix incorrect switch cases order */
  87. /* JADX WARNING: Code restructure failed: missing block: B:32:0x020e, code lost:
  88. if (com.epson.mobilephone.common.wifidirect.WiFiDirectManager.reconnect(r8.this$0, com.epson.mobilephone.common.wifidirect.WiFiDirectManager.DEVICE_TYPE_PRINTER, 1) == false) goto L_0x0212;
  89. */
  90. /* Code decompiled incorrectly, please refer to instructions dump. */
  91. public boolean handleMessage(android.os.Message r9) {
  92. /*
  93. r8 = this;
  94. com.epson.cameracopy.ui.CameraPrintProgress r0 = com.epson.cameracopy.ui.CameraPrintProgress.this
  95. boolean r0 = r0.mCanceled
  96. r1 = 5
  97. r2 = 1
  98. if (r0 == 0) goto L_0x002a
  99. int r0 = r9.what
  100. if (r0 == r1) goto L_0x0019
  101. r9 = 8
  102. if (r0 == r9) goto L_0x0011
  103. return r2
  104. L_0x0011:
  105. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  106. android.os.Handler r9 = r9.mHandler
  107. r9.sendEmptyMessage(r1)
  108. return r2
  109. L_0x0019:
  110. com.epson.cameracopy.ui.CameraPrintProgress r0 = com.epson.cameracopy.ui.CameraPrintProgress.this
  111. android.content.Context r0 = r0.context
  112. java.lang.String r3 = "printer"
  113. com.epson.cameracopy.ui.CameraPrintProgress r4 = com.epson.cameracopy.ui.CameraPrintProgress.this
  114. java.lang.String r4 = r4.printerIp
  115. com.epson.mobilephone.common.wifidirect.WiFiDirectManager.disconnect(r0, r3, r4)
  116. L_0x002a:
  117. int r0 = r9.what
  118. r3 = 4
  119. r4 = 2
  120. r5 = 100
  121. r7 = 0
  122. switch(r0) {
  123. case 0: goto L_0x0459;
  124. case 1: goto L_0x0034;
  125. case 2: goto L_0x03ff;
  126. case 3: goto L_0x0034;
  127. case 4: goto L_0x03ae;
  128. case 5: goto L_0x027f;
  129. case 6: goto L_0x01ed;
  130. case 7: goto L_0x0034;
  131. case 8: goto L_0x018c;
  132. case 9: goto L_0x0036;
  133. case 10: goto L_0x0212;
  134. default: goto L_0x0034;
  135. }
  136. L_0x0034:
  137. goto L_0x0573
  138. L_0x0036:
  139. com.epson.cameracopy.ui.CameraPrintProgress r0 = com.epson.cameracopy.ui.CameraPrintProgress.this
  140. boolean unused = r0.mError = r2
  141. int r0 = r9.arg1
  142. r1 = -1100(0xfffffffffffffbb4, float:NaN)
  143. if (r0 == r1) goto L_0x0173
  144. r1 = -1056(0xfffffffffffffbe0, float:NaN)
  145. r3 = 2131624019(0x7f0e0053, float:1.8875206E38)
  146. r4 = 2131624018(0x7f0e0052, float:1.8875204E38)
  147. r5 = 2131624020(0x7f0e0054, float:1.8875208E38)
  148. r6 = 2131624021(0x7f0e0055, float:1.887521E38)
  149. if (r0 == r1) goto L_0x0136
  150. switch(r0) {
  151. case -1209: goto L_0x00f9;
  152. case -1208: goto L_0x00f9;
  153. default: goto L_0x0054;
  154. }
  155. L_0x0054:
  156. switch(r0) {
  157. case -1206: goto L_0x00e5;
  158. case -1205: goto L_0x00d1;
  159. case -1204: goto L_0x0136;
  160. case -1203: goto L_0x00bd;
  161. case -1202: goto L_0x00a9;
  162. case -1201: goto L_0x0095;
  163. case -1200: goto L_0x0136;
  164. default: goto L_0x0057;
  165. }
  166. L_0x0057:
  167. com.epson.cameracopy.ui.CameraPrintProgress r0 = com.epson.cameracopy.ui.CameraPrintProgress.this
  168. java.lang.String r0 = r0.getString(r6)
  169. java.lang.StringBuilder r1 = new java.lang.StringBuilder
  170. r1.<init>()
  171. com.epson.cameracopy.ui.CameraPrintProgress r6 = com.epson.cameracopy.ui.CameraPrintProgress.this
  172. java.lang.String r5 = r6.getString(r5)
  173. r1.append(r5)
  174. com.epson.cameracopy.ui.CameraPrintProgress r5 = com.epson.cameracopy.ui.CameraPrintProgress.this
  175. java.lang.String r4 = r5.getString(r4)
  176. r1.append(r4)
  177. java.lang.String r4 = "0X"
  178. r1.append(r4)
  179. int r9 = r9.arg1
  180. java.lang.String r9 = java.lang.Integer.toHexString(r9)
  181. java.lang.String r9 = r9.toUpperCase()
  182. r1.append(r9)
  183. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  184. java.lang.String r9 = r9.getString(r3)
  185. r1.append(r9)
  186. java.lang.String r9 = r1.toString()
  187. goto L_0x0185
  188. L_0x0095:
  189. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  190. r0 = 2131624025(0x7f0e0059, float:1.8875218E38)
  191. java.lang.String r0 = r9.getString(r0)
  192. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  193. r1 = 2131624024(0x7f0e0058, float:1.8875216E38)
  194. java.lang.String r9 = r9.getString(r1)
  195. goto L_0x0185
  196. L_0x00a9:
  197. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  198. r0 = 2131624028(0x7f0e005c, float:1.8875224E38)
  199. java.lang.String r0 = r9.getString(r0)
  200. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  201. r1 = 2131624027(0x7f0e005b, float:1.8875222E38)
  202. java.lang.String r9 = r9.getString(r1)
  203. goto L_0x0185
  204. L_0x00bd:
  205. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  206. r0 = 2131624023(0x7f0e0057, float:1.8875214E38)
  207. java.lang.String r0 = r9.getString(r0)
  208. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  209. r1 = 2131624022(0x7f0e0056, float:1.8875212E38)
  210. java.lang.String r9 = r9.getString(r1)
  211. goto L_0x0185
  212. L_0x00d1:
  213. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  214. r0 = 2131624016(0x7f0e0050, float:1.88752E38)
  215. java.lang.String r0 = r9.getString(r0)
  216. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  217. r1 = 2131624012(0x7f0e004c, float:1.8875192E38)
  218. java.lang.String r9 = r9.getString(r1)
  219. goto L_0x0185
  220. L_0x00e5:
  221. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  222. r0 = 2131624787(0x7f0e0353, float:1.8876764E38)
  223. java.lang.String r0 = r9.getString(r0)
  224. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  225. r1 = 2131624786(0x7f0e0352, float:1.8876762E38)
  226. java.lang.String r9 = r9.getString(r1)
  227. goto L_0x0185
  228. L_0x00f9:
  229. com.epson.cameracopy.ui.CameraPrintProgress r0 = com.epson.cameracopy.ui.CameraPrintProgress.this
  230. r1 = 2131624009(0x7f0e0049, float:1.8875186E38)
  231. java.lang.String r0 = r0.getString(r1)
  232. java.lang.StringBuilder r1 = new java.lang.StringBuilder
  233. r1.<init>()
  234. com.epson.cameracopy.ui.CameraPrintProgress r3 = com.epson.cameracopy.ui.CameraPrintProgress.this
  235. r4 = 2131624007(0x7f0e0047, float:1.8875182E38)
  236. java.lang.String r3 = r3.getString(r4)
  237. r1.append(r3)
  238. java.lang.String r3 = "0X"
  239. r1.append(r3)
  240. int r9 = r9.arg1
  241. java.lang.String r9 = java.lang.Integer.toHexString(r9)
  242. java.lang.String r9 = r9.toUpperCase()
  243. r1.append(r9)
  244. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  245. r3 = 2131624008(0x7f0e0048, float:1.8875184E38)
  246. java.lang.String r9 = r9.getString(r3)
  247. r1.append(r9)
  248. java.lang.String r9 = r1.toString()
  249. goto L_0x0185
  250. L_0x0136:
  251. com.epson.cameracopy.ui.CameraPrintProgress r0 = com.epson.cameracopy.ui.CameraPrintProgress.this
  252. java.lang.String r0 = r0.getString(r6)
  253. java.lang.StringBuilder r1 = new java.lang.StringBuilder
  254. r1.<init>()
  255. com.epson.cameracopy.ui.CameraPrintProgress r6 = com.epson.cameracopy.ui.CameraPrintProgress.this
  256. java.lang.String r5 = r6.getString(r5)
  257. r1.append(r5)
  258. com.epson.cameracopy.ui.CameraPrintProgress r5 = com.epson.cameracopy.ui.CameraPrintProgress.this
  259. java.lang.String r4 = r5.getString(r4)
  260. r1.append(r4)
  261. java.lang.String r4 = "0X"
  262. r1.append(r4)
  263. int r9 = r9.arg1
  264. java.lang.String r9 = java.lang.Integer.toHexString(r9)
  265. java.lang.String r9 = r9.toUpperCase()
  266. r1.append(r9)
  267. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  268. java.lang.String r9 = r9.getString(r3)
  269. r1.append(r9)
  270. java.lang.String r9 = r1.toString()
  271. goto L_0x0185
  272. L_0x0173:
  273. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  274. r0 = 2131624032(0x7f0e0060, float:1.8875232E38)
  275. java.lang.String r0 = r9.getString(r0)
  276. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  277. r1 = 2131624031(0x7f0e005f, float:1.887523E38)
  278. java.lang.String r9 = r9.getString(r1)
  279. L_0x0185:
  280. com.epson.cameracopy.ui.CameraPrintProgress r1 = com.epson.cameracopy.ui.CameraPrintProgress.this
  281. r1.showErrorDialog(r0, r9)
  282. goto L_0x0573
  283. L_0x018c:
  284. android.app.AlertDialog$Builder r9 = new android.app.AlertDialog$Builder
  285. com.epson.cameracopy.ui.CameraPrintProgress r0 = com.epson.cameracopy.ui.CameraPrintProgress.this
  286. android.content.Context r0 = r0.context
  287. r9.<init>(r0)
  288. android.app.AlertDialog$Builder r9 = r9.setCancelable(r7)
  289. java.lang.StringBuilder r0 = new java.lang.StringBuilder
  290. r0.<init>()
  291. com.epson.cameracopy.ui.CameraPrintProgress r1 = com.epson.cameracopy.ui.CameraPrintProgress.this
  292. r3 = 2131624796(0x7f0e035c, float:1.8876782E38)
  293. java.lang.String r1 = r1.getString(r3)
  294. r0.append(r1)
  295. java.lang.String r1 = "\n"
  296. r0.append(r1)
  297. com.epson.cameracopy.ui.CameraPrintProgress r1 = com.epson.cameracopy.ui.CameraPrintProgress.this
  298. r3 = 2131624797(0x7f0e035d, float:1.8876784E38)
  299. java.lang.String r1 = r1.getString(r3)
  300. r0.append(r1)
  301. java.lang.String r1 = "\n\n"
  302. r0.append(r1)
  303. com.epson.cameracopy.ui.CameraPrintProgress r1 = com.epson.cameracopy.ui.CameraPrintProgress.this
  304. r3 = 2131624798(0x7f0e035e, float:1.8876786E38)
  305. java.lang.String r1 = r1.getString(r3)
  306. r0.append(r1)
  307. java.lang.String r0 = r0.toString()
  308. android.app.AlertDialog$Builder r9 = r9.setMessage(r0)
  309. com.epson.cameracopy.ui.CameraPrintProgress r0 = com.epson.cameracopy.ui.CameraPrintProgress.this
  310. r1 = 2131625202(0x7f0e04f2, float:1.8877605E38)
  311. java.lang.String r0 = r0.getString(r1)
  312. com.epson.cameracopy.ui.CameraPrintProgress$4$1 r1 = new com.epson.cameracopy.ui.CameraPrintProgress$4$1
  313. r1.<init>()
  314. android.app.AlertDialog$Builder r9 = r9.setPositiveButton(r0, r1)
  315. r9.show()
  316. goto L_0x0573
  317. L_0x01ed:
  318. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  319. int unused = r9.curSheet = r2
  320. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  321. int unused = r9.curCopy = r2
  322. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  323. android.content.Context r9 = r9.context
  324. java.lang.String r0 = "printer"
  325. boolean r9 = com.epson.mobilephone.common.wifidirect.WiFiDirectManager.isNeedConnect(r9, r0)
  326. if (r9 != 0) goto L_0x0206
  327. goto L_0x0212
  328. L_0x0206:
  329. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  330. java.lang.String r0 = "printer"
  331. boolean r9 = com.epson.mobilephone.common.wifidirect.WiFiDirectManager.reconnect(r9, r0, r2)
  332. if (r9 == 0) goto L_0x0212
  333. goto L_0x0573
  334. L_0x0212:
  335. epson.print.service.IEpsonService r9 = com.epson.cameracopy.ui.CameraPrintProgress.mEpsonService
  336. if (r9 == 0) goto L_0x0274
  337. java.lang.String r9 = "Epson"
  338. java.lang.String r0 = "begin probe printer before printing"
  339. epson.print.Util.EPLog.e((java.lang.String) r9, (java.lang.String) r0) // Catch:{ RemoteException -> 0x026e }
  340. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this // Catch:{ RemoteException -> 0x026e }
  341. epson.print.MyPrinter r9 = epson.print.MyPrinter.getCurPrinter(r9) // Catch:{ RemoteException -> 0x026e }
  342. java.lang.String r0 = r9.getPrinterId() // Catch:{ RemoteException -> 0x026e }
  343. java.lang.String r1 = r9.getIp() // Catch:{ RemoteException -> 0x026e }
  344. if (r0 == 0) goto L_0x0243
  345. int r5 = r9.getLocation() // Catch:{ RemoteException -> 0x026e }
  346. if (r5 != r2) goto L_0x0243
  347. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this // Catch:{ RemoteException -> 0x026e }
  348. boolean unused = r9.bSearching = r2 // Catch:{ RemoteException -> 0x026e }
  349. epson.print.service.IEpsonService r9 = com.epson.cameracopy.ui.CameraPrintProgress.mEpsonService // Catch:{ RemoteException -> 0x026e }
  350. r9.searchPrinters(r0, r1, r2) // Catch:{ RemoteException -> 0x026e }
  351. goto L_0x0573
  352. L_0x0243:
  353. if (r1 == 0) goto L_0x025a
  354. int r9 = r9.getLocation() // Catch:{ RemoteException -> 0x026e }
  355. r5 = 3
  356. if (r9 != r5) goto L_0x025a
  357. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this // Catch:{ RemoteException -> 0x026e }
  358. boolean unused = r9.bSearching = r2 // Catch:{ RemoteException -> 0x026e }
  359. epson.print.service.IEpsonService r9 = com.epson.cameracopy.ui.CameraPrintProgress.mEpsonService // Catch:{ RemoteException -> 0x026e }
  360. r9.searchPrinters(r0, r1, r4) // Catch:{ RemoteException -> 0x026e }
  361. goto L_0x0573
  362. L_0x025a:
  363. com.epson.cameracopy.ui.CameraPrintProgress.isContinue = r7 // Catch:{ RemoteException -> 0x026e }
  364. r9 = -1351(0xfffffffffffffab9, float:NaN)
  365. com.epson.cameracopy.ui.CameraPrintProgress.curError = r9 // Catch:{ RemoteException -> 0x026e }
  366. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this // Catch:{ RemoteException -> 0x026e }
  367. boolean unused = r9.mError = r2 // Catch:{ RemoteException -> 0x026e }
  368. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this // Catch:{ RemoteException -> 0x026e }
  369. android.os.Handler r9 = r9.mHandler // Catch:{ RemoteException -> 0x026e }
  370. r9.sendEmptyMessage(r3) // Catch:{ RemoteException -> 0x026e }
  371. goto L_0x0573
  372. L_0x026e:
  373. r9 = move-exception
  374. r9.printStackTrace()
  375. goto L_0x0573
  376. L_0x0274:
  377. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  378. android.os.Handler r9 = r9.mHandler
  379. r0 = 10
  380. r9.sendEmptyMessageDelayed(r0, r5)
  381. goto L_0x0573
  382. L_0x027f:
  383. java.lang.String r9 = "PrintProgress"
  384. java.lang.StringBuilder r0 = new java.lang.StringBuilder
  385. r0.<init>()
  386. java.lang.String r4 = "message FINISH : mError => "
  387. r0.append(r4)
  388. com.epson.cameracopy.ui.CameraPrintProgress r4 = com.epson.cameracopy.ui.CameraPrintProgress.this
  389. boolean r4 = r4.mError
  390. r0.append(r4)
  391. java.lang.String r4 = " mCanceled =>"
  392. r0.append(r4)
  393. com.epson.cameracopy.ui.CameraPrintProgress r4 = com.epson.cameracopy.ui.CameraPrintProgress.this
  394. boolean r4 = r4.mCanceled
  395. r0.append(r4)
  396. java.lang.String r0 = r0.toString()
  397. epson.print.Util.EPLog.d(r9, r0)
  398. epson.print.service.IEpsonService r9 = com.epson.cameracopy.ui.CameraPrintProgress.mEpsonService
  399. if (r9 == 0) goto L_0x034d
  400. java.lang.Object r9 = com.epson.cameracopy.ui.CameraPrintProgress.mLock // Catch:{ RemoteException -> 0x031f }
  401. monitor-enter(r9) // Catch:{ RemoteException -> 0x031f }
  402. com.epson.cameracopy.ui.CameraPrintProgress r0 = com.epson.cameracopy.ui.CameraPrintProgress.this // Catch:{ all -> 0x031c }
  403. boolean r0 = r0.bSearchingPrinter // Catch:{ all -> 0x031c }
  404. if (r0 == 0) goto L_0x02da
  405. boolean r0 = com.epson.cameracopy.ui.CameraPrintProgress.bRestartactivity // Catch:{ all -> 0x031c }
  406. if (r0 != 0) goto L_0x02da
  407. epson.print.service.IEpsonService r0 = com.epson.cameracopy.ui.CameraPrintProgress.mEpsonService // Catch:{ all -> 0x031c }
  408. boolean r0 = r0.isSearchingPrinter() // Catch:{ all -> 0x031c }
  409. if (r0 == 0) goto L_0x02da
  410. java.lang.String r0 = "PrintProgress"
  411. java.lang.String r4 = "message FINISH: mEpsonService.cancelSearchPrinter()"
  412. epson.print.Util.EPLog.e((java.lang.String) r0, (java.lang.String) r4) // Catch:{ all -> 0x031c }
  413. epson.print.service.IEpsonService r0 = com.epson.cameracopy.ui.CameraPrintProgress.mEpsonService // Catch:{ all -> 0x031c }
  414. r0.cancelSearchPrinter() // Catch:{ all -> 0x031c }
  415. r0 = 1
  416. goto L_0x02db
  417. L_0x02da:
  418. r0 = 0
  419. L_0x02db:
  420. monitor-exit(r9) // Catch:{ all -> 0x031c }
  421. epson.print.service.IEpsonService r9 = com.epson.cameracopy.ui.CameraPrintProgress.mEpsonService // Catch:{ RemoteException -> 0x031f }
  422. if (r9 == 0) goto L_0x0301
  423. epson.print.service.IEpsonService r9 = com.epson.cameracopy.ui.CameraPrintProgress.mEpsonService // Catch:{ RemoteException -> 0x031f }
  424. boolean r9 = r9.isPrinting() // Catch:{ RemoteException -> 0x031f }
  425. if (r9 == 0) goto L_0x0301
  426. boolean r9 = com.epson.cameracopy.ui.CameraPrintProgress.bRestartactivity // Catch:{ RemoteException -> 0x031f }
  427. if (r9 != 0) goto L_0x0301
  428. java.lang.String r9 = "PrintProgress"
  429. java.lang.String r0 = "message FINISH: mEpsonService.confirmCancel(true) call"
  430. epson.print.Util.EPLog.d(r9, r0) // Catch:{ RemoteException -> 0x031f }
  431. epson.print.service.IEpsonService r9 = com.epson.cameracopy.ui.CameraPrintProgress.mEpsonService // Catch:{ RemoteException -> 0x031f }
  432. r9.confirmCancel(r2) // Catch:{ RemoteException -> 0x031f }
  433. r0 = 1
  434. L_0x0301:
  435. if (r0 == 0) goto L_0x0323
  436. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this // Catch:{ RemoteException -> 0x031f }
  437. boolean r9 = r9.mWaitEpsonServiceForFinish // Catch:{ RemoteException -> 0x031f }
  438. if (r9 == 0) goto L_0x0323
  439. java.lang.String r9 = "PrintProgress"
  440. java.lang.String r0 = "on message FINISH: sendEmptyMessageDelayed(FINISH...)"
  441. epson.print.Util.EPLog.d(r9, r0) // Catch:{ RemoteException -> 0x031f }
  442. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this // Catch:{ RemoteException -> 0x031f }
  443. android.os.Handler r9 = r9.mHandler // Catch:{ RemoteException -> 0x031f }
  444. r4 = 500(0x1f4, double:2.47E-321)
  445. r9.sendEmptyMessageDelayed(r1, r4) // Catch:{ RemoteException -> 0x031f }
  446. return r2
  447. L_0x031c:
  448. r0 = move-exception
  449. monitor-exit(r9) // Catch:{ all -> 0x031c }
  450. throw r0 // Catch:{ RemoteException -> 0x031f }
  451. L_0x031f:
  452. r9 = move-exception
  453. r9.printStackTrace()
  454. L_0x0323:
  455. epson.print.service.IEpsonService r9 = com.epson.cameracopy.ui.CameraPrintProgress.mEpsonService // Catch:{ RemoteException -> 0x0349 }
  456. if (r9 == 0) goto L_0x034d
  457. java.lang.String r9 = "PrintProgress"
  458. java.lang.String r0 = "message FINISH: mEpsonService.unregisterCallback() call"
  459. epson.print.Util.EPLog.e((java.lang.String) r9, (java.lang.String) r0) // Catch:{ RemoteException -> 0x0349 }
  460. epson.print.service.IEpsonService r9 = com.epson.cameracopy.ui.CameraPrintProgress.mEpsonService // Catch:{ RemoteException -> 0x0349 }
  461. epson.print.service.IEpsonServiceCallback r0 = com.epson.cameracopy.ui.CameraPrintProgress.mCallback // Catch:{ RemoteException -> 0x0349 }
  462. r9.unregisterCallback(r0) // Catch:{ RemoteException -> 0x0349 }
  463. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this // Catch:{ RemoteException -> 0x0349 }
  464. android.content.ServiceConnection r0 = com.epson.cameracopy.ui.CameraPrintProgress.mEpsonConnection // Catch:{ RemoteException -> 0x0349 }
  465. r9.unbindService(r0) // Catch:{ RemoteException -> 0x0349 }
  466. r9 = 0
  467. epson.print.service.IEpsonService unused = com.epson.cameracopy.ui.CameraPrintProgress.mEpsonService = r9 // Catch:{ RemoteException -> 0x0349 }
  468. goto L_0x034d
  469. L_0x0349:
  470. r9 = move-exception
  471. r9.printStackTrace()
  472. L_0x034d:
  473. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  474. boolean r9 = r9.mCanceled
  475. if (r9 == 0) goto L_0x0355
  476. r3 = 0
  477. goto L_0x035f
  478. L_0x0355:
  479. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  480. boolean r9 = r9.mError
  481. if (r9 == 0) goto L_0x035f
  482. r3 = 1000(0x3e8, float:1.401E-42)
  483. L_0x035f:
  484. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  485. android.app.Activity r9 = r9.getParent()
  486. if (r9 != 0) goto L_0x036d
  487. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  488. r9.setResult(r3)
  489. goto L_0x0376
  490. L_0x036d:
  491. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  492. android.app.Activity r9 = r9.getParent()
  493. r9.setResult(r3)
  494. L_0x0376:
  495. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  496. boolean unused = r9.bSearching = r7
  497. java.lang.String r9 = "PrintProgress"
  498. java.lang.StringBuilder r0 = new java.lang.StringBuilder
  499. r0.<init>()
  500. java.lang.String r1 = "finish with return code => "
  501. r0.append(r1)
  502. r0.append(r3)
  503. java.lang.String r0 = r0.toString()
  504. epson.print.Util.EPLog.d(r9, r0)
  505. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  506. android.content.Context r9 = r9.context
  507. java.lang.String r0 = "printer"
  508. com.epson.cameracopy.ui.CameraPrintProgress r1 = com.epson.cameracopy.ui.CameraPrintProgress.this
  509. java.lang.String r1 = r1.printerIp
  510. com.epson.mobilephone.common.wifidirect.WiFiDirectManager.disconnect(r9, r0, r1)
  511. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  512. r9.sendPrintLog()
  513. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  514. r9.finish()
  515. goto L_0x0573
  516. L_0x03ae:
  517. java.lang.String r9 = "Epson"
  518. java.lang.String r0 = "NOTIFY ERROR"
  519. epson.print.Util.EPLog.e((java.lang.String) r9, (java.lang.String) r0)
  520. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  521. boolean r9 = r9.isDialogOpen
  522. if (r9 != 0) goto L_0x03d6
  523. java.lang.String r9 = "Epson"
  524. java.lang.StringBuilder r0 = new java.lang.StringBuilder
  525. r0.<init>()
  526. java.lang.String r1 = "Show Error code:"
  527. r0.append(r1)
  528. int r1 = com.epson.cameracopy.ui.CameraPrintProgress.curError
  529. r0.append(r1)
  530. java.lang.String r0 = r0.toString()
  531. epson.print.Util.EPLog.e((java.lang.String) r9, (java.lang.String) r0)
  532. goto L_0x03f3
  533. L_0x03d6:
  534. java.lang.String r9 = "Epson"
  535. java.lang.StringBuilder r0 = new java.lang.StringBuilder
  536. r0.<init>()
  537. java.lang.String r1 = "Remove and show Error code:"
  538. r0.append(r1)
  539. int r1 = com.epson.cameracopy.ui.CameraPrintProgress.curError
  540. r0.append(r1)
  541. java.lang.String r0 = r0.toString()
  542. epson.print.Util.EPLog.e((java.lang.String) r9, (java.lang.String) r0)
  543. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  544. r9.removeDialog(r7)
  545. L_0x03f3:
  546. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  547. boolean unused = r9.isDialogOpen = r2
  548. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  549. r9.showDialog(r7)
  550. goto L_0x0573
  551. L_0x03ff:
  552. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  553. boolean unused = r9.mError = r7
  554. epson.print.service.IEpsonService r9 = com.epson.cameracopy.ui.CameraPrintProgress.mEpsonService
  555. if (r9 == 0) goto L_0x0426
  556. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this // Catch:{ Exception -> 0x0420 }
  557. boolean unused = r9.bSearching = r7 // Catch:{ Exception -> 0x0420 }
  558. epson.print.service.IEpsonService r9 = com.epson.cameracopy.ui.CameraPrintProgress.mEpsonService // Catch:{ Exception -> 0x0420 }
  559. com.epson.cameracopy.ui.CameraPrintProgress r0 = com.epson.cameracopy.ui.CameraPrintProgress.this // Catch:{ Exception -> 0x0420 }
  560. java.util.ArrayList r0 = r0.mImageAndLayoutList // Catch:{ Exception -> 0x0420 }
  561. boolean r1 = com.epson.cameracopy.ui.CameraPrintProgress.isBkRetry // Catch:{ Exception -> 0x0420 }
  562. r9.printWithImagesAndLayouts(r0, r1) // Catch:{ Exception -> 0x0420 }
  563. goto L_0x0573
  564. L_0x0420:
  565. r9 = move-exception
  566. r9.printStackTrace()
  567. goto L_0x0573
  568. L_0x0426:
  569. java.lang.String r9 = "Epson"
  570. java.lang.String r0 = "Service or resource file not ready, please wait..."
  571. epson.print.Util.EPLog.i(r9, r0)
  572. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  573. android.widget.TextView r9 = r9.mPercent
  574. java.lang.StringBuilder r0 = new java.lang.StringBuilder
  575. r0.<init>()
  576. com.epson.cameracopy.ui.CameraPrintProgress r1 = com.epson.cameracopy.ui.CameraPrintProgress.this
  577. java.lang.String r1 = r1.percentString
  578. r0.append(r1)
  579. java.lang.String r1 = " 0%"
  580. r0.append(r1)
  581. java.lang.String r0 = r0.toString()
  582. r9.setText(r0)
  583. android.widget.ProgressBar r9 = com.epson.cameracopy.ui.CameraPrintProgress.mProgressPercent
  584. r9.setProgress(r7)
  585. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  586. android.os.Handler r9 = r9.mHandler
  587. r9.sendEmptyMessageDelayed(r4, r5)
  588. goto L_0x0573
  589. L_0x0459:
  590. android.os.Bundle r9 = r9.getData()
  591. java.lang.String r0 = "PERCENT"
  592. int r9 = r9.getInt(r0)
  593. r0 = 100
  594. if (r9 < r0) goto L_0x0469
  595. r9 = 100
  596. L_0x0469:
  597. if (r9 > 0) goto L_0x0548
  598. android.widget.ProgressBar r9 = com.epson.cameracopy.ui.CameraPrintProgress.mProgressPercent
  599. r9.setProgress(r7)
  600. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  601. android.widget.TextView r9 = r9.mPercent
  602. java.lang.StringBuilder r1 = new java.lang.StringBuilder
  603. r1.<init>()
  604. com.epson.cameracopy.ui.CameraPrintProgress r3 = com.epson.cameracopy.ui.CameraPrintProgress.this
  605. java.lang.String r3 = r3.percentString
  606. r1.append(r3)
  607. java.lang.String r3 = " 0%"
  608. r1.append(r3)
  609. java.lang.String r1 = r1.toString()
  610. r9.setText(r1)
  611. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  612. int r9 = r9.sheets
  613. if (r9 <= r2) goto L_0x04e2
  614. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  615. android.widget.TextView r9 = r9.mPage
  616. java.lang.StringBuilder r1 = new java.lang.StringBuilder
  617. r1.<init>()
  618. com.epson.cameracopy.ui.CameraPrintProgress r3 = com.epson.cameracopy.ui.CameraPrintProgress.this
  619. r4 = 2131624963(0x7f0e0403, float:1.887712E38)
  620. java.lang.String r3 = r3.getString(r4)
  621. r1.append(r3)
  622. java.lang.String r3 = ": "
  623. r1.append(r3)
  624. com.epson.cameracopy.ui.CameraPrintProgress r3 = com.epson.cameracopy.ui.CameraPrintProgress.this
  625. int r3 = r3.curSheet
  626. r1.append(r3)
  627. java.lang.String r3 = "/"
  628. r1.append(r3)
  629. com.epson.cameracopy.ui.CameraPrintProgress r3 = com.epson.cameracopy.ui.CameraPrintProgress.this
  630. int r3 = r3.sheets
  631. r1.append(r3)
  632. java.lang.String r1 = r1.toString()
  633. r9.setText(r1)
  634. android.widget.ProgressBar r9 = com.epson.cameracopy.ui.CameraPrintProgress.mProgressPage
  635. com.epson.cameracopy.ui.CameraPrintProgress r1 = com.epson.cameracopy.ui.CameraPrintProgress.this
  636. int r1 = r1.curSheet
  637. int r1 = r1 * 100
  638. com.epson.cameracopy.ui.CameraPrintProgress r3 = com.epson.cameracopy.ui.CameraPrintProgress.this
  639. int r3 = r3.sheets
  640. int r1 = r1 / r3
  641. r9.setProgress(r1)
  642. L_0x04e2:
  643. int r9 = com.epson.cameracopy.ui.CameraPrintProgress.copies
  644. if (r9 <= r2) goto L_0x052a
  645. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  646. android.widget.TextView r9 = r9.mCopies
  647. java.lang.StringBuilder r1 = new java.lang.StringBuilder
  648. r1.<init>()
  649. com.epson.cameracopy.ui.CameraPrintProgress r3 = com.epson.cameracopy.ui.CameraPrintProgress.this
  650. r4 = 2131624716(0x7f0e030c, float:1.887662E38)
  651. java.lang.String r3 = r3.getString(r4)
  652. r1.append(r3)
  653. java.lang.String r3 = ": "
  654. r1.append(r3)
  655. com.epson.cameracopy.ui.CameraPrintProgress r3 = com.epson.cameracopy.ui.CameraPrintProgress.this
  656. int r3 = r3.curCopy
  657. r1.append(r3)
  658. java.lang.String r3 = "/"
  659. r1.append(r3)
  660. int r3 = com.epson.cameracopy.ui.CameraPrintProgress.copies
  661. r1.append(r3)
  662. java.lang.String r1 = r1.toString()
  663. r9.setText(r1)
  664. android.widget.ProgressBar r9 = com.epson.cameracopy.ui.CameraPrintProgress.mProgressCopies
  665. com.epson.cameracopy.ui.CameraPrintProgress r1 = com.epson.cameracopy.ui.CameraPrintProgress.this
  666. int r1 = r1.curCopy
  667. int r1 = r1 * 100
  668. int r0 = com.epson.cameracopy.ui.CameraPrintProgress.copies
  669. int r1 = r1 / r0
  670. r9.setProgress(r1)
  671. L_0x052a:
  672. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  673. com.epson.cameracopy.ui.CameraPrintProgress.access$1208(r9)
  674. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  675. int r9 = r9.curSheet
  676. com.epson.cameracopy.ui.CameraPrintProgress r0 = com.epson.cameracopy.ui.CameraPrintProgress.this
  677. int r0 = r0.sheets
  678. if (r9 <= r0) goto L_0x0573
  679. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  680. int unused = r9.curSheet = r2
  681. com.epson.cameracopy.ui.CameraPrintProgress r9 = com.epson.cameracopy.ui.CameraPrintProgress.this
  682. com.epson.cameracopy.ui.CameraPrintProgress.access$1308(r9)
  683. goto L_0x0573
  684. L_0x0548:
  685. android.widget.ProgressBar r0 = com.epson.cameracopy.ui.CameraPrintProgress.mProgressPercent
  686. r0.setProgress(r9)
  687. com.epson.cameracopy.ui.CameraPrintProgress r0 = com.epson.cameracopy.ui.CameraPrintProgress.this
  688. android.widget.TextView r0 = r0.mPercent
  689. java.lang.StringBuilder r1 = new java.lang.StringBuilder
  690. r1.<init>()
  691. com.epson.cameracopy.ui.CameraPrintProgress r3 = com.epson.cameracopy.ui.CameraPrintProgress.this
  692. java.lang.String r3 = r3.percentString
  693. r1.append(r3)
  694. java.lang.String r3 = " "
  695. r1.append(r3)
  696. r1.append(r9)
  697. java.lang.String r9 = "%"
  698. r1.append(r9)
  699. java.lang.String r9 = r1.toString()
  700. r0.setText(r9)
  701. L_0x0573:
  702. return r2
  703. */
  704. throw new UnsupportedOperationException("Method not decompiled: com.epson.cameracopy.ui.CameraPrintProgress.C08464.handleMessage(android.os.Message):boolean");
  705. }
  706. });
  707. private ArrayList<ImageAndLayout> mImageAndLayoutList;
  708. TextView mPage;
  709. TextView mPercent;
  710. private volatile boolean mWaitEpsonServiceForFinish = false;
  711. private String percentString = "";
  712. private String printerIp;
  713. private int sheets;
  714. public static boolean isPrintSuccess(int i) {
  715. return i == 4;
  716. }
  717. static /* synthetic */ int access$1208(CameraPrintProgress cameraPrintProgress) {
  718. int i = cameraPrintProgress.curSheet;
  719. cameraPrintProgress.curSheet = i + 1;
  720. return i;
  721. }
  722. static /* synthetic */ int access$1308(CameraPrintProgress cameraPrintProgress) {
  723. int i = cameraPrintProgress.curCopy;
  724. cameraPrintProgress.curCopy = i + 1;
  725. return i;
  726. }
  727. /* JADX WARNING: Code restructure failed: missing block: B:10:0x000e, code lost:
  728. epson.print.Util.EPLog.e("Epson", "mEpsonService = null");
  729. mCallback = new com.epson.cameracopy.ui.CameraPrintProgress.C08391(r3);
  730. mEpsonConnection = new com.epson.cameracopy.ui.CameraPrintProgress.C08442(r3);
  731. epson.print.Util.EPLog.e("Epson", "bindService() call");
  732. bindService(new android.content.Intent(r3, epson.print.service.EpsonService.class), mEpsonConnection, 1);
  733. epson.print.Util.EPLog.e("Epson", "bindService() finish");
  734. */
  735. /* JADX WARNING: Code restructure failed: missing block: B:18:?, code lost:
  736. return;
  737. */
  738. /* JADX WARNING: Code restructure failed: missing block: B:19:?, code lost:
  739. return;
  740. */
  741. /* JADX WARNING: Code restructure failed: missing block: B:9:0x000c, code lost:
  742. if (mEpsonService != null) goto L_?;
  743. */
  744. /* Code decompiled incorrectly, please refer to instructions dump. */
  745. private void init() {
  746. /*
  747. r3 = this;
  748. java.lang.Object r0 = mLockInit
  749. monitor-enter(r0)
  750. epson.print.service.IEpsonService r1 = mEpsonService // Catch:{ all -> 0x003f }
  751. if (r1 == 0) goto L_0x0009
  752. monitor-exit(r0) // Catch:{ all -> 0x003f }
  753. return
  754. L_0x0009:
  755. monitor-exit(r0) // Catch:{ all -> 0x003f }
  756. epson.print.service.IEpsonService r0 = mEpsonService
  757. if (r0 != 0) goto L_0x003e
  758. java.lang.String r0 = "Epson"
  759. java.lang.String r1 = "mEpsonService = null"
  760. epson.print.Util.EPLog.e((java.lang.String) r0, (java.lang.String) r1)
  761. com.epson.cameracopy.ui.CameraPrintProgress$1 r0 = new com.epson.cameracopy.ui.CameraPrintProgress$1
  762. r0.<init>()
  763. mCallback = r0
  764. com.epson.cameracopy.ui.CameraPrintProgress$2 r0 = new com.epson.cameracopy.ui.CameraPrintProgress$2
  765. r0.<init>()
  766. mEpsonConnection = r0
  767. java.lang.String r0 = "Epson"
  768. java.lang.String r1 = "bindService() call"
  769. epson.print.Util.EPLog.e((java.lang.String) r0, (java.lang.String) r1)
  770. android.content.Intent r0 = new android.content.Intent
  771. java.lang.Class<epson.print.service.EpsonService> r1 = epson.print.service.EpsonService.class
  772. r0.<init>(r3, r1)
  773. android.content.ServiceConnection r1 = mEpsonConnection
  774. r2 = 1
  775. r3.bindService(r0, r1, r2)
  776. java.lang.String r0 = "Epson"
  777. java.lang.String r1 = "bindService() finish"
  778. epson.print.Util.EPLog.e((java.lang.String) r0, (java.lang.String) r1)
  779. L_0x003e:
  780. return
  781. L_0x003f:
  782. r1 = move-exception
  783. monitor-exit(r0) // Catch:{ all -> 0x003f }
  784. throw r1
  785. */
  786. throw new UnsupportedOperationException("Method not decompiled: com.epson.cameracopy.ui.CameraPrintProgress.init():void");
  787. }
  788. protected void onCreate(Bundle bundle) {
  789. EPLog.e("Epson", "PrintProgress.java: onCreate() call");
  790. EPLog.e("Epson", "addFlags : FLAG_KEEP_SCREEN_ON ");
  791. getWindow().addFlags(128);
  792. super.onCreate(bundle);
  793. Utils.setFInishOnTOuchOutside(this, false);
  794. mError = false;
  795. curError = 0;
  796. mWaitEpsonServiceForFinish = false;
  797. synchronized (mLockInit) {
  798. EPLog.e("Epson", "PrintProgress.java: onCreate() call init() funciton");
  799. init();
  800. }
  801. isDocument = getIntent().getExtras().getBoolean(PrintProgress.PARAM_DOCUMENT_MODE, false);
  802. isDocument = true;
  803. PrintSetting printSetting = new PrintSetting(this, PrintSetting.Kind.cameracopy);
  804. printSetting.loadSettings();
  805. copies = printSetting.copiesValue;
  806. mImageAndLayoutList = getIntent().getExtras().getParcelableArrayList(KEY_IMAGE_AND_LAYOUT);
  807. ArrayList<ImageAndLayout> arrayList = mImageAndLayoutList;
  808. if (arrayList == null) {
  809. finish();
  810. return;
  811. }
  812. sheets = arrayList.size();
  813. isRemotePrinter = MyPrinter.isRemotePrinter(this);
  814. setContentView(R.layout.progress_layout);
  815. context = this;
  816. mProgressPercent = (ProgressBar) findViewById(R.id.progress_percent);
  817. mPercent = (TextView) findViewById(R.id.percent);
  818. mProgressCopies = (ProgressBar) findViewById(R.id.progress_copies);
  819. mCopies = (TextView) findViewById(R.id.copies);
  820. mPage = (TextView) findViewById(R.id.page);
  821. mProgressPage = (ProgressBar) findViewById(R.id.progress_page);
  822. if (this.sheets > 1) {
  823. TextView textView = mPage;
  824. textView.setText(getString(R.string.page) + ": " + curSheet + CommonDefine.SLASH + sheets);
  825. mProgressPage.setProgress((this.curSheet * 100) / sheets);
  826. } else {
  827. mProgressPage.setVisibility(4);
  828. mPage.setVisibility(4);
  829. }
  830. if (copies <= 1 || isRemotePrinter) {
  831. mProgressCopies.setVisibility(4);
  832. mCopies.setVisibility(4);
  833. copies = 1;
  834. } else {
  835. TextView textView2 = mCopies;
  836. textView2.setText(getString(R.string.copies) + ": " + curCopy + CommonDefine.SLASH + copies);
  837. mProgressCopies.setProgress((this.curCopy * 100) / copies);
  838. }
  839. mCancelButton = (Button) findViewById(R.id.cancel_button);
  840. mCancelButton.setOnClickListener(new View.OnClickListener() {
  841. public void onClick(View view) {
  842. CameraPrintProgress.this.CancelPrint();
  843. }
  844. });
  845. bSearching = false;
  846. if (this.isRemotePrinter) {
  847. percentString = getString(R.string.epsonconnect_str_remote_print_file_uploading);
  848. } else {
  849. percentString = getString(R.string.printing);
  850. }
  851. TextView textView3 = mPercent;
  852. textView3.setText(this.percentString + " 0%");
  853. mProgressPercent.setProgress(0);
  854. findViewById(R.id.epsonColorImageView).setVisibility(View.GONE);
  855. if (this.isRemotePrinter) {
  856. mHandler.sendEmptyMessage(2);
  857. } else {
  858. mHandler.sendEmptyMessage(6);
  859. }
  860. EPLog.i("Epson", "printProgress.java: onCreate() finish");
  861. }
  862. private void triggerPrint() {
  863. mHandler.sendEmptyMessage(2);
  864. }
  865. protected void onDestroy() {
  866. super.onDestroy();
  867. EPLog.e("Epson", "PrintProgress.java: onDestroy()call");
  868. EPLog.e("Epson", "clearFlags : FLAG_KEEP_SCREEN_ON ");
  869. getWindow().clearFlags(128);
  870. mHandler.removeMessages(1);
  871. mHandler.removeMessages(3);
  872. mHandler.removeMessages(2);
  873. mHandler.removeMessages(4);
  874. EPLog.e("Epson", "PrintProgress.java: onDestroy() finish");
  875. }
  876. protected void onStop() {
  877. super.onStop();
  878. if (mEpsonService == null) {
  879. EPLog.e("Epson", "set bRestartactivity = true (2)");
  880. }
  881. }
  882. protected void onResume() {
  883. super.onResume();
  884. EPLog.e("Epson", "PrintProgress.java call onResume()");
  885. NfcTagUtils.enableForegroundDispatch(this, (IntentFilter[]) null, (String[][]) null);
  886. }
  887. protected void onPause() {
  888. super.onPause();
  889. NfcTagUtils.disableForegroundDispatch(this);
  890. }
  891. protected Dialog onCreateDialog(int i) {
  892. switch (i) {
  893. case 0:
  894. EPLog.e("Epson", "show dialog: " + curError + " cancontinue: " + isContinue);
  895. removeDialog(1);
  896. Integer[] stringId = MediaInfo.ErrorTable.getStringId(curError);
  897. if (stringId == null) {
  898. stringId = new Integer[]{Integer.valueOf(R.string.NOT_IMPLEMENT), Integer.valueOf(R.string.NOT_IMPLEMENT_TITLE), 1};
  899. }
  900. String[] replaceMessage = Utils.replaceMessage(stringId, curError, getApplicationContext());
  901. if (!isContinue) {
  902. EPLog.e("Epson", "show str_cancel button");
  903. AlertDialog.Builder negativeButton = new CustomTitleAlertDialogBuilder(this).setCancelable(false).setTitle(replaceMessage[1]).setMessage(replaceMessage[0]).setNegativeButton(getString(R.string.str_cancel), new DialogInterface.OnClickListener() {
  904. public void onClick(DialogInterface dialogInterface, int i) {
  905. try {
  906. CameraPrintProgress.mEpsonService.confirmContinueable(false);
  907. } catch (RemoteException e) {
  908. e.printStackTrace();
  909. }
  910. EPLog.e("Epson", "user click str_cancel button");
  911. CameraPrintProgress.curError = 0;
  912. boolean unused = CameraPrintProgress.this.isDialogOpen = false;
  913. CameraPrintProgress.this.removeDialog(0);
  914. CameraPrintProgress.mHandler.sendEmptyMessage(5);
  915. }
  916. });
  917. negativeButton.setOnKeyListener(new DialogInterface.OnKeyListener() {
  918. public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) {
  919. return keyEvent.getKeyCode() == 84;
  920. }
  921. });
  922. return negativeButton.create();
  923. }
  924. AlertDialog.Builder negativeButton2 = new CustomTitleAlertDialogBuilder(this).setTitle((CharSequence) replaceMessage[1]).setMessage(replaceMessage[0]).setCancelable(false).setPositiveButton(getString(R.string.str_continue), new DialogInterface.OnClickListener() {
  925. public void onClick(DialogInterface dialogInterface, int i) {
  926. try {
  927. if (CameraPrintProgress.curError == 109) {
  928. CameraPrintProgress.isBkRetry = true;
  929. CameraPrintProgress.this.triggerPrint();
  930. }
  931. CameraPrintProgress.mEpsonService.confirmContinueable(true);
  932. CameraPrintProgress.curError = 0;
  933. boolean unused = CameraPrintProgress.mError = false;
  934. } catch (RemoteException e) {
  935. e.printStackTrace();
  936. }
  937. boolean unused2 = CameraPrintProgress.this.isDialogOpen = false;
  938. CameraPrintProgress.this.removeDialog(0);
  939. }
  940. }).setNegativeButton(getString(R.string.str_cancel), new DialogInterface.OnClickListener() {
  941. public void onClick(DialogInterface dialogInterface, int i) {
  942. boolean unused = CameraPrintProgress.this.isDialogOpen = false;
  943. CameraPrintProgress.this.removeDialog(0);
  944. try {
  945. CameraPrintProgress.mEpsonService.confirmContinueable(false);
  946. CameraPrintProgress.curError = 0;
  947. } catch (RemoteException e) {
  948. e.printStackTrace();
  949. }
  950. boolean unused2 = CameraPrintProgress.mWaitEpsonServiceForFinish = true;
  951. boolean unused3 = CameraPrintProgress.mError = true;
  952. EPLog.d("PrintProgress", "cont/cancel dialog. cancel clicked");
  953. CameraPrintProgress.mHandler.sendEmptyMessage(5);
  954. }
  955. });
  956. negativeButton2.setOnKeyListener(new DialogInterface.OnKeyListener() {
  957. public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) {
  958. return keyEvent.getKeyCode() == 84;
  959. }
  960. });
  961. return negativeButton2.create();
  962. case 1:
  963. if (this.isDialogOpen) {
  964. return null;
  965. }
  966. 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() {
  967. public void onClick(DialogInterface dialogInterface, int i) {
  968. CameraPrintProgress.mHandler.removeMessages(1);
  969. try {
  970. EPLog.e("Epson", "user choice cancel print from GUI");
  971. if ((CameraPrintProgress.mEpsonService != null ? CameraPrintProgress.mEpsonService.confirmCancel(true) : 0) == 0) {
  972. synchronized (CameraPrintProgress.lockBCancel) {
  973. EPLog.e("Epson", "===> set bCancel = true");
  974. }
  975. }
  976. } catch (RemoteException e) {
  977. e.printStackTrace();
  978. }
  979. CameraPrintProgress.this.removeDialog(1);
  980. CameraPrintProgress cameraPrintProgress = CameraPrintProgress.this;
  981. cameraPrintProgress.mCanceled = true;
  982. cameraPrintProgress.mCancelButton.setVisibility(4);
  983. CameraPrintProgress.mCancelButton.setEnabled(false);
  984. if (CameraPrintProgress.this.bSearching) {
  985. CameraPrintProgress.mHandler.sendEmptyMessage(5);
  986. boolean unused = CameraPrintProgress.this.bSearching = false;
  987. }
  988. }
  989. }).setNegativeButton(getString(R.string.str_no), new DialogInterface.OnClickListener() {
  990. public void onClick(DialogInterface dialogInterface, int i) {
  991. CameraPrintProgress.this.removeDialog(1);
  992. }
  993. });
  994. negativeButton3.setOnKeyListener(new DialogInterface.OnKeyListener() {
  995. public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) {
  996. return keyEvent.getKeyCode() == 84;
  997. }
  998. });
  999. return negativeButton3.create();
  1000. default:
  1001. return null;
  1002. }
  1003. }
  1004. protected void onActivityResult(int i, int i2, Intent intent) {
  1005. super.onActivityResult(i, i2, intent);
  1006. if (i == 1) {
  1007. switch (i2) {
  1008. case -1:
  1009. mHandler.sendEmptyMessage(10);
  1010. return;
  1011. case 0:
  1012. mHandler.sendEmptyMessage(5);
  1013. return;
  1014. default:
  1015. return;
  1016. }
  1017. }
  1018. }
  1019. private void CancelPrint() {
  1020. try {
  1021. if (mEpsonService != null) {
  1022. mEpsonService.cancelPrint();
  1023. }
  1024. } catch (RemoteException e) {
  1025. e.printStackTrace();
  1026. }
  1027. showDialog(1);
  1028. }
  1029. public void onBackPressed() {
  1030. EPLog.e("Epson", "onBackPressed()call");
  1031. }
  1032. public boolean onKeyDown(int i, KeyEvent keyEvent) {
  1033. EPLog.e("Epson", "onKeyDown() call");
  1034. if (keyEvent.getAction() != 0 || i != 84) {
  1035. return false;
  1036. }
  1037. EPLog.e("Epson", "onKeyDown() KEYCODE_SEARCH key press");
  1038. return true;
  1039. }
  1040. public void showErrorDialog(String str, String str2) {
  1041. new CustomTitleAlertDialogBuilder(this).setCancelable(false).setTitle(str).setMessage(str2).setNegativeButton(getString(R.string.ok_button), new DialogInterface.OnClickListener() {
  1042. public void onClick(DialogInterface dialogInterface, int i) {
  1043. dialogInterface.cancel();
  1044. CameraPrintProgress.mHandler.sendEmptyMessage(5);
  1045. }
  1046. }).create().show();
  1047. }
  1048. private void sendPrintLog() {
  1049. Analytics.sendPrintLog(this, new CameraCopyProgressParams());
  1050. }
  1051. }