RemoteCopyTask.java 28 KB

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