RemoteCopyTask.java 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571
  1. package epson.print.copy.Component.ecopycomponent;
  2. import android.content.Context;
  3. import android.os.AsyncTask;
  4. import android.support.annotation.NonNull;
  5. import com.epson.iprint.prtlogger.Analytics;
  6. import com.epson.iprint.prtlogger.CommonLog;
  7. import com.epson.iprint.prtlogger.PrintLog;
  8. import epson.print.copy.Component.ecopycomponent.ECopyComponent;
  9. import epson.print.copy.Component.eremoteoperation.ERemoteCopy;
  10. import epson.print.copy.Component.eremoteoperation.ERemoteOperation;
  11. import epson.print.copy.Component.eremoteoperation.ERemotePrinter;
  12. import java.util.ArrayList;
  13. import java.util.Iterator;
  14. class RemoteCopyTask extends AsyncTask<Void, Progress, Result> implements ECopyComponent.ITask {
  15. ERemoteCopy.IRemoteCancelParameter cancelParameter;
  16. boolean cancelRequested;
  17. String clientID;
  18. CopyMode copyMode;
  19. String jobToken;
  20. private Context mContext;
  21. private CopyParams mCopyParams;
  22. ERemoteCopy operation;
  23. ECopyOptionContext optionContext;
  24. Progress progress;
  25. String recoverJobToken;
  26. ECopyComponent.ICopyStatusListener statusListener;
  27. ERemoteCopy.IRemoteCopyStatusParameter statusParameter;
  28. ECopyComponent.ICopySystemSettings systemSettings;
  29. public enum CopyMode {
  30. Copy,
  31. Recover
  32. }
  33. class Progress {
  34. int currentPages;
  35. ECopyComponent.ICopyInvalidateResumeRequest resumeRequest;
  36. ECopyComponent.ICopyResumeRequest.ResumeState resumeState;
  37. ECopyComponent.ICopyStatusListener.CopyTaskProgress taskProgress;
  38. int totalPages;
  39. Progress() {
  40. }
  41. }
  42. class Result {
  43. ECopyComponent.ICopyStatusListener.CopyTaskResult taskResult;
  44. private void setResult(ERemoteOperation.ERemoteParam eRemoteParam) {
  45. switch (eRemoteParam) {
  46. case none:
  47. this.taskResult = ECopyComponent.ICopyStatusListener.CopyTaskResult.Succeed;
  48. return;
  49. case success:
  50. this.taskResult = ECopyComponent.ICopyStatusListener.CopyTaskResult.Succeed;
  51. return;
  52. case canceled:
  53. this.taskResult = ECopyComponent.ICopyStatusListener.CopyTaskResult.Canceled;
  54. return;
  55. case busy:
  56. this.taskResult = ECopyComponent.ICopyStatusListener.CopyTaskResult.Busy;
  57. return;
  58. case illegal_combination:
  59. this.taskResult = ECopyComponent.ICopyStatusListener.CopyTaskResult.ErrorOther;
  60. return;
  61. case memory_full:
  62. this.taskResult = ECopyComponent.ICopyStatusListener.CopyTaskResult.ErrorOther;
  63. return;
  64. case remove_adf_paper:
  65. this.taskResult = ECopyComponent.ICopyStatusListener.CopyTaskResult.RemoveAdfPaper;
  66. return;
  67. case set_adf_paper:
  68. this.taskResult = ECopyComponent.ICopyStatusListener.CopyTaskResult.ErrorOther;
  69. return;
  70. case document_error:
  71. this.taskResult = ECopyComponent.ICopyStatusListener.CopyTaskResult.ErrorOther;
  72. return;
  73. case x_failed_communication:
  74. this.taskResult = ECopyComponent.ICopyStatusListener.CopyTaskResult.ErrorCommunication;
  75. return;
  76. case unknown_token:
  77. this.taskResult = ECopyComponent.ICopyStatusListener.CopyTaskResult.ErrorOther;
  78. return;
  79. default:
  80. this.taskResult = ECopyComponent.ICopyStatusListener.CopyTaskResult.ErrorOther;
  81. return;
  82. }
  83. }
  84. public Result(ERemoteOperation.ERemoteParam eRemoteParam) {
  85. setResult(eRemoteParam);
  86. }
  87. public Result(ERemoteOperation.ERemoteReasonResult eRemoteReasonResult) {
  88. if (eRemoteReasonResult.isNull(ERemoteOperation.ERemoteParam.success)) {
  89. setResult(ERemoteOperation.ERemoteParam.x_failed_communication);
  90. } else {
  91. setResult(eRemoteReasonResult.reason());
  92. }
  93. }
  94. }
  95. static ECopyComponent.ICopyResumeRequest.StopReason getPrinterStopReason(ArrayList<ERemoteOperation.ERemoteParam> arrayList) {
  96. ECopyComponent.ICopyResumeRequest.StopReason stopReason = ECopyComponent.ICopyResumeRequest.StopReason.None;
  97. stopReason.string = ERemoteOperation.ERemoteParam.none.string;
  98. Iterator<ERemoteOperation.ERemoteParam> it = arrayList.iterator();
  99. while (it.hasNext()) {
  100. ERemoteOperation.ERemoteParam next = it.next();
  101. boolean z = true;
  102. switch (next) {
  103. case marker_supply_empty_error:
  104. stopReason = ECopyComponent.ICopyResumeRequest.StopReason.PrinterMarkerSupplyEmptyError;
  105. break;
  106. case marker_waste_full_error:
  107. stopReason = ECopyComponent.ICopyResumeRequest.StopReason.PrinterMarkerWasteFullError;
  108. break;
  109. case media_jam_error:
  110. stopReason = ECopyComponent.ICopyResumeRequest.StopReason.PrinterMediaJamError;
  111. break;
  112. case media_empty_error:
  113. stopReason = ECopyComponent.ICopyResumeRequest.StopReason.PrinterMediaEmptyError;
  114. break;
  115. case input_tray_missing_error:
  116. stopReason = ECopyComponent.ICopyResumeRequest.StopReason.PrinterOtherError;
  117. break;
  118. case cover_open_error:
  119. stopReason = ECopyComponent.ICopyResumeRequest.StopReason.PrinterCoverOpenError;
  120. break;
  121. case output_area_full_error:
  122. stopReason = ECopyComponent.ICopyResumeRequest.StopReason.PrinterOutputAreaFullError;
  123. break;
  124. case other_error:
  125. stopReason = ECopyComponent.ICopyResumeRequest.StopReason.PrinterOtherError;
  126. break;
  127. default:
  128. z = false;
  129. break;
  130. }
  131. if (z) {
  132. stopReason.string = next.string;
  133. }
  134. }
  135. return stopReason;
  136. }
  137. static ECopyComponent.ICopyResumeRequest.StopReason getScannerStopReason(ArrayList<ERemoteOperation.ERemoteParam> arrayList) {
  138. ECopyComponent.ICopyResumeRequest.StopReason stopReason = ECopyComponent.ICopyResumeRequest.StopReason.None;
  139. stopReason.string = ERemoteOperation.ERemoteParam.none.string;
  140. Iterator<ERemoteOperation.ERemoteParam> it = arrayList.iterator();
  141. while (it.hasNext()) {
  142. ERemoteOperation.ERemoteParam next = it.next();
  143. switch (next) {
  144. case media_jam_error:
  145. stopReason = ECopyComponent.ICopyResumeRequest.StopReason.ScannerOtherError;
  146. break;
  147. case media_empty_error:
  148. stopReason = ECopyComponent.ICopyResumeRequest.StopReason.ScannerOtherError;
  149. break;
  150. case other_error:
  151. stopReason = ECopyComponent.ICopyResumeRequest.StopReason.ScannerOtherError;
  152. break;
  153. case media_size_missmatch_error:
  154. stopReason = ECopyComponent.ICopyResumeRequest.StopReason.ScannerOtherError;
  155. break;
  156. }
  157. stopReason.string = next.string;
  158. }
  159. return stopReason;
  160. }
  161. public RemoteCopyTask(CopyMode copyMode2, String str, ECopyComponent.ICopyStatusListener iCopyStatusListener, Context context) {
  162. this.operation = new ERemoteCopy();
  163. this.progress = new Progress();
  164. this.statusListener = iCopyStatusListener;
  165. this.copyMode = copyMode2;
  166. this.recoverJobToken = str;
  167. this.mContext = context;
  168. }
  169. public RemoteCopyTask(CopyMode copyMode2, ECopyComponent.ICopyStatusListener iCopyStatusListener, Context context) {
  170. this(copyMode2, "", iCopyStatusListener, context);
  171. }
  172. public ECopyComponent.ICopyCancelRequest start() {
  173. super.execute(new Void[0]);
  174. return new ECopyComponent.ICopyCancelRequest() {
  175. public void cancel() {
  176. synchronized (this) {
  177. RemoteCopyTask.this.cancelRequested = true;
  178. }
  179. }
  180. };
  181. }
  182. public void setSystemSettings(ECopyComponent.ICopySystemSettings iCopySystemSettings) {
  183. this.systemSettings = iCopySystemSettings;
  184. }
  185. public void setRequestConnectionTimeout(int i) {
  186. this.operation.setRequestConnectionTimeout(i);
  187. }
  188. public void setClientID(String str) {
  189. this.clientID = str;
  190. }
  191. public void setOptionContext(ECopyOptionContext eCopyOptionContext) {
  192. this.optionContext = eCopyOptionContext;
  193. }
  194. /* access modifiers changed from: protected */
  195. public void onPreExecute() {
  196. this.cancelParameter = new ERemoteCopy.IRemoteCancelParameter() {
  197. public String client_id() {
  198. return RemoteCopyTask.this.clientID;
  199. }
  200. public String job_token() {
  201. return RemoteCopyTask.this.jobToken;
  202. }
  203. };
  204. this.statusParameter = new ERemoteCopy.IRemoteCopyStatusParameter() {
  205. public String client_id() {
  206. return RemoteCopyTask.this.clientID;
  207. }
  208. public String job_token() {
  209. return RemoteCopyTask.this.jobToken;
  210. }
  211. public ArrayList<ERemoteOperation.ERemoteParam> keys() {
  212. ArrayList<ERemoteOperation.ERemoteParam> arrayList = new ArrayList<>();
  213. arrayList.add(ERemoteOperation.ERemoteParam.job_state);
  214. arrayList.add(ERemoteOperation.ERemoteParam.job_result);
  215. arrayList.add(ERemoteOperation.ERemoteParam.job_tokens);
  216. arrayList.add(ERemoteOperation.ERemoteParam.printer_state);
  217. arrayList.add(ERemoteOperation.ERemoteParam.printer_state_reasons);
  218. arrayList.add(ERemoteOperation.ERemoteParam.scanner_state);
  219. arrayList.add(ERemoteOperation.ERemoteParam.scanner_state_reasons);
  220. arrayList.add(ERemoteOperation.ERemoteParam.job_print_total_pages);
  221. arrayList.add(ERemoteOperation.ERemoteParam.job_print_current_pages);
  222. return arrayList;
  223. }
  224. };
  225. this.statusListener.onStarted(ECopyComponent.ICopyStatusListener.CopyTaskType.Copy);
  226. }
  227. /* access modifiers changed from: protected */
  228. public void onProgressUpdate(Progress... progressArr) {
  229. Progress progress2 = progressArr[0];
  230. this.statusListener.onProcessed(ECopyComponent.ICopyStatusListener.CopyTaskType.Copy, progress2.totalPages, progress2.currentPages, progress2.taskProgress, progress2.resumeRequest);
  231. }
  232. private void resumeNotify(ECopyComponent.ICopyResumeRequest.ResumeState resumeState) {
  233. synchronized (this.progress) {
  234. this.progress.resumeState = resumeState;
  235. this.progress.notify();
  236. }
  237. }
  238. private void resumeExecute() {
  239. ERemoteCopy.ERemoteCopyStatusResult status;
  240. if (this.progress.resumeRequest != null) {
  241. synchronized (this.progress) {
  242. while (true) {
  243. try {
  244. if (this.progress.resumeState == null) {
  245. this.progress.wait(1000);
  246. switch (this.operation.getStatus(this.statusParameter).printer_state()) {
  247. case idle:
  248. this.progress.taskProgress = ECopyComponent.ICopyStatusListener.CopyTaskProgress.Processing;
  249. publishProgress(new Progress[]{this.progress});
  250. resumeNotify(ECopyComponent.ICopyResumeRequest.ResumeState.Cancel);
  251. continue;
  252. case processing:
  253. this.progress.taskProgress = ECopyComponent.ICopyStatusListener.CopyTaskProgress.Processing;
  254. publishProgress(new Progress[]{this.progress});
  255. resumeNotify(ECopyComponent.ICopyResumeRequest.ResumeState.ClearError);
  256. continue;
  257. case stopped:
  258. if (this.progress.resumeRequest.getStopReason().equals(getPrinterStopReason(status.printer_state_reasons()))) {
  259. continue;
  260. } else {
  261. return;
  262. }
  263. default:
  264. continue;
  265. }
  266. }
  267. } catch (InterruptedException e) {
  268. e.printStackTrace();
  269. switch (this.progress.resumeState) {
  270. case ClearError:
  271. ERemotePrinter eRemotePrinter = new ERemotePrinter();
  272. eRemotePrinter.setHostIP(this.operation.getHostIP());
  273. eRemotePrinter.setRequestConnectionTimeout(this.operation.getRequestConnectionTimeout());
  274. eRemotePrinter.clearError(new ERemoteOperation.IRemoteOperationParameter() {
  275. public String client_id() {
  276. return RemoteCopyTask.this.clientID;
  277. }
  278. });
  279. for (int i = 0; i < 6 && !this.operation.getStatus(this.statusParameter).printer_state().equals(ERemoteOperation.ERemoteParam.processing); i++) {
  280. try {
  281. Thread.sleep(5000);
  282. } catch (InterruptedException e2) {
  283. e2.printStackTrace();
  284. }
  285. }
  286. break;
  287. case Cancel:
  288. this.cancelRequested = true;
  289. break;
  290. case NextPageReady:
  291. case NextPageNotExist:
  292. boolean success = this.operation.documentChanged(new ERemoteCopy.IRemoteCopyDocumentChangedParameter() {
  293. public String client_id() {
  294. return RemoteCopyTask.this.clientID;
  295. }
  296. public String job_token() {
  297. return RemoteCopyTask.this.jobToken;
  298. }
  299. public boolean next_document() {
  300. return RemoteCopyTask.this.progress.resumeState == ECopyComponent.ICopyResumeRequest.ResumeState.NextPageReady;
  301. }
  302. }).success();
  303. break;
  304. }
  305. Progress progress2 = this.progress;
  306. progress2.resumeState = null;
  307. progress2.resumeRequest = null;
  308. return;
  309. }
  310. }
  311. }
  312. }
  313. }
  314. /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r0v1, resolved type: epson.print.copy.Component.eremoteoperation.ERemoteCopy$ERemoteCopyStatusResult} */
  315. /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r0v5, resolved type: epson.print.copy.Component.eremoteoperation.ERemoteCopy$ERemoteCopyResult} */
  316. /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r0v6, resolved type: epson.print.copy.Component.eremoteoperation.ERemoteCopy$ERemoteCopyStatusResult} */
  317. /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r0v7, resolved type: epson.print.copy.Component.eremoteoperation.ERemoteCopy$ERemoteCopyStatusResult} */
  318. /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r0v8, resolved type: epson.print.copy.Component.eremoteoperation.ERemoteCopy$ERemoteCopyStatusResult} */
  319. /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r0v9, resolved type: epson.print.copy.Component.eremoteoperation.ERemoteCopy$ERemoteCopyStatusResult} */
  320. /* access modifiers changed from: package-private */
  321. /* JADX WARNING: Multi-variable type inference failed */
  322. /* Code decompiled incorrectly, please refer to instructions dump. */
  323. public epson.print.copy.Component.eremoteoperation.ERemoteOperation.ERemoteReasonResult startCopy() {
  324. /*
  325. r4 = this;
  326. epson.print.copy.Component.ecopycomponent.RemoteCopyTask$CopyMode r0 = r4.copyMode
  327. epson.print.copy.Component.ecopycomponent.RemoteCopyTask$CopyMode r1 = epson.print.copy.Component.ecopycomponent.RemoteCopyTask.CopyMode.Copy
  328. if (r0 != r1) goto L_0x0024
  329. epson.print.copy.Component.ecopycomponent.RemoteCopyTask$6 r0 = new epson.print.copy.Component.ecopycomponent.RemoteCopyTask$6
  330. r0.<init>()
  331. epson.print.copy.Component.ecopycomponent.CopyParams r1 = r4.getCopyParams(r0)
  332. r4.mCopyParams = r1
  333. epson.print.copy.Component.eremoteoperation.ERemoteCopy r1 = r4.operation
  334. epson.print.copy.Component.eremoteoperation.ERemoteCopy$ERemoteCopyResult r0 = r1.copy(r0)
  335. boolean r1 = r0.success()
  336. if (r1 == 0) goto L_0x0054
  337. java.lang.String r1 = r0.job_token()
  338. r4.jobToken = r1
  339. goto L_0x0054
  340. L_0x0024:
  341. epson.print.copy.Component.eremoteoperation.ERemoteCopy r0 = r4.operation
  342. epson.print.copy.Component.ecopycomponent.RemoteCopyTask$7 r1 = new epson.print.copy.Component.ecopycomponent.RemoteCopyTask$7
  343. r1.<init>()
  344. epson.print.copy.Component.eremoteoperation.ERemoteCopy$ERemoteCopyStatusResult r0 = r0.getStatus(r1)
  345. boolean r1 = r0.success()
  346. if (r1 == 0) goto L_0x0054
  347. java.util.ArrayList r1 = r0.job_tokens()
  348. java.util.Iterator r1 = r1.iterator()
  349. L_0x003d:
  350. boolean r2 = r1.hasNext()
  351. if (r2 == 0) goto L_0x0054
  352. java.lang.Object r2 = r1.next()
  353. java.lang.String r2 = (java.lang.String) r2
  354. java.lang.String r3 = r4.recoverJobToken
  355. boolean r3 = r2.equals(r3)
  356. if (r3 == 0) goto L_0x003d
  357. r4.jobToken = r2
  358. goto L_0x003d
  359. L_0x0054:
  360. return r0
  361. */
  362. throw new UnsupportedOperationException("Method not decompiled: epson.print.copy.Component.ecopycomponent.RemoteCopyTask.startCopy():epson.print.copy.Component.eremoteoperation.ERemoteOperation$ERemoteReasonResult");
  363. }
  364. private CopyParams getCopyParams(@NonNull ERemoteCopy.IRemoteCopyParameter iRemoteCopyParameter) {
  365. String str;
  366. try {
  367. CopyParams copyParams = new CopyParams();
  368. copyParams.colorMode = iRemoteCopyParameter.color_effects_type().toString();
  369. copyParams.density = Integer.toString(iRemoteCopyParameter.x_density());
  370. int copy_magnification = iRemoteCopyParameter.copy_magnification();
  371. if (copy_magnification == 0) {
  372. str = "-999";
  373. } else {
  374. str = Integer.toString(copy_magnification);
  375. }
  376. copyParams.magnification = str;
  377. copyParams.paperSize = iRemoteCopyParameter.print_media_size().toString();
  378. copyParams.paperType = iRemoteCopyParameter.print_media_type().toString();
  379. copyParams.printDevice = iRemoteCopyParameter.print_media_source().toString();
  380. copyParams.copyType = iRemoteCopyParameter.scan_content_type().toString();
  381. copyParams.copyQuality = iRemoteCopyParameter.print_quality().toString();
  382. return copyParams;
  383. } catch (Throwable unused) {
  384. return null;
  385. }
  386. }
  387. /* access modifiers changed from: protected */
  388. public Result doInBackground(Void... voidArr) {
  389. this.operation.setHostIP(this.systemSettings.getPrinterIPAddress());
  390. ERemoteOperation.ERemoteReasonResult startCopy = startCopy();
  391. if (!startCopy.success()) {
  392. return new Result(startCopy);
  393. }
  394. Result result = null;
  395. boolean z = false;
  396. boolean z2 = false;
  397. while (!z) {
  398. if (this.cancelRequested && !z2) {
  399. if (!this.operation.cancel(this.cancelParameter).success()) {
  400. return new Result(ERemoteOperation.ERemoteParam.canceled);
  401. }
  402. z2 = true;
  403. }
  404. final ERemoteCopy.ERemoteCopyStatusResult status = this.operation.getStatus(this.statusParameter);
  405. if (!status.success()) {
  406. sendLog(this.progress.currentPages);
  407. return new Result((ERemoteOperation.ERemoteReasonResult) status);
  408. }
  409. Result result2 = new Result(status.job_result());
  410. this.progress.totalPages = status.job_print_total_pages();
  411. this.progress.currentPages = status.job_print_current_pages();
  412. if (this.progress.currentPages < 1) {
  413. this.progress.currentPages = 1;
  414. }
  415. ERemoteOperation.ERemoteParam job_state = status.job_state();
  416. switch (job_state) {
  417. case scanning:
  418. this.progress.taskProgress = ECopyComponent.ICopyStatusListener.CopyTaskProgress.Scanning;
  419. break;
  420. case copying:
  421. this.progress.taskProgress = ECopyComponent.ICopyStatusListener.CopyTaskProgress.Copying;
  422. break;
  423. case canceling:
  424. this.progress.taskProgress = ECopyComponent.ICopyStatusListener.CopyTaskProgress.Canceling;
  425. break;
  426. case nextpaper:
  427. Progress progress2 = this.progress;
  428. progress2.resumeState = null;
  429. progress2.taskProgress = ECopyComponent.ICopyStatusListener.CopyTaskProgress.Waiting2ndPage;
  430. this.progress.resumeRequest = new ECopyComponent.ICopyInvalidateResumeRequest() {
  431. public void invalidate() {
  432. }
  433. public boolean isPossibleClearError() {
  434. return false;
  435. }
  436. public ECopyComponent.ICopyResumeRequest.StopReason getStopReason() {
  437. return ECopyComponent.ICopyResumeRequest.StopReason.ChangePage;
  438. }
  439. public void resume(ECopyComponent.ICopyResumeRequest.ResumeState resumeState) {
  440. RemoteCopyTask.this.resumeNotify(resumeState);
  441. }
  442. };
  443. break;
  444. case finished:
  445. sendLog(this.progress.currentPages);
  446. result = result2;
  447. z = true;
  448. continue;
  449. }
  450. switch (status.printer_state()) {
  451. case stopped:
  452. if (job_state == ERemoteOperation.ERemoteParam.copying || job_state == ERemoteOperation.ERemoteParam.scanning) {
  453. Progress progress3 = this.progress;
  454. progress3.resumeState = null;
  455. progress3.taskProgress = ECopyComponent.ICopyStatusListener.CopyTaskProgress.Stopped;
  456. this.progress.resumeRequest = new ECopyComponent.ICopyInvalidateResumeRequest() {
  457. public void invalidate() {
  458. }
  459. public ECopyComponent.ICopyResumeRequest.StopReason getStopReason() {
  460. ECopyComponent.ICopyResumeRequest.StopReason printerStopReason = RemoteCopyTask.getPrinterStopReason(status.printer_state_reasons());
  461. return printerStopReason == ECopyComponent.ICopyResumeRequest.StopReason.None ? RemoteCopyTask.getScannerStopReason(status.scanner_state_reasons()) : printerStopReason;
  462. }
  463. public boolean isPossibleClearError() {
  464. switch (RemoteCopyTask.getPrinterStopReason(status.printer_state_reasons())) {
  465. case PrinterMarkerSupplyEmptyError:
  466. return false;
  467. case PrinterMarkerWasteFullError:
  468. return false;
  469. case PrinterMediaJamError:
  470. return true;
  471. case PrinterMediaEmptyError:
  472. return true;
  473. case PrinterInputTrayMissingError:
  474. return true;
  475. case PrinterCoverOpenError:
  476. return false;
  477. case PrinterOutputAreaFullError:
  478. return true;
  479. case PrinterOtherError:
  480. return false;
  481. default:
  482. switch (RemoteCopyTask.getScannerStopReason(status.scanner_state_reasons())) {
  483. case ScannerMediaEmptyError:
  484. return true;
  485. case ScannerMediaJamError:
  486. return true;
  487. case ScannerMediaSizeMissmatchError:
  488. return true;
  489. case ScannerOtherError:
  490. return true;
  491. default:
  492. return false;
  493. }
  494. }
  495. }
  496. public void resume(ECopyComponent.ICopyResumeRequest.ResumeState resumeState) {
  497. RemoteCopyTask.this.progress.taskProgress = ECopyComponent.ICopyStatusListener.CopyTaskProgress.Processing;
  498. RemoteCopyTask remoteCopyTask = RemoteCopyTask.this;
  499. remoteCopyTask.publishProgress(new Progress[]{remoteCopyTask.progress});
  500. RemoteCopyTask.this.resumeNotify(resumeState);
  501. }
  502. };
  503. break;
  504. }
  505. }
  506. publishProgress(new Progress[]{this.progress});
  507. resumeExecute();
  508. try {
  509. Thread.sleep((long) 1000);
  510. } catch (InterruptedException e) {
  511. e.printStackTrace();
  512. }
  513. result = result2;
  514. }
  515. return result;
  516. }
  517. private void sendLog(int i) {
  518. CopyParams copyParams = this.mCopyParams;
  519. Context context = this.mContext;
  520. if (context != null && copyParams != null) {
  521. CommonLog commonLog = new CommonLog();
  522. commonLog.setConnectionType(context);
  523. commonLog.setPrinterName(context);
  524. commonLog.action = PrintLog.ACTION_COPY;
  525. commonLog.numberOfSheet = i;
  526. Analytics.sendCopyLog(context, copyParams, commonLog);
  527. }
  528. }
  529. /* access modifiers changed from: protected */
  530. public void onPostExecute(Result result) {
  531. this.statusListener.onFinished(ECopyComponent.ICopyStatusListener.CopyTaskType.Copy, result.taskResult);
  532. }
  533. }