|
@@ -0,0 +1,2010 @@
|
|
|
+package epson.scan.activity;
|
|
|
+
|
|
|
+import android.annotation.SuppressLint;
|
|
|
+import android.app.Activity;
|
|
|
+import android.app.AlertDialog;
|
|
|
+import android.content.Context;
|
|
|
+import android.content.DialogInterface;
|
|
|
+import android.content.Intent;
|
|
|
+import android.content.IntentFilter;
|
|
|
+import android.content.SharedPreferences;
|
|
|
+import android.content.res.Configuration;
|
|
|
+import android.graphics.Bitmap;
|
|
|
+import android.graphics.Point;
|
|
|
+import android.graphics.RectF;
|
|
|
+import android.os.AsyncTask;
|
|
|
+import android.os.Build;
|
|
|
+import android.os.Bundle;
|
|
|
+import android.os.Handler;
|
|
|
+import android.os.StatFs;
|
|
|
+import android.support.annotation.Nullable;
|
|
|
+import android.view.Display;
|
|
|
+import android.view.GestureDetector;
|
|
|
+import android.view.KeyEvent;
|
|
|
+import android.view.Menu;
|
|
|
+import android.view.MenuItem;
|
|
|
+import android.view.MotionEvent;
|
|
|
+import android.view.View;
|
|
|
+import android.view.ViewTreeObserver;
|
|
|
+import android.widget.Button;
|
|
|
+import android.widget.FrameLayout;
|
|
|
+import android.widget.LinearLayout;
|
|
|
+import android.widget.TextView;
|
|
|
+import com.epson.iprint.prtlogger.Analytics;
|
|
|
+import com.epson.iprint.prtlogger.CommonLog;
|
|
|
+import com.epson.iprint.prtlogger.PrintLog;
|
|
|
+import com.epson.iprint.shared.EpsoniPrintSharedActivity;
|
|
|
+import com.epson.iprint.shared.SharedParamScan;
|
|
|
+import com.epson.mobilephone.common.PrintingLib.define.Constants;
|
|
|
+import com.epson.mobilephone.common.wifidirect.NfcTagUtils;
|
|
|
+import com.epson.mobilephone.common.wifidirect.WiFiDirectManager;
|
|
|
+import epson.common.Constants;
|
|
|
+import epson.common.ExternalFileUtils;
|
|
|
+import epson.common.Utils;
|
|
|
+import epson.print.ActivityNfcPrinter;
|
|
|
+import epson.print.ActivityPrintWeb;
|
|
|
+import epson.print.ActivityRequestPermissions;
|
|
|
+import epson.print.C2135R;
|
|
|
+import epson.print.CommonDefine;
|
|
|
+import epson.print.Util.EPLog;
|
|
|
+import epson.print.Util.Photo;
|
|
|
+import epson.scan.activity.ScanBaseView;
|
|
|
+import epson.scan.activity.ScanContinueParam;
|
|
|
+import epson.scan.lib.I1ScanParams;
|
|
|
+import epson.scan.lib.ScanInfoStorage;
|
|
|
+import epson.scan.lib.ScanSizeHelper;
|
|
|
+import epson.scan.lib.ScannerInfo;
|
|
|
+import epson.scan.lib.escanLib;
|
|
|
+import epson.server.screens.StorageServer;
|
|
|
+import epson.server.utils.Define;
|
|
|
+import java.io.File;
|
|
|
+import java.io.FileNotFoundException;
|
|
|
+import java.io.IOException;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Calendar;
|
|
|
+import org.opencv.videoio.Videoio;
|
|
|
+
|
|
|
+public class ScanActivity extends ScanBaseView implements ScanContinueParam.ScanContinueDialogButtonClick {
|
|
|
+ private static final int MESSAGE_CHECK_STATUS_AND_START_SCAN = 20;
|
|
|
+ public static final String PARAM_KEY_SCAN_LOG = "scan-log";
|
|
|
+ private static final int REQEST_RUNTIMEPERMMISSION = 4;
|
|
|
+ private static final int REQUEST_CODE_ESC_I_VERSION_CHANGE = 20;
|
|
|
+ static final String RETURN_KEY_SCAN_FILE = "scan-file";
|
|
|
+ private static final int SCAN_CANCELED = -2;
|
|
|
+ private static final int SCAN_DISMISS = -3;
|
|
|
+ public static final int SCAN_ENDPAGE_CB = 11;
|
|
|
+ private static final int SCAN_ERROR = -1;
|
|
|
+ private static final int SCAN_FINISHED = 2;
|
|
|
+ public static final int SCAN_RECV_IMGBLOCK_CB = 10;
|
|
|
+ private static final int SCAN_REDRAWBITMAP = -100;
|
|
|
+ private static final int START_SCAN = 0;
|
|
|
+ private static final String TAG = "ScanActivity";
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public RectF area;
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public int areaHeightOnScreen = 0;
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public int areaWidthOnScreen = 0;
|
|
|
+ private boolean bAutoStartScan = false;
|
|
|
+ private Button btnCancelScan;
|
|
|
+ private Button btnMail;
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public Button btnNext;
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public Button btnPrev;
|
|
|
+ private Button btnPrint;
|
|
|
+ private Button btnSave;
|
|
|
+ private Button btnScan;
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public AlertDialog confirmAlertDialog;
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public int convertCount = 0;
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public Thread doscan;
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public int error = 0;
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public AlertDialog errorDialog;
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public escanLib escan;
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public SharedParamScan extParam;
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public FrameLayout flScanResult;
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public GestureDetector gestureDetector;
|
|
|
+ private View.OnTouchListener gestureListener;
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public boolean isConfirmCancel = false;
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public boolean isCustomAction = false;
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public boolean isDecoding = false;
|
|
|
+ private boolean isNeedClearBm = false;
|
|
|
+ private boolean isNeedDeleteTempFile = true;
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public boolean isNeedGetScanSize = true;
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public boolean isNeedRedrawBitmap = false;
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public boolean isNeedScale = false;
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public boolean isNeedUpdateScanningArea = false;
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public boolean isStopScan = false;
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public LinearLayout llScanArea;
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public LinearLayout llScanAreaBackground;
|
|
|
+ private LinearLayout llScanningProgress;
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public boolean mActivityPaused;
|
|
|
+ private View.OnClickListener mButtonCancelScanListener = new View.OnClickListener() {
|
|
|
+ public void onClick(View view) {
|
|
|
+ String localClassName = ScanActivity.this.getLocalClassName();
|
|
|
+ EPLog.m313i(localClassName, "isStopScan = " + ScanActivity.this.isStopScan);
|
|
|
+ if (!ScanActivity.this.escan.isJobDone() && !ScanActivity.this.isStopScan) {
|
|
|
+ ScanActivity.this.hideScanningPop();
|
|
|
+ ScanActivity scanActivity = ScanActivity.this;
|
|
|
+ scanActivity.confirmationDialog(scanActivity.getString(C2135R.string.str_msg_scan_cancel));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ private View.OnClickListener mButtonMailListener = new View.OnClickListener() {
|
|
|
+ public void onClick(View view) {
|
|
|
+ if (ScanActivity.this.totalScanned > 0 && ScanActivity.this.isCompletedScanProcess()) {
|
|
|
+ Intent intent = new Intent(ScanActivity.this, MailActivity.class);
|
|
|
+ intent.putStringArrayListExtra(Define.SAVING_FILE_PATH, ScanActivity.this.getListSavedJPGFilePath());
|
|
|
+ ScanActivity.this.startActivityForResult(intent, 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ private View.OnClickListener mButtonNextListener = new View.OnClickListener() {
|
|
|
+ public void onClick(View view) {
|
|
|
+ if (ScanActivity.this.isCompletedScanProcess()) {
|
|
|
+ ScanActivity.this.curentViewingFile++;
|
|
|
+ if (ScanActivity.this.curentViewingFile > 300 || ScanActivity.this.curentViewingFile > ScanActivity.this.totalScanned) {
|
|
|
+ ScanActivity scanActivity = ScanActivity.this;
|
|
|
+ scanActivity.curentViewingFile--;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ ScanActivity scanActivity2 = ScanActivity.this;
|
|
|
+ scanActivity2.updateThumbResult(scanActivity2.curentViewingFile);
|
|
|
+ ScanActivity.this.showDisplayingResult();
|
|
|
+ ScanActivity.this.scanArea.postInvalidate();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ private View.OnClickListener mButtonPrevListener = new View.OnClickListener() {
|
|
|
+ public void onClick(View view) {
|
|
|
+ if (ScanActivity.this.isCompletedScanProcess()) {
|
|
|
+ ScanActivity.this.curentViewingFile--;
|
|
|
+ if (ScanActivity.this.curentViewingFile < 1) {
|
|
|
+ ScanActivity.this.curentViewingFile++;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ ScanActivity scanActivity = ScanActivity.this;
|
|
|
+ scanActivity.updateThumbResult(scanActivity.curentViewingFile);
|
|
|
+ ScanActivity.this.showDisplayingResult();
|
|
|
+ ScanActivity.this.scanArea.postInvalidate();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ private View.OnClickListener mButtonPrintListener = new View.OnClickListener() {
|
|
|
+ public void onClick(View view) {
|
|
|
+ if (ScanActivity.this.totalScanned > 0) {
|
|
|
+ Intent intent = new Intent(ScanActivity.this, ActivityPrintWeb.class);
|
|
|
+ intent.putExtra("from", 1);
|
|
|
+ intent.putStringArrayListExtra("print_web", ScanActivity.this.getListSavedJPGFilePath());
|
|
|
+ intent.putExtra("print_log", ScanActivity.getPrintLog());
|
|
|
+ ScanActivity.this.startActivityForResult(intent, 3);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ private View.OnClickListener mButtonSaveListener = new View.OnClickListener() {
|
|
|
+ public void onClick(View view) {
|
|
|
+ if (ScanActivity.this.totalScanned > 0 && ScanActivity.this.isCompletedScanProcess()) {
|
|
|
+ if (ScanActivity.this.isCustomAction) {
|
|
|
+ Intent intent = new Intent();
|
|
|
+ if (ScanActivity.this.extParam != null) {
|
|
|
+ intent.putExtra(ScanActivity.RETURN_KEY_SCAN_FILE, ScanActivity.this.extParam.getArrayOutFilePath());
|
|
|
+ ScanActivity.this.setResult(-1, intent);
|
|
|
+ ScanActivity.this.finish();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ Intent intent2 = new Intent(ScanActivity.this, StorageServer.class);
|
|
|
+ intent2.putExtra(Define.PICK_SERVER_FOR, 2);
|
|
|
+ intent2.putStringArrayListExtra(Define.SAVING_FILE_PATH, ScanActivity.this.getListSavedJPGFilePath());
|
|
|
+ intent2.putExtra(StorageServer.FOR_PRINT_LOGGER_CALL_FROM, 1);
|
|
|
+ ScanActivity.this.startActivityForResult(intent2, 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ private View.OnClickListener mButtonScanListener = new View.OnClickListener() {
|
|
|
+ public void onClick(View view) {
|
|
|
+ ScanActivity.this.check3GAndStartPrint();
|
|
|
+ }
|
|
|
+ };
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public I1ScanParams mI1ScanParams;
|
|
|
+ private ViewTreeObserver.OnPreDrawListener mOnPreDrawListener = new ViewTreeObserver.OnPreDrawListener() {
|
|
|
+ public boolean onPreDraw() {
|
|
|
+ int i;
|
|
|
+ RectF bmRectF;
|
|
|
+ if (!ScanActivity.this.mActivityPaused && ScanActivity.this.mScanAreaBackgroundViewSizeChanged) {
|
|
|
+ boolean unused = ScanActivity.this.mScanAreaBackgroundViewSizeChanged = false;
|
|
|
+ boolean unused2 = ScanActivity.this.isNeedGetScanSize = true;
|
|
|
+ boolean unused3 = ScanActivity.this.isNeedScale = true;
|
|
|
+ ScanActivity.this.llScanArea.invalidate();
|
|
|
+ ScanActivity.this.llScanAreaBackground.invalidate();
|
|
|
+ ScanActivity.this.scanArea.invalidate();
|
|
|
+ ScanActivity.this.scanAreaBackground.invalidate();
|
|
|
+ ScanActivity.this.flScanResult.invalidate();
|
|
|
+ }
|
|
|
+ if (ScanActivity.this.isNeedGetScanSize) {
|
|
|
+ if (ScanActivity.this.isDoctable) {
|
|
|
+ ScanActivity scanActivity = ScanActivity.this;
|
|
|
+ scanActivity.setMaxwidth(Utils.getPrefInt(scanActivity.getContext(), Constants.SCAN_REFS_SUPPORTED_OPTIONS, Constants.SCAN_REFS_MAX_WIDTH));
|
|
|
+ ScanActivity scanActivity2 = ScanActivity.this;
|
|
|
+ scanActivity2.setMaxheight(Utils.getPrefInt(scanActivity2.getContext(), Constants.SCAN_REFS_SUPPORTED_OPTIONS, Constants.SCAN_REFS_MAX_HEIGHT));
|
|
|
+ }
|
|
|
+ if (ScanActivity.this.getMaxwidth() == 0) {
|
|
|
+ ScanActivity.this.setMaxwidth(Constants.SCAN_MAX_WIDTH);
|
|
|
+ }
|
|
|
+ if (ScanActivity.this.getMaxheight() == 0) {
|
|
|
+ ScanActivity.this.setMaxheight(Constants.SCAN_MAX_HEIGHT);
|
|
|
+ }
|
|
|
+ int prefInt = !"".equals(Utils.getPrefString(ScanActivity.this.getContext(), Constants.SCAN_REFS_USED_SCANNER_PATH, Constants.SCAN_REFS_SCANNER_MODEL)) ? Utils.getPrefInt(ScanActivity.this.getContext(), Constants.SCAN_REFS_USED_SCANNER_PATH, Constants.SCAN_REFS_SETTINGS_RESOLUTION) : 150;
|
|
|
+ if (prefInt == ScanActivity.this.resolution && !ScanActivity.this.isDoctable) {
|
|
|
+ boolean unused4 = ScanActivity.this.isNeedUpdateScanningArea = true;
|
|
|
+ }
|
|
|
+ int unused5 = ScanActivity.this.resolution = prefInt;
|
|
|
+ ScanActivity scanActivity3 = ScanActivity.this;
|
|
|
+ int unused6 = scanActivity3.areaHeightOnScreen = scanActivity3.llScanAreaBackground.getHeight();
|
|
|
+ ScanActivity scanActivity4 = ScanActivity.this;
|
|
|
+ int unused7 = scanActivity4.areaWidthOnScreen = scanActivity4.llScanAreaBackground.getWidth();
|
|
|
+ }
|
|
|
+ ScanActivity.this.initFrameWithScreensize();
|
|
|
+ Point point = ScanActivity.this.getmBaseTop();
|
|
|
+ Point point2 = ScanActivity.this.getmBaseBot();
|
|
|
+ int i2 = point2.x - point.x;
|
|
|
+ int i3 = point2.y - point.y;
|
|
|
+ ScanActivity scanActivity5 = ScanActivity.this;
|
|
|
+ scanActivity5.setmBaseTop(new Point(((int) (((double) scanActivity5.areaWidthOnScreen) - ScanActivity.this.getMaxScanWidthOnScreen())) / 2, ScanActivity.this.MARGIN_TOP_BOT));
|
|
|
+ ScanActivity scanActivity6 = ScanActivity.this;
|
|
|
+ scanActivity6.setmBaseBot(new Point(scanActivity6.areaWidthOnScreen - ScanActivity.this.getmBaseTop().x, ScanActivity.this.areaHeightOnScreen - ScanActivity.this.MARGIN_TOP_BOT));
|
|
|
+ if (!ScanActivity.this.isDoctable && !ScanActivity.this.isNeedGetScanSize) {
|
|
|
+ ScanActivity scanActivity7 = ScanActivity.this;
|
|
|
+ scanActivity7.setPiBaseTop(new ScanBaseView.PointInfo((double) scanActivity7.getmBaseTop().x, (double) ScanActivity.this.getmBaseTop().y));
|
|
|
+ ScanActivity scanActivity8 = ScanActivity.this;
|
|
|
+ scanActivity8.setPiBaseBot(new ScanBaseView.PointInfo((double) scanActivity8.getmBaseBot().x, (double) ScanActivity.this.getmBaseBot().y));
|
|
|
+ ScanActivity scanActivity9 = ScanActivity.this;
|
|
|
+ scanActivity9.setmTop(scanActivity9.getmBaseTop());
|
|
|
+ ScanActivity scanActivity10 = ScanActivity.this;
|
|
|
+ scanActivity10.setmBot(scanActivity10.getmBaseBot());
|
|
|
+ }
|
|
|
+ if (ScanActivity.this.isNeedGetScanSize) {
|
|
|
+ if (ScanActivity.this.isNeedUpdateScanningArea) {
|
|
|
+ ScanActivity scanActivity11 = ScanActivity.this;
|
|
|
+ scanActivity11.setPiBaseTop(new ScanBaseView.PointInfo((double) scanActivity11.getmBaseTop().x, (double) ScanActivity.this.getmBaseTop().y));
|
|
|
+ ScanActivity scanActivity12 = ScanActivity.this;
|
|
|
+ scanActivity12.setPiBaseBot(new ScanBaseView.PointInfo((double) scanActivity12.getmBaseBot().x, (double) ScanActivity.this.getmBaseBot().y));
|
|
|
+ ScanActivity scanActivity13 = ScanActivity.this;
|
|
|
+ scanActivity13.setmTop(scanActivity13.getmBaseTop());
|
|
|
+ ScanActivity scanActivity14 = ScanActivity.this;
|
|
|
+ scanActivity14.setmBot(scanActivity14.getmBaseBot());
|
|
|
+ ScanActivity.this.setScreenStatus(1);
|
|
|
+ }
|
|
|
+ if (ScanActivity.this.isNeedScale) {
|
|
|
+ boolean unused8 = ScanActivity.this.isNeedScale = false;
|
|
|
+ Point point3 = new Point();
|
|
|
+ float f = (float) i2;
|
|
|
+ point2.x = (int) (((float) ScanActivity.this.getmBaseTop().x) + (((float) ((ScanActivity.this.getmBaseBot().x - ScanActivity.this.getmBaseTop().x) * (ScanActivity.this.getmTop().x - point.x))) / f));
|
|
|
+ float f2 = (float) i3;
|
|
|
+ point2.y = (int) (((float) ScanActivity.this.getmBaseTop().y) + (((float) ((ScanActivity.this.getmBaseBot().y - ScanActivity.this.getmBaseTop().y) * (ScanActivity.this.getmTop().y - point.y))) / f2));
|
|
|
+ point3.x = (int) (((float) ScanActivity.this.getmBaseTop().x) + (((float) ((ScanActivity.this.getmBaseBot().x - ScanActivity.this.getmBaseTop().x) * (ScanActivity.this.getmBot().x - point.x))) / f));
|
|
|
+ point3.y = (int) (((float) ScanActivity.this.getmBaseTop().y) + (((float) ((ScanActivity.this.getmBaseBot().y - ScanActivity.this.getmBaseTop().y) * (ScanActivity.this.getmBot().y - point.y))) / f2));
|
|
|
+ ScanActivity scanActivity15 = ScanActivity.this;
|
|
|
+ scanActivity15.setPiBaseTop(new ScanBaseView.PointInfo((double) point2.x, (double) point2.y));
|
|
|
+ ScanActivity scanActivity16 = ScanActivity.this;
|
|
|
+ scanActivity16.setPiBaseBot(new ScanBaseView.PointInfo((double) point3.x, (double) point3.y));
|
|
|
+ ScanActivity.this.setmTop(point2);
|
|
|
+ ScanActivity.this.setmBot(point3);
|
|
|
+ if (!ScanActivity.this.isNeedRedrawBitmap && (bmRectF = ScanActivity.this.getBmRectF()) != null) {
|
|
|
+ bmRectF.left = ((float) ScanActivity.this.getmBaseTop().x) + ((((float) (ScanActivity.this.getmBaseBot().x - ScanActivity.this.getmBaseTop().x)) * (bmRectF.left - ((float) point.x))) / f);
|
|
|
+ bmRectF.top = ((float) ScanActivity.this.getmBaseTop().y) + ((((float) (ScanActivity.this.getmBaseBot().y - ScanActivity.this.getmBaseTop().y)) * (bmRectF.top - ((float) point.y))) / f2);
|
|
|
+ bmRectF.right = ((float) ScanActivity.this.getmBaseTop().x) + ((((float) (ScanActivity.this.getmBaseBot().x - ScanActivity.this.getmBaseTop().x)) * (bmRectF.right - ((float) point.x))) / f);
|
|
|
+ bmRectF.bottom = ((float) ScanActivity.this.getmBaseTop().y) + ((((float) (ScanActivity.this.getmBaseBot().y - ScanActivity.this.getmBaseTop().y)) * (bmRectF.bottom - ((float) point.y))) / f2);
|
|
|
+ ScanActivity.this.setBmRectF(bmRectF);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ScanActivity scanActivity17 = ScanActivity.this;
|
|
|
+ scanActivity17.setmCenter(scanActivity17.calculateTheCenterPoint(scanActivity17.getmTop(), ScanActivity.this.getmBot()));
|
|
|
+ ScanActivity scanActivity18 = ScanActivity.this;
|
|
|
+ scanActivity18.setInSampleSize(Math.round((float) (100 / ((scanActivity18.areaHeightOnScreen * 100) / 650))));
|
|
|
+ ScanActivity.this.get_bmOption().inSampleSize = ScanActivity.this.getInSampleSize();
|
|
|
+ ScanActivity.this.setupScanArea();
|
|
|
+ boolean unused9 = ScanActivity.this.isNeedGetScanSize = false;
|
|
|
+ ScanActivity.this.setSetSize(true);
|
|
|
+ SharedPreferences sharedPreferences = ScanActivity.this.context.getSharedPreferences(Constants.SCAN_REFS_USED_SCANNER_PATH, 0);
|
|
|
+ if (ScanActivity.this.isDoctable) {
|
|
|
+ i = sharedPreferences.getInt(Constants.SCAN_REFS_SCANNER_CHOSEN_SIZE_DOC, Constants.PaperName.EPS_MSID_UNKNOWN.getCode());
|
|
|
+ } else {
|
|
|
+ i = sharedPreferences.getInt(epson.common.Constants.SCAN_REFS_SCANNER_CHOSEN_SIZE_ADF, Constants.PaperName.EPS_MSID_UNKNOWN.getCode());
|
|
|
+ }
|
|
|
+ if (ScanActivity.this.isNeedUpdateScanningArea) {
|
|
|
+ if (i == Constants.PaperName.EPS_MSID_UNKNOWN.getCode()) {
|
|
|
+ ScanActivity.this.chooseScanSize(ScanSizeHelper.getDefaultScanSize());
|
|
|
+ } else {
|
|
|
+ ScanActivity.this.chooseScanSize(i);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ScanActivity.this.scanArea.redrawCBHandler = ScanActivity.this.scanningProgressHandler;
|
|
|
+ boolean unused10 = ScanActivity.this.isNeedUpdateScanningArea = false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ };
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public boolean mScanAreaBackgroundViewSizeChanged;
|
|
|
+ private CommonLog mScanLog;
|
|
|
+ private String oldScannerId;
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public int previousTotalScanned = 0;
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public int resolution = 0;
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public ScanBaseView.ScanAreaSet scanArea;
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public ScanBaseView.ScanAreaBackground scanAreaBackground;
|
|
|
+ private int scanOrigin = 2;
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public Handler scanningProgressHandler = new Handler(new Handler.Callback() {
|
|
|
+ /* JADX WARNING: Can't fix incorrect switch cases order */
|
|
|
+ /* Code decompiled incorrectly, please refer to instructions dump. */
|
|
|
+ public boolean handleMessage(android.os.Message r9) {
|
|
|
+ /*
|
|
|
+ r8 = this;
|
|
|
+ epson.scan.activity.ScanActivity r0 = epson.scan.activity.ScanActivity.this
|
|
|
+ boolean r0 = r0.isFinishing()
|
|
|
+ r1 = -3
|
|
|
+ r2 = -100
|
|
|
+ r3 = 20
|
|
|
+ r4 = 2
|
|
|
+ r5 = 1
|
|
|
+ if (r0 == 0) goto L_0x0021
|
|
|
+ int r0 = r9.what
|
|
|
+ if (r0 == r2) goto L_0x0020
|
|
|
+ if (r0 == r1) goto L_0x0020
|
|
|
+ if (r0 == r4) goto L_0x0020
|
|
|
+ if (r0 == r3) goto L_0x0020
|
|
|
+ switch(r0) {
|
|
|
+ case -1: goto L_0x0020;
|
|
|
+ case 0: goto L_0x0020;
|
|
|
+ default: goto L_0x001c;
|
|
|
+ }
|
|
|
+ L_0x001c:
|
|
|
+ switch(r0) {
|
|
|
+ case 10: goto L_0x0020;
|
|
|
+ case 11: goto L_0x0020;
|
|
|
+ default: goto L_0x001f;
|
|
|
+ }
|
|
|
+ L_0x001f:
|
|
|
+ goto L_0x0021
|
|
|
+ L_0x0020:
|
|
|
+ return r5
|
|
|
+ L_0x0021:
|
|
|
+ int r9 = r9.what
|
|
|
+ r0 = 0
|
|
|
+ if (r9 == r2) goto L_0x044e
|
|
|
+ r2 = -1
|
|
|
+ if (r9 == r4) goto L_0x03b2
|
|
|
+ if (r9 == r3) goto L_0x0382
|
|
|
+ r6 = 1000(0x3e8, double:4.94E-321)
|
|
|
+ switch(r9) {
|
|
|
+ case -3: goto L_0x037b;
|
|
|
+ case -2: goto L_0x02a0;
|
|
|
+ case -1: goto L_0x01a1;
|
|
|
+ case 0: goto L_0x00ea;
|
|
|
+ default: goto L_0x0030;
|
|
|
+ }
|
|
|
+ L_0x0030:
|
|
|
+ switch(r9) {
|
|
|
+ case 10: goto L_0x0093;
|
|
|
+ case 11: goto L_0x0035;
|
|
|
+ default: goto L_0x0033;
|
|
|
+ }
|
|
|
+ L_0x0033:
|
|
|
+ goto L_0x047f
|
|
|
+ L_0x0035:
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ epson.scan.lib.escanLib r1 = r9.escan
|
|
|
+ java.util.List r1 = r1.getListScannedFile()
|
|
|
+ int r1 = r1.size()
|
|
|
+ r9.totalScanned = r1
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ int r9 = r9.totalScanned
|
|
|
+ if (r9 >= r5) goto L_0x004c
|
|
|
+ return r0
|
|
|
+ L_0x004c:
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ java.lang.String r9 = r9.getLocalClassName()
|
|
|
+ java.lang.String r1 = "end page, waiting..."
|
|
|
+ epson.print.Util.EPLog.m313i(r9, r1)
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ int r9 = r9.convertCount
|
|
|
+ epson.scan.activity.ScanActivity r1 = epson.scan.activity.ScanActivity.this
|
|
|
+ epson.scan.lib.escanLib r1 = r1.escan
|
|
|
+ java.util.List r1 = r1.getListScannedFile()
|
|
|
+ int r1 = r1.size()
|
|
|
+ if (r9 >= r1) goto L_0x0086
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ epson.scan.lib.escanLib r1 = r9.escan
|
|
|
+ java.util.List r1 = r1.getListScannedFile()
|
|
|
+ epson.scan.activity.ScanActivity r2 = epson.scan.activity.ScanActivity.this
|
|
|
+ int r2 = r2.convertCount
|
|
|
+ java.lang.Object r1 = r1.get(r2)
|
|
|
+ java.lang.String r1 = (java.lang.String) r1
|
|
|
+ r9.convert(r1)
|
|
|
+ L_0x0086:
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ java.lang.String r9 = r9.getLocalClassName()
|
|
|
+ java.lang.String r1 = "done add to list"
|
|
|
+ epson.print.Util.EPLog.m313i(r9, r1)
|
|
|
+ goto L_0x047f
|
|
|
+ L_0x0093:
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ epson.scan.lib.escanLib r1 = r9.escan
|
|
|
+ java.util.List r1 = r1.getListScannedFile()
|
|
|
+ int r1 = r1.size()
|
|
|
+ r9.totalScanned = r1
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ int r9 = r9.totalScanned
|
|
|
+ if (r9 >= r5) goto L_0x00aa
|
|
|
+ return r0
|
|
|
+ L_0x00aa:
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ epson.scan.lib.escanLib r9 = r9.escan
|
|
|
+ boolean r9 = r9.isJobDone()
|
|
|
+ if (r9 == 0) goto L_0x00b7
|
|
|
+ return r5
|
|
|
+ L_0x00b7:
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this // Catch:{ RejectedExecutionException -> 0x00e4 }
|
|
|
+ boolean r9 = r9.isDecoding // Catch:{ RejectedExecutionException -> 0x00e4 }
|
|
|
+ if (r9 != 0) goto L_0x047f
|
|
|
+ epson.scan.activity.ScanActivity$BitmapTask r9 = new epson.scan.activity.ScanActivity$BitmapTask // Catch:{ RejectedExecutionException -> 0x00e4 }
|
|
|
+ epson.scan.activity.ScanActivity r1 = epson.scan.activity.ScanActivity.this // Catch:{ RejectedExecutionException -> 0x00e4 }
|
|
|
+ r9.<init>() // Catch:{ RejectedExecutionException -> 0x00e4 }
|
|
|
+ java.lang.String[] r1 = new java.lang.String[r5] // Catch:{ RejectedExecutionException -> 0x00e4 }
|
|
|
+ epson.scan.activity.ScanActivity r2 = epson.scan.activity.ScanActivity.this // Catch:{ RejectedExecutionException -> 0x00e4 }
|
|
|
+ epson.scan.lib.escanLib r2 = r2.escan // Catch:{ RejectedExecutionException -> 0x00e4 }
|
|
|
+ java.util.List r2 = r2.getListScannedFile() // Catch:{ RejectedExecutionException -> 0x00e4 }
|
|
|
+ epson.scan.activity.ScanActivity r3 = epson.scan.activity.ScanActivity.this // Catch:{ RejectedExecutionException -> 0x00e4 }
|
|
|
+ int r3 = r3.totalScanned // Catch:{ RejectedExecutionException -> 0x00e4 }
|
|
|
+ int r3 = r3 - r5
|
|
|
+ java.lang.Object r2 = r2.get(r3) // Catch:{ RejectedExecutionException -> 0x00e4 }
|
|
|
+ java.lang.String r2 = (java.lang.String) r2 // Catch:{ RejectedExecutionException -> 0x00e4 }
|
|
|
+ r1[r0] = r2 // Catch:{ RejectedExecutionException -> 0x00e4 }
|
|
|
+ r9.execute(r1) // Catch:{ RejectedExecutionException -> 0x00e4 }
|
|
|
+ goto L_0x047f
|
|
|
+ L_0x00e4:
|
|
|
+ r9 = move-exception
|
|
|
+ r9.printStackTrace()
|
|
|
+ goto L_0x047f
|
|
|
+ L_0x00ea:
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ java.lang.String r9 = r9.getCallingPackage()
|
|
|
+ java.lang.String r1 = "[EPSON SCAN] START SCAN"
|
|
|
+ epson.print.Util.EPLog.m313i(r9, r1)
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ boolean unused = r9.isStopScan = r0
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ boolean unused = r9.isConfirmCancel = r0
|
|
|
+ boolean r9 = epson.scan.activity.ScanContinueParam.isContinueScanning()
|
|
|
+ if (r9 != 0) goto L_0x010a
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ int unused = r9.convertCount = r0
|
|
|
+ L_0x010a:
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ boolean unused = r9.isDecoding = r0
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ android.view.WindowManager r9 = r9.getWindowManager()
|
|
|
+ android.view.Display r9 = r9.getDefaultDisplay()
|
|
|
+ epson.scan.activity.ScanActivity r1 = epson.scan.activity.ScanActivity.this
|
|
|
+ android.content.res.Resources r1 = r1.getResources()
|
|
|
+ android.content.res.Configuration r1 = r1.getConfiguration()
|
|
|
+ java.lang.String r2 = "display;"
|
|
|
+ int r3 = r1.orientation
|
|
|
+ java.lang.String r3 = java.lang.String.valueOf(r3)
|
|
|
+ epson.print.Util.EPLog.m313i(r2, r3)
|
|
|
+ java.lang.String r2 = "display;"
|
|
|
+ int r3 = r9.getRotation()
|
|
|
+ java.lang.String r3 = java.lang.String.valueOf(r3)
|
|
|
+ epson.print.Util.EPLog.m313i(r2, r3)
|
|
|
+ int r9 = r9.getRotation()
|
|
|
+ r2 = 9
|
|
|
+ r3 = 8
|
|
|
+ switch(r9) {
|
|
|
+ case 0: goto L_0x018b;
|
|
|
+ case 1: goto L_0x017b;
|
|
|
+ case 2: goto L_0x0161;
|
|
|
+ case 3: goto L_0x0147;
|
|
|
+ default: goto L_0x0146;
|
|
|
+ }
|
|
|
+ L_0x0146:
|
|
|
+ goto L_0x019a
|
|
|
+ L_0x0147:
|
|
|
+ int r9 = android.os.Build.VERSION.SDK_INT
|
|
|
+ if (r9 <= r3) goto L_0x015b
|
|
|
+ int r9 = r1.orientation
|
|
|
+ if (r9 != r5) goto L_0x0155
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ r9.setRequestedOrientation(r5)
|
|
|
+ goto L_0x019a
|
|
|
+ L_0x0155:
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ r9.setRequestedOrientation(r3)
|
|
|
+ goto L_0x019a
|
|
|
+ L_0x015b:
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ r9.setRequestedOrientation(r5)
|
|
|
+ goto L_0x019a
|
|
|
+ L_0x0161:
|
|
|
+ int r9 = android.os.Build.VERSION.SDK_INT
|
|
|
+ if (r9 <= r3) goto L_0x0175
|
|
|
+ int r9 = r1.orientation
|
|
|
+ if (r9 != r4) goto L_0x016f
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ r9.setRequestedOrientation(r3)
|
|
|
+ goto L_0x019a
|
|
|
+ L_0x016f:
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ r9.setRequestedOrientation(r2)
|
|
|
+ goto L_0x019a
|
|
|
+ L_0x0175:
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ r9.setRequestedOrientation(r5)
|
|
|
+ goto L_0x019a
|
|
|
+ L_0x017b:
|
|
|
+ int r9 = r1.orientation
|
|
|
+ if (r9 != r5) goto L_0x0185
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ r9.setRequestedOrientation(r2)
|
|
|
+ goto L_0x019a
|
|
|
+ L_0x0185:
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ r9.setRequestedOrientation(r0)
|
|
|
+ goto L_0x019a
|
|
|
+ L_0x018b:
|
|
|
+ int r9 = r1.orientation
|
|
|
+ if (r9 != r4) goto L_0x0195
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ r9.setRequestedOrientation(r0)
|
|
|
+ goto L_0x019a
|
|
|
+ L_0x0195:
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ r9.setRequestedOrientation(r5)
|
|
|
+ L_0x019a:
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ r9.showScanningPop()
|
|
|
+ goto L_0x047f
|
|
|
+ L_0x01a1:
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ android.app.AlertDialog r9 = r9.confirmAlertDialog
|
|
|
+ if (r9 == 0) goto L_0x01be
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ android.app.AlertDialog r9 = r9.confirmAlertDialog
|
|
|
+ boolean r9 = r9.isShowing()
|
|
|
+ if (r9 == 0) goto L_0x01be
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ android.app.AlertDialog r9 = r9.confirmAlertDialog
|
|
|
+ r9.dismiss()
|
|
|
+ L_0x01be:
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ boolean unused = r9.isStopScan = r5
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ android.os.Handler r9 = r9.scanningProgressHandler
|
|
|
+ r9.sendEmptyMessage(r1)
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ boolean r9 = r9.isCompletedScanProcess()
|
|
|
+ if (r9 != 0) goto L_0x01df
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ android.os.Handler r9 = r9.scanningProgressHandler
|
|
|
+ r9.sendEmptyMessageDelayed(r2, r6)
|
|
|
+ goto L_0x047f
|
|
|
+ L_0x01df:
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ r9.updateScreenPreviewToLastData()
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ boolean r9 = r9.isConfirmCancel
|
|
|
+ if (r9 == 0) goto L_0x01ee
|
|
|
+ goto L_0x047f
|
|
|
+ L_0x01ee:
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ android.app.AlertDialog r9 = r9.errorDialog
|
|
|
+ if (r9 == 0) goto L_0x037b
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ android.app.AlertDialog r9 = r9.errorDialog
|
|
|
+ boolean r9 = r9.isShowing()
|
|
|
+ if (r9 != 0) goto L_0x037b
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ epson.scan.lib.escanLib r9 = r9.escan
|
|
|
+ int[] r9 = r9.getStatus()
|
|
|
+ epson.scan.activity.ScanActivity r1 = epson.scan.activity.ScanActivity.this
|
|
|
+ int r1 = r1.error
|
|
|
+ r2 = -1100(0xfffffffffffffbb4, float:NaN)
|
|
|
+ if (r1 != r2) goto L_0x0227
|
|
|
+ r1 = r9[r5]
|
|
|
+ r2 = 5
|
|
|
+ if (r1 != r2) goto L_0x025d
|
|
|
+ r1 = r9[r4]
|
|
|
+ if (r1 == 0) goto L_0x025d
|
|
|
+ epson.scan.activity.ScanActivity r1 = epson.scan.activity.ScanActivity.this
|
|
|
+ r9 = r9[r4]
|
|
|
+ int unused = r1.error = r9
|
|
|
+ goto L_0x025d
|
|
|
+ L_0x0227:
|
|
|
+ epson.scan.activity.ScanActivity r1 = epson.scan.activity.ScanActivity.this
|
|
|
+ int r1 = r1.error
|
|
|
+ r3 = 2131625174(0x7f0e04d6, float:1.8877549E38)
|
|
|
+ if (r1 == r3) goto L_0x025d
|
|
|
+ epson.scan.activity.ScanActivity r1 = epson.scan.activity.ScanActivity.this
|
|
|
+ int r1 = r1.error
|
|
|
+ r3 = -1300(0xfffffffffffffaec, float:NaN)
|
|
|
+ if (r1 == r3) goto L_0x025d
|
|
|
+ epson.scan.activity.ScanActivity r1 = epson.scan.activity.ScanActivity.this
|
|
|
+ int r1 = r1.error
|
|
|
+ if (r1 == r2) goto L_0x025d
|
|
|
+ epson.scan.activity.ScanActivity r1 = epson.scan.activity.ScanActivity.this
|
|
|
+ int r1 = r1.error
|
|
|
+ if (r1 == r5) goto L_0x025d
|
|
|
+ r1 = r9[r4]
|
|
|
+ r2 = 100
|
|
|
+ if (r1 == r2) goto L_0x025d
|
|
|
+ r1 = r9[r4]
|
|
|
+ if (r1 == 0) goto L_0x025d
|
|
|
+ epson.scan.activity.ScanActivity r1 = epson.scan.activity.ScanActivity.this
|
|
|
+ r9 = r9[r4]
|
|
|
+ int unused = r1.error = r9
|
|
|
+ L_0x025d:
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ java.lang.String r9 = r9.getCallingPackage()
|
|
|
+ java.lang.StringBuilder r1 = new java.lang.StringBuilder
|
|
|
+ r1.<init>()
|
|
|
+ java.lang.String r2 = "error = "
|
|
|
+ r1.append(r2)
|
|
|
+ epson.scan.activity.ScanActivity r2 = epson.scan.activity.ScanActivity.this
|
|
|
+ int r2 = r2.error
|
|
|
+ r1.append(r2)
|
|
|
+ java.lang.String r1 = r1.toString()
|
|
|
+ epson.print.Util.EPLog.m313i(r9, r1)
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ int r1 = r9.error
|
|
|
+ r9.setupErrorMessage(r1)
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ android.app.AlertDialog r9 = r9.errorDialog
|
|
|
+ r9.show()
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ android.content.Context r9 = r9.context
|
|
|
+ java.lang.String r1 = "scanner"
|
|
|
+ epson.scan.activity.ScanActivity r2 = epson.scan.activity.ScanActivity.this
|
|
|
+ java.lang.String r2 = r2.usingScannerIp
|
|
|
+ com.epson.mobilephone.common.wifidirect.WiFiDirectManager.disconnect(r9, r1, r2)
|
|
|
+ goto L_0x037b
|
|
|
+ L_0x02a0:
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ boolean unused = r9.isStopScan = r5
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ java.lang.Thread r9 = r9.doscan
|
|
|
+ if (r9 == 0) goto L_0x02c2
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ java.lang.Thread r9 = r9.doscan
|
|
|
+ boolean r9 = r9.isAlive()
|
|
|
+ if (r9 == 0) goto L_0x02c2
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ java.lang.Thread r9 = r9.doscan
|
|
|
+ r9.interrupt()
|
|
|
+ L_0x02c2:
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ epson.scan.lib.escanLib r9 = r9.escan
|
|
|
+ boolean r9 = r9.isScanning()
|
|
|
+ if (r9 != 0) goto L_0x02e7
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ java.lang.String r9 = r9.getLocalClassName()
|
|
|
+ java.lang.String r1 = "scan, cancel find"
|
|
|
+ epson.print.Util.EPLog.m313i(r9, r1)
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ epson.scan.lib.escanLib r9 = r9.escan
|
|
|
+ r9.escanWrapperCancelFindScanner()
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ r9.hideScanningPop()
|
|
|
+ L_0x02e7:
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ epson.scan.lib.escanLib r9 = r9.escan
|
|
|
+ boolean r9 = r9.isScanning()
|
|
|
+ r1 = -2
|
|
|
+ if (r9 == 0) goto L_0x034f
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ epson.scan.lib.escanLib r9 = r9.escan
|
|
|
+ boolean r9 = r9.isJobDone()
|
|
|
+ if (r9 != 0) goto L_0x034f
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ epson.scan.lib.escanLib r9 = r9.escan
|
|
|
+ boolean r9 = r9.isCanselOK()
|
|
|
+ if (r9 != r5) goto L_0x032c
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ java.lang.String r9 = r9.getLocalClassName()
|
|
|
+ java.lang.String r2 = "isCanselOK OK"
|
|
|
+ epson.print.Util.EPLog.m313i(r9, r2)
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ java.lang.String r9 = r9.getLocalClassName()
|
|
|
+ java.lang.String r2 = "scan, cancel scan job"
|
|
|
+ epson.print.Util.EPLog.m313i(r9, r2)
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ epson.scan.lib.escanLib r9 = r9.escan
|
|
|
+ r9.cancelScanJob()
|
|
|
+ goto L_0x034f
|
|
|
+ L_0x032c:
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ java.lang.String r9 = r9.getLocalClassName()
|
|
|
+ java.lang.String r2 = "isCanselOK NO"
|
|
|
+ epson.print.Util.EPLog.m313i(r9, r2)
|
|
|
+ java.lang.Thread.sleep(r6) // Catch:{ InterruptedException -> 0x033b }
|
|
|
+ goto L_0x033f
|
|
|
+ L_0x033b:
|
|
|
+ r9 = move-exception
|
|
|
+ r9.printStackTrace()
|
|
|
+ L_0x033f:
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ android.os.Handler r9 = r9.scanningProgressHandler
|
|
|
+ r9.sendEmptyMessage(r1)
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ boolean unused = r9.isConfirmCancel = r0
|
|
|
+ goto L_0x047f
|
|
|
+ L_0x034f:
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ boolean unused = r9.isConfirmCancel = r0
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ boolean r9 = r9.isCompletedScanProcess()
|
|
|
+ if (r9 != 0) goto L_0x0367
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ android.os.Handler r9 = r9.scanningProgressHandler
|
|
|
+ r9.sendEmptyMessageDelayed(r1, r6)
|
|
|
+ goto L_0x047f
|
|
|
+ L_0x0367:
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ r9.updateScreenPreviewToLastData()
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ android.content.Context r9 = r9.context
|
|
|
+ epson.scan.activity.ScanActivity r1 = epson.scan.activity.ScanActivity.this
|
|
|
+ java.lang.String r1 = r1.usingScannerIp
|
|
|
+ epson.scan.lib.ScannerConnection.disconnectIfSimpleAp(r9, r1)
|
|
|
+ goto L_0x047f
|
|
|
+ L_0x037b:
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ r9.hideScanningPop()
|
|
|
+ goto L_0x047f
|
|
|
+ L_0x0382:
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ java.lang.Thread r9 = r9.doscan
|
|
|
+ if (r9 == 0) goto L_0x0396
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ java.lang.Thread r9 = r9.doscan
|
|
|
+ boolean r9 = r9.isAlive()
|
|
|
+ if (r9 != 0) goto L_0x039e
|
|
|
+ L_0x0396:
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ boolean r9 = r9.isValidArea()
|
|
|
+ if (r9 != 0) goto L_0x03ab
|
|
|
+ L_0x039e:
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ android.os.Handler r9 = r9.scanningProgressHandler
|
|
|
+ r1 = 300(0x12c, double:1.48E-321)
|
|
|
+ r9.sendEmptyMessageDelayed(r3, r1)
|
|
|
+ goto L_0x047f
|
|
|
+ L_0x03ab:
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ r9.scanStart()
|
|
|
+ goto L_0x047f
|
|
|
+ L_0x03b2:
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ java.lang.String r9 = r9.getLocalClassName()
|
|
|
+ java.lang.String r1 = "MESSAGE SCAN FINISHED!!!"
|
|
|
+ epson.print.Util.EPLog.m313i(r9, r1)
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ epson.scan.lib.escanLib r1 = r9.escan
|
|
|
+ java.util.List r1 = r1.getListScannedFile()
|
|
|
+ int r1 = r1.size()
|
|
|
+ r9.totalScanned = r1
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ int r9 = r9.totalScanned
|
|
|
+ epson.scan.activity.ScanActivity r1 = epson.scan.activity.ScanActivity.this
|
|
|
+ epson.scan.activity.ScanCount.saveScanCount(r1, r9)
|
|
|
+ epson.scan.activity.ScanActivity r1 = epson.scan.activity.ScanActivity.this
|
|
|
+ epson.scan.lib.escanLib r1 = r1.escan
|
|
|
+ r1.setJobDone(r5)
|
|
|
+ epson.scan.activity.ScanActivity r1 = epson.scan.activity.ScanActivity.this
|
|
|
+ android.content.Context r1 = r1.getApplicationContext()
|
|
|
+ int r1 = com.epson.iprint.prtlogger.Analytics.getConnectionType(r1)
|
|
|
+ epson.scan.activity.ScanActivity r3 = epson.scan.activity.ScanActivity.this
|
|
|
+ android.app.AlertDialog r3 = r3.confirmAlertDialog
|
|
|
+ if (r3 == 0) goto L_0x0406
|
|
|
+ epson.scan.activity.ScanActivity r3 = epson.scan.activity.ScanActivity.this
|
|
|
+ android.app.AlertDialog r3 = r3.confirmAlertDialog
|
|
|
+ boolean r3 = r3.isShowing()
|
|
|
+ if (r3 == 0) goto L_0x0406
|
|
|
+ epson.scan.activity.ScanActivity r3 = epson.scan.activity.ScanActivity.this
|
|
|
+ android.app.AlertDialog r3 = r3.confirmAlertDialog
|
|
|
+ r3.dismiss()
|
|
|
+ L_0x0406:
|
|
|
+ epson.scan.activity.ScanActivity r3 = epson.scan.activity.ScanActivity.this
|
|
|
+ r3.updateDoneScanJob()
|
|
|
+ epson.scan.activity.ScanActivity r3 = epson.scan.activity.ScanActivity.this
|
|
|
+ java.util.ArrayList r3 = r3.getListSavedJPGFilePath()
|
|
|
+ int r3 = r3.size()
|
|
|
+ epson.scan.activity.ScanContinueParam.setScannedFileCount(r3)
|
|
|
+ boolean r3 = epson.scan.activity.ScanContinueParam.isReachMaximumScan()
|
|
|
+ if (r3 == 0) goto L_0x0431
|
|
|
+ epson.scan.activity.ScanActivity r3 = epson.scan.activity.ScanActivity.this
|
|
|
+ android.content.Context r3 = r3.context
|
|
|
+ java.lang.String r4 = "epson.scanner.SelectedScanner"
|
|
|
+ java.lang.String r6 = "SCAN_REFS_SETTINGS_SOURCE"
|
|
|
+ int r3 = epson.common.Utils.getPrefInt(r3, r4, r6)
|
|
|
+ if (r3 != r5) goto L_0x0431
|
|
|
+ epson.scan.activity.ScanActivity r3 = epson.scan.activity.ScanActivity.this
|
|
|
+ epson.scan.activity.ScanContinueParam.showScanErrorLimit(r3)
|
|
|
+ L_0x0431:
|
|
|
+ epson.scan.activity.ScanActivity r3 = epson.scan.activity.ScanActivity.this
|
|
|
+ r3.setRequestedOrientation(r2)
|
|
|
+ epson.scan.activity.ScanActivity r2 = epson.scan.activity.ScanActivity.this
|
|
|
+ android.content.Context r2 = r2.context
|
|
|
+ epson.scan.activity.ScanActivity r3 = epson.scan.activity.ScanActivity.this
|
|
|
+ java.lang.String r3 = r3.usingScannerIp
|
|
|
+ epson.scan.lib.ScannerConnection.disconnectIfSimpleAp(r2, r3)
|
|
|
+ epson.scan.activity.ScanActivity r2 = epson.scan.activity.ScanActivity.this
|
|
|
+ r2.loggerScanCountUp()
|
|
|
+ epson.scan.activity.ScanActivity r2 = epson.scan.activity.ScanActivity.this
|
|
|
+ r2.checkLoggerServer(r9, r1)
|
|
|
+ goto L_0x047f
|
|
|
+ L_0x044e:
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ epson.scan.activity.ScanBaseView$ScanAreaSet r9 = r9.scanArea
|
|
|
+ r1 = 0
|
|
|
+ r9.redrawCBHandler = r1
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ boolean r9 = r9.isNeedRedrawBitmap
|
|
|
+ if (r9 != r5) goto L_0x0476
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ boolean unused = r9.isNeedRedrawBitmap = r0
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ android.graphics.RectF r1 = r9.getRectScanArea()
|
|
|
+ android.graphics.RectF unused = r9.area = r1
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ android.graphics.RectF r1 = r9.area
|
|
|
+ r9.setBmRectF(r1)
|
|
|
+ L_0x0476:
|
|
|
+ epson.scan.activity.ScanActivity r9 = epson.scan.activity.ScanActivity.this
|
|
|
+ epson.scan.activity.ScanBaseView$ScanAreaSet r9 = r9.scanArea
|
|
|
+ r9.postInvalidate()
|
|
|
+ L_0x047f:
|
|
|
+ return r0
|
|
|
+ */
|
|
|
+ throw new UnsupportedOperationException("Method not decompiled: epson.scan.activity.ScanActivity.C240214.handleMessage(android.os.Message):boolean");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ private TextView tvScanResult;
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public String usingScannerId;
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public String usingScannerIp;
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public int usingScannerLocation;
|
|
|
+ private String usingScannerModel;
|
|
|
+
|
|
|
+ /* access modifiers changed from: protected */
|
|
|
+ public void onCreate(Bundle bundle) {
|
|
|
+ super.onCreate(bundle);
|
|
|
+ setContentView((int) C2135R.layout.scan);
|
|
|
+ setActionBar((int) C2135R.string.str_scan_btn, true);
|
|
|
+ setContext(this);
|
|
|
+ this.mActivityPaused = true;
|
|
|
+ this.mScanAreaBackgroundViewSizeChanged = false;
|
|
|
+ ExternalFileUtils.getInstance(this).initTempViewDir();
|
|
|
+ ExternalFileUtils.getInstance(this).initPrintDir();
|
|
|
+ Intent intent = getIntent();
|
|
|
+ if (intent.getAction() == null || !intent.getAction().equals(EpsoniPrintSharedActivity.ACTION_SCAN)) {
|
|
|
+ this.extParam = new SharedParamScan();
|
|
|
+ } else {
|
|
|
+ this.isCustomAction = true;
|
|
|
+ this.extParam = (SharedParamScan) intent.getSerializableExtra("extParam");
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ this.mScanLog = (CommonLog) intent.getSerializableExtra(PARAM_KEY_SCAN_LOG);
|
|
|
+ } catch (ClassCastException unused) {
|
|
|
+ }
|
|
|
+ if (this.mScanLog == null) {
|
|
|
+ this.mScanLog = new CommonLog();
|
|
|
+ }
|
|
|
+ this.btnScan = (Button) findViewById(C2135R.C2137id.btnScan);
|
|
|
+ this.btnScan.setOnClickListener(this.mButtonScanListener);
|
|
|
+ this.btnSave = (Button) findViewById(C2135R.C2137id.btnSave);
|
|
|
+ this.btnSave.setOnClickListener(this.mButtonSaveListener);
|
|
|
+ this.btnMail = (Button) findViewById(C2135R.C2137id.btnMail);
|
|
|
+ this.btnMail.setOnClickListener(this.mButtonMailListener);
|
|
|
+ this.btnPrint = (Button) findViewById(C2135R.C2137id.btnPrint);
|
|
|
+ this.btnPrint.setOnClickListener(this.mButtonPrintListener);
|
|
|
+ getSelectedScannerInfo();
|
|
|
+ disableFunctionButtons();
|
|
|
+ if (this.isCustomAction) {
|
|
|
+ this.btnMail.setVisibility(8);
|
|
|
+ this.btnPrint.setVisibility(8);
|
|
|
+ }
|
|
|
+ this.llScanAreaBackground = (LinearLayout) findViewById(C2135R.C2137id.llScanAreaBackground);
|
|
|
+ this.scanAreaBackground = new ScanBaseView.ScanAreaBackground(getContext());
|
|
|
+ this.llScanAreaBackground.addView(this.scanAreaBackground);
|
|
|
+ this.tvScanResult = (TextView) findViewById(C2135R.C2137id.tvScanResult);
|
|
|
+ this.scanArea = new ScanBaseView.ScanAreaSet(getContext());
|
|
|
+ this.flScanResult = (FrameLayout) findViewById(C2135R.C2137id.flScanResult);
|
|
|
+ this.gestureDetector = new GestureDetector(this, new ScanAreaGestureDetector());
|
|
|
+ this.gestureListener = new View.OnTouchListener() {
|
|
|
+ public boolean onTouch(View view, MotionEvent motionEvent) {
|
|
|
+ ScanActivity.this.gestureDetector.onTouchEvent(motionEvent);
|
|
|
+ ScanActivity.this.scanArea.onTouchEvent(motionEvent);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ };
|
|
|
+ this.flScanResult.setOnTouchListener(this.gestureListener);
|
|
|
+ this.btnNext = (Button) findViewById(C2135R.C2137id.btnNext);
|
|
|
+ this.btnNext.setOnClickListener(this.mButtonNextListener);
|
|
|
+ this.btnNext.setOnTouchListener(new View.OnTouchListener() {
|
|
|
+ public boolean onTouch(View view, MotionEvent motionEvent) {
|
|
|
+ switch (motionEvent.getAction()) {
|
|
|
+ case 0:
|
|
|
+ ScanActivity.this.btnNext.setBackgroundResource(C2135R.C2136drawable.bt_right_hover);
|
|
|
+ return false;
|
|
|
+ case 1:
|
|
|
+ ScanActivity.this.btnNext.setBackgroundResource(C2135R.C2136drawable.bt_right_1);
|
|
|
+ return false;
|
|
|
+ default:
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.btnPrev = (Button) findViewById(C2135R.C2137id.btnPrev);
|
|
|
+ this.btnPrev.setOnClickListener(this.mButtonPrevListener);
|
|
|
+ this.btnPrev.setOnTouchListener(new View.OnTouchListener() {
|
|
|
+ public boolean onTouch(View view, MotionEvent motionEvent) {
|
|
|
+ switch (motionEvent.getAction()) {
|
|
|
+ case 0:
|
|
|
+ ScanActivity.this.btnPrev.setBackgroundResource(C2135R.C2136drawable.bt_left_hover);
|
|
|
+ return false;
|
|
|
+ case 1:
|
|
|
+ ScanActivity.this.btnPrev.setBackgroundResource(C2135R.C2136drawable.bt_left);
|
|
|
+ return false;
|
|
|
+ default:
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.btnNext.setVisibility(8);
|
|
|
+ this.btnPrev.setVisibility(8);
|
|
|
+ this.errorDialog = new AlertDialog.Builder(this).create();
|
|
|
+ this.escan = getEscan();
|
|
|
+ this.escan.escanWrapperInitDriver(this);
|
|
|
+ this.escan.setScanHandler(this.scanningProgressHandler);
|
|
|
+ this.llScanArea = (LinearLayout) findViewById(C2135R.C2137id.llScanArea);
|
|
|
+ this.llScanArea.addView(this.scanArea);
|
|
|
+ this.llScanningProgress = (LinearLayout) findViewById(C2135R.C2137id.llScanningProgress);
|
|
|
+ this.btnCancelScan = (Button) findViewById(C2135R.C2137id.btnCancelScan);
|
|
|
+ this.btnCancelScan.setOnClickListener(this.mButtonCancelScanListener);
|
|
|
+ this.llScanArea.getViewTreeObserver().addOnPreDrawListener(this.mOnPreDrawListener);
|
|
|
+ if (ActivityRequestPermissions.isRuntimePermissionSupported()) {
|
|
|
+ String[] strArr = {"android.permission.WRITE_EXTERNAL_STORAGE"};
|
|
|
+ ActivityRequestPermissions.Permission permission = new ActivityRequestPermissions.Permission(strArr[0], new String[]{getString(C2135R.string.permission_dialog_title), getString(C2135R.string.permission_dialog_title)}, new String[]{ActivityRequestPermissions.DialogParameter.setMessage2((Context) this, getString(C2135R.string.permission_dialog_message_storage)), ActivityRequestPermissions.DialogParameter.setMessage3A((Context) this, getString(C2135R.string.permission_dialog_message_storage), getString(C2135R.string.permission_function_storage))});
|
|
|
+ if (!ActivityRequestPermissions.checkPermission(this, strArr)) {
|
|
|
+ ActivityRequestPermissions.requestPermission((Activity) this, permission, 4);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (bundle == null && !startI2ActivityIfEscIVersionMismatch()) {
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private boolean startI2ActivityIfEscIVersionMismatch() {
|
|
|
+ if (ScanInfoStorage.loadEscIVersion(this) != 2) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ SharedParamScan sharedParamScan = null;
|
|
|
+ setBm((Bitmap) null);
|
|
|
+ boolean z = this.bAutoStartScan;
|
|
|
+ if (this.isCustomAction) {
|
|
|
+ sharedParamScan = this.extParam;
|
|
|
+ }
|
|
|
+ startActivityForResult(ScanActivityCommonParams.getEscIVersionChangeIntent(this, 2, z, sharedParamScan, this.mScanLog), 20);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void onScanAreaSizeChange() {
|
|
|
+ this.mScanAreaBackgroundViewSizeChanged = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean onKeyDown(int i, KeyEvent keyEvent) {
|
|
|
+ LinearLayout linearLayout = this.llScanningProgress;
|
|
|
+ if (linearLayout == null || linearLayout.getVisibility() != 0) {
|
|
|
+ return super.onKeyDown(i, keyEvent);
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* access modifiers changed from: protected */
|
|
|
+ public void onRestart() {
|
|
|
+ this.isNeedDeleteTempFile = false;
|
|
|
+ super.onRestart();
|
|
|
+ }
|
|
|
+
|
|
|
+ /* access modifiers changed from: protected */
|
|
|
+ public void onStart() {
|
|
|
+ if (this.isNeedDeleteTempFile) {
|
|
|
+ removeTempContents(this);
|
|
|
+ }
|
|
|
+ super.onStart();
|
|
|
+ }
|
|
|
+
|
|
|
+ public void onBackPressed() {
|
|
|
+ super.onBackPressed();
|
|
|
+ this.escan.escanWrapperReleaseDriver();
|
|
|
+ removeTempContents(this);
|
|
|
+ finish();
|
|
|
+ }
|
|
|
+
|
|
|
+ /* access modifiers changed from: protected */
|
|
|
+ public void onDestroy() {
|
|
|
+ removeTempContents(this);
|
|
|
+ if (this.isCustomAction) {
|
|
|
+ ArrayList<String> listSavedJPGFilePath = getListSavedJPGFilePath();
|
|
|
+ for (int i = 0; i < listSavedJPGFilePath.size(); i++) {
|
|
|
+ Utils.deleteTempFile(listSavedJPGFilePath.get(i));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ System.gc();
|
|
|
+ super.onDestroy();
|
|
|
+ }
|
|
|
+
|
|
|
+ /* access modifiers changed from: protected */
|
|
|
+ public void onResume() {
|
|
|
+ super.onResume();
|
|
|
+ NfcTagUtils.enableForegroundDispatch(this, (IntentFilter[]) null, (String[][]) null);
|
|
|
+ this.mActivityPaused = false;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* access modifiers changed from: protected */
|
|
|
+ public void onPause() {
|
|
|
+ super.onPause();
|
|
|
+ NfcTagUtils.disableForegroundDispatch(this);
|
|
|
+ this.mActivityPaused = true;
|
|
|
+ if (isFinishing()) {
|
|
|
+ this.escan.escanWrapperReleaseDriver();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /* access modifiers changed from: protected */
|
|
|
+ public void onNewIntent(Intent intent) {
|
|
|
+ NfcTagUtils.EpsonNfcConnectInfo parseNECTag;
|
|
|
+ super.onNewIntent(intent);
|
|
|
+ String action = intent.getAction();
|
|
|
+ Thread thread = this.doscan;
|
|
|
+ if ((thread == null || !thread.isAlive()) && "android.nfc.action.NDEF_DISCOVERED".equals(action) && (parseNECTag = NfcTagUtils.parseNECTag(this, intent)) != null) {
|
|
|
+ Intent intent2 = new Intent();
|
|
|
+ intent2.setClass(this, ActivityNfcPrinter.class);
|
|
|
+ intent2.putExtra(ActivityNfcPrinter.CONNECTINFO, parseNECTag);
|
|
|
+ intent2.putExtra(ActivityNfcPrinter.CHANGEMODE, 2);
|
|
|
+ startActivityForResult(intent2, 2);
|
|
|
+ this.bAutoStartScan = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void removeTempContents(Context context) {
|
|
|
+ File file = new File(ExternalFileUtils.getInstance(context).getScannedImageDir());
|
|
|
+ if (file.exists()) {
|
|
|
+ if (file.isDirectory()) {
|
|
|
+ for (File file2 : file.listFiles()) {
|
|
|
+ if (file2.isFile()) {
|
|
|
+ file2.delete();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (file.isFile()) {
|
|
|
+ file.delete();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /* access modifiers changed from: protected */
|
|
|
+ public void onStop() {
|
|
|
+ this.isStopScan = true;
|
|
|
+ this.escan.setJobDone(false);
|
|
|
+ Thread thread = this.doscan;
|
|
|
+ if (thread != null && thread.isAlive()) {
|
|
|
+ this.scanningProgressHandler.sendEmptyMessage(-2);
|
|
|
+ }
|
|
|
+ AlertDialog alertDialog = this.errorDialog;
|
|
|
+ if (alertDialog != null && alertDialog.isShowing()) {
|
|
|
+ this.errorDialog.dismiss();
|
|
|
+ }
|
|
|
+ LinearLayout linearLayout = this.llScanningProgress;
|
|
|
+ if (linearLayout != null && linearLayout.getVisibility() == 0) {
|
|
|
+ this.llScanningProgress.setVisibility(8);
|
|
|
+ }
|
|
|
+ super.onStop();
|
|
|
+ }
|
|
|
+
|
|
|
+ public void onConfigurationChanged(Configuration configuration) {
|
|
|
+ super.onConfigurationChanged(configuration);
|
|
|
+ this.isNeedGetScanSize = true;
|
|
|
+ this.isNeedScale = true;
|
|
|
+ RectF rectF = this.area;
|
|
|
+ if (rectF != null) {
|
|
|
+ this.area = getRectScanArea();
|
|
|
+ if (((int) rectF.left) == ((int) this.area.left) && ((int) rectF.top) == ((int) this.area.top) && ((int) rectF.right) == ((int) this.area.right) && ((int) rectF.bottom) == ((int) this.area.bottom)) {
|
|
|
+ this.isNeedRedrawBitmap = true;
|
|
|
+ } else {
|
|
|
+ this.isNeedRedrawBitmap = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.mActivityPaused) {
|
|
|
+ this.mScanAreaBackgroundViewSizeChanged = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean onCreateOptionsMenu(Menu menu) {
|
|
|
+ getMenuInflater().inflate(C2135R.C2138menu.scan_menu, menu);
|
|
|
+ super.onCreateOptionsMenu(menu);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean onOptionsItemSelected(MenuItem menuItem) {
|
|
|
+ if (menuItem.getItemId() != C2135R.C2137id.btn_scan_settings) {
|
|
|
+ return super.onOptionsItemSelected(menuItem);
|
|
|
+ }
|
|
|
+ callScanSetting();
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public void initFrameWithScreensize() {
|
|
|
+ int i = 20;
|
|
|
+ while (true) {
|
|
|
+ int i2 = this.areaHeightOnScreen;
|
|
|
+ if (i < i2) {
|
|
|
+ this.MARGIN_TOP_BOT = i;
|
|
|
+ setMaxScanHeightOnScreen((double) (i2 - (this.MARGIN_TOP_BOT * 2)));
|
|
|
+ setScale(((double) getMaxheight()) / getMaxScanHeightOnScreen());
|
|
|
+ setMaxScanWidthOnScreen(((double) getMaxwidth()) / getScale());
|
|
|
+ if (getMaxScanWidthOnScreen() > ((double) (this.areaWidthOnScreen - 20))) {
|
|
|
+ i += 10;
|
|
|
+ } else {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public void chooseScanSize(int i) {
|
|
|
+ int i2;
|
|
|
+ int i3;
|
|
|
+ int i4 = i;
|
|
|
+ if (i4 == Constants.PaperName.EPS_MSID_USER.getCode()) {
|
|
|
+ int i5 = this.resolution;
|
|
|
+ double d = i5 != 75 ? i5 != 300 ? 1.0d : 2.0d : 0.5d;
|
|
|
+ i3 = Utils.getPrefInt(this.context, epson.common.Constants.SCAN_REFS_SUPPORTED_OPTIONS, epson.common.Constants.SCAN_REFS_MAX_WIDTH);
|
|
|
+ i2 = Utils.getPrefInt(this.context, epson.common.Constants.SCAN_REFS_SUPPORTED_OPTIONS, epson.common.Constants.SCAN_REFS_MAX_HEIGHT);
|
|
|
+ if (i3 == 0) {
|
|
|
+ i3 = (int) (1275.0d * d);
|
|
|
+ }
|
|
|
+ if (i2 == 0) {
|
|
|
+ i2 = (int) (d * 1755.0d);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ Point paperSize = ScanSizeHelper.getPaperSize(i4, this.resolution);
|
|
|
+ int i6 = paperSize.x;
|
|
|
+ i2 = paperSize.y;
|
|
|
+ i3 = i6;
|
|
|
+ }
|
|
|
+ if (this.isDoctable) {
|
|
|
+ if (this.scanOrigin == 2) {
|
|
|
+ setmTop(getmBaseTop());
|
|
|
+ double d2 = (double) i3;
|
|
|
+ double d3 = (double) i2;
|
|
|
+ setmBot(new Point((int) Math.ceil(((double) getmBaseTop().x) + ((getMaxScanWidthOnScreen() * d2) / ((double) getMaxwidth()))), (int) Math.round(((double) getmBaseTop().y) + ((getMaxScanHeightOnScreen() * d3) / ((double) getMaxheight())))));
|
|
|
+ setPiBaseTop(new ScanBaseView.PointInfo((double) getmBaseTop().x, (double) getmBaseTop().y));
|
|
|
+ setPiBaseBot(new ScanBaseView.PointInfo(((double) getmBaseTop().x) + ((d2 * getMaxScanWidthOnScreen()) / ((double) getMaxwidth())), ((double) getmBaseTop().y) + ((d3 * getMaxScanHeightOnScreen()) / ((double) getMaxheight()))));
|
|
|
+ setScreenStatus(1);
|
|
|
+ }
|
|
|
+ hideTotalScanned();
|
|
|
+ } else {
|
|
|
+ setMaxwidth(i3);
|
|
|
+ setMaxheight(i2);
|
|
|
+ setScale(((double) getMaxheight()) / getMaxScanHeightOnScreen());
|
|
|
+ setMaxScanWidthOnScreen((double) ((int) (((double) getMaxwidth()) / getScale())));
|
|
|
+ setmBaseTop(new Point(((int) (((double) this.areaWidthOnScreen) - getMaxScanWidthOnScreen())) / 2, this.MARGIN_TOP_BOT));
|
|
|
+ setmBaseBot(new Point(this.areaWidthOnScreen - getmBaseTop().x, this.areaHeightOnScreen - this.MARGIN_TOP_BOT));
|
|
|
+ setmTop(getmBaseTop());
|
|
|
+ setmBot(getmBaseBot());
|
|
|
+ setPiBaseTop(new ScanBaseView.PointInfo((((double) this.areaWidthOnScreen) - getMaxScanWidthOnScreen()) / 2.0d, (double) this.MARGIN_TOP_BOT));
|
|
|
+ setPiBaseBot(new ScanBaseView.PointInfo((double) (this.areaWidthOnScreen - getmBaseTop().x), (double) (this.areaHeightOnScreen - this.MARGIN_TOP_BOT)));
|
|
|
+ if (this.isNeedClearBm) {
|
|
|
+ hideTotalScanned();
|
|
|
+ setBm((Bitmap) null);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ setmCenter(calculateTheCenterPoint(getmTop(), getmBot()));
|
|
|
+ setSetSize(true);
|
|
|
+ this.scanArea.postInvalidate();
|
|
|
+ this.scanAreaBackground.postInvalidate();
|
|
|
+ if (this.isDoctable) {
|
|
|
+ Utils.savePref(getApplicationContext(), epson.common.Constants.SCAN_REFS_USED_SCANNER_PATH, epson.common.Constants.SCAN_REFS_SCANNER_CHOSEN_SIZE_DOC, i4);
|
|
|
+ } else {
|
|
|
+ Utils.savePref(getApplicationContext(), epson.common.Constants.SCAN_REFS_USED_SCANNER_PATH, epson.common.Constants.SCAN_REFS_SCANNER_CHOSEN_SIZE_ADF, i4);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public void nextPage() {
|
|
|
+ this.curentViewingFile++;
|
|
|
+ if (this.curentViewingFile > 300 || this.curentViewingFile > this.totalScanned) {
|
|
|
+ this.curentViewingFile--;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ updateThumbResult(this.curentViewingFile);
|
|
|
+ showDisplayingResult();
|
|
|
+ this.scanArea.postInvalidate();
|
|
|
+ }
|
|
|
+
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public void prevPage() {
|
|
|
+ this.curentViewingFile--;
|
|
|
+ if (this.curentViewingFile < 1) {
|
|
|
+ this.curentViewingFile++;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ updateThumbResult(this.curentViewingFile);
|
|
|
+ showDisplayingResult();
|
|
|
+ this.scanArea.postInvalidate();
|
|
|
+ }
|
|
|
+
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public void scanStart() {
|
|
|
+ if (this.usingScannerModel.equals(getString(C2135R.string.str_lbl_title_scan)) || this.usingScannerModel.equals("")) {
|
|
|
+ new AlertDialog.Builder(this.context).setCancelable(false).setTitle(C2135R.string.scanner_not_select).setMessage(getString(C2135R.string.scanner_notselect_warning)).setPositiveButton(getString(C2135R.string.str_ok), new DialogInterface.OnClickListener() {
|
|
|
+ public void onClick(DialogInterface dialogInterface, int i) {
|
|
|
+ }
|
|
|
+ }).show();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (this.isCustomAction) {
|
|
|
+ this.extParam.clearArrayOutFilePath();
|
|
|
+ }
|
|
|
+ Thread thread = this.doscan;
|
|
|
+ if ((thread == null || !thread.isAlive()) && isValidArea()) {
|
|
|
+ this.error = 0;
|
|
|
+ setBm((Bitmap) null);
|
|
|
+ this.isNeedClearBm = false;
|
|
|
+ this.scanAreaBackground.hideText(true);
|
|
|
+ this.scanAreaBackground.invalidate();
|
|
|
+ preparingForScan();
|
|
|
+ this.scanningProgressHandler.sendEmptyMessage(0);
|
|
|
+ this.doscan = new Thread() {
|
|
|
+ public void run() {
|
|
|
+ if (!WiFiDirectManager.isNeedConnect(ScanActivity.this, WiFiDirectManager.DEVICE_TYPE_SCANNER) || !WiFiDirectManager.reconnect(ScanActivity.this, WiFiDirectManager.DEVICE_TYPE_SCANNER, 10)) {
|
|
|
+ if (!ScanContinueParam.isContinueScanning()) {
|
|
|
+ ScanCount.countUpScanPage(ScanActivity.this.getApplicationContext());
|
|
|
+ }
|
|
|
+ if (!Utils.isMediaMounted()) {
|
|
|
+ int unused = ScanActivity.this.error = 101;
|
|
|
+ ScanActivity.this.scanningProgressHandler.sendEmptyMessage(-1);
|
|
|
+ } else if (!ScanActivity.this.canStartScan()) {
|
|
|
+ int unused2 = ScanActivity.this.error = -1001;
|
|
|
+ ScanActivity.this.scanningProgressHandler.sendEmptyMessage(-1);
|
|
|
+ } else if (ScanActivity.this.usingScannerId == null || ScanActivity.this.usingScannerId.trim().length() < 1) {
|
|
|
+ int unused3 = ScanActivity.this.error = -1300;
|
|
|
+ ScanActivity.this.scanningProgressHandler.sendEmptyMessage(-1);
|
|
|
+ } else {
|
|
|
+ if (ScanActivity.this.usingScannerLocation != 3) {
|
|
|
+ ScanActivity scanActivity = ScanActivity.this;
|
|
|
+ int unused4 = scanActivity.error = scanActivity.escan.probeScannerById(ScanActivity.this.usingScannerId, ScanActivity.this.usingScannerIp);
|
|
|
+ if (ScanActivity.this.error == -1051) {
|
|
|
+ EPLog.m307e(ScanActivity.this.getLocalClassName(), "scan, ESCAN_ERR_LIB_NOT_INITIALIZED");
|
|
|
+ ScanActivity.this.escan.escanWrapperInitDriver(ScanActivity.this);
|
|
|
+ ScanActivity scanActivity2 = ScanActivity.this;
|
|
|
+ int unused5 = scanActivity2.error = scanActivity2.escan.probeScannerById(ScanActivity.this.usingScannerId, ScanActivity.this.usingScannerIp);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ ScanActivity scanActivity3 = ScanActivity.this;
|
|
|
+ int unused6 = scanActivity3.error = scanActivity3.escan.probeScannerByIp(ScanActivity.this.usingScannerId, ScanActivity.this.usingScannerIp);
|
|
|
+ if (ScanActivity.this.error == -1051) {
|
|
|
+ EPLog.m307e(ScanActivity.this.getLocalClassName(), "scan, ESCAN_ERR_LIB_NOT_INITIALIZED");
|
|
|
+ ScanActivity.this.escan.escanWrapperInitDriver(ScanActivity.this);
|
|
|
+ ScanActivity scanActivity4 = ScanActivity.this;
|
|
|
+ int unused7 = scanActivity4.error = scanActivity4.escan.probeScannerByIp(ScanActivity.this.usingScannerId, ScanActivity.this.usingScannerIp);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (ScanActivity.this.error == 0) {
|
|
|
+ EPLog.m313i(ScanActivity.this.getLocalClassName(), "scan, done probe");
|
|
|
+ if (ScanActivity.this.escan.getListFoundScanner() == null || ScanActivity.this.escan.getListFoundScanner().size() < 1) {
|
|
|
+ EPLog.m307e(ScanActivity.this.getLocalClassName(), "scan, ESCAN_ERR_SCANNER_NOT_FOUND");
|
|
|
+ int unused8 = ScanActivity.this.error = -1300;
|
|
|
+ if (!ScanActivity.this.isStopScan) {
|
|
|
+ ScanActivity.this.scanningProgressHandler.sendEmptyMessage(-1);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ ScanActivity scanActivity5 = ScanActivity.this;
|
|
|
+ int unused9 = scanActivity5.error = scanActivity5.escan.escanWrapperSetScanner(0);
|
|
|
+ if (ScanActivity.this.error != 0) {
|
|
|
+ int unused10 = ScanActivity.this.error = -1300;
|
|
|
+ ScanActivity.this.scanningProgressHandler.sendEmptyMessage(-1);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ ScanActivity scanActivity6 = ScanActivity.this;
|
|
|
+ String unused11 = scanActivity6.usingScannerIp = scanActivity6.escan.getListFoundScanner().get(0).getIp();
|
|
|
+ ScanActivity.this.escan.resetEscanLib();
|
|
|
+ if (ScanActivity.this.escan.getListScannedFile() == null) {
|
|
|
+ EPLog.m313i(ScanActivity.this.getLocalClassName(), "scan, getListScannedFile == NULL");
|
|
|
+ ScanActivity.this.escan.setListScannedFile(new ArrayList());
|
|
|
+ } else if (!ScanContinueParam.isContinueScanning()) {
|
|
|
+ EPLog.m313i(ScanActivity.this.getLocalClassName(), "scan, getListScannedFile != NULL");
|
|
|
+ ScanActivity.this.escan.getListScannedFile().clear();
|
|
|
+ int unused12 = ScanActivity.this.previousTotalScanned = 0;
|
|
|
+ }
|
|
|
+ ScanActivity scanActivity7 = ScanActivity.this;
|
|
|
+ int unused13 = scanActivity7.error = scanActivity7.escan.GetSupportedOption();
|
|
|
+ ScanActivity.this.escan.makeJobAttribute(ScanActivity.this.getContext(), ScanActivity.this.extParam);
|
|
|
+ synchronized (ScanActivity.this) {
|
|
|
+ I1ScanParams unused14 = ScanActivity.this.mI1ScanParams = ScanActivity.this.escan.getScanParams();
|
|
|
+ }
|
|
|
+ if (ScanActivity.this.isStopScan || ScanActivity.this.escan.isScanning()) {
|
|
|
+ EPLog.m307e(ScanActivity.this.getLocalClassName(), "scan, after makeJobAttribute");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ ScanActivity scanActivity8 = ScanActivity.this;
|
|
|
+ String access$3300 = scanActivity8.makeImageName(scanActivity8.extParam);
|
|
|
+ String localClassName = ScanActivity.this.getLocalClassName();
|
|
|
+ EPLog.m313i(localClassName, "scan, fname = " + access$3300);
|
|
|
+ ScanActivity scanActivity9 = ScanActivity.this;
|
|
|
+ int unused15 = scanActivity9.error = scanActivity9.escan.startScanJob(access$3300);
|
|
|
+ String localClassName2 = ScanActivity.this.getLocalClassName();
|
|
|
+ EPLog.m313i(localClassName2, "[ESCAN][DONE] escanLib().startScanJob - return - " + ScanActivity.this.error);
|
|
|
+ if (ScanActivity.this.error == 40) {
|
|
|
+ boolean unused16 = ScanActivity.this.isStopScan = true;
|
|
|
+ int unused17 = ScanActivity.this.error = 0;
|
|
|
+ }
|
|
|
+ if (!ScanActivity.this.isStopScan) {
|
|
|
+ EPLog.m307e(ScanActivity.this.getLocalClassName(), "IN-> isStopScan.");
|
|
|
+ if (!(ScanActivity.this.escan.getStatus()[2] == 4 || (ScanActivity.this.error == 0 && ScanActivity.this.escan.getStatus()[2] == 0))) {
|
|
|
+ ScanActivity.this.scanningProgressHandler.sendEmptyMessage(-1);
|
|
|
+ if (ScanActivity.this.escan.getListScannedFile().size() > 0) {
|
|
|
+ EPLog.m307e(ScanActivity.this.getLocalClassName(), "END SCAN because error.");
|
|
|
+ ScanActivity.this.scanningProgressHandler.sendEmptyMessageDelayed(2, 500);
|
|
|
+ }
|
|
|
+ EPLog.m307e(ScanActivity.this.getLocalClassName(), "SCAN error.");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ EPLog.m313i(ScanActivity.this.getLocalClassName(), "END SCAN NORMALY.");
|
|
|
+ ScanActivity.this.scanningProgressHandler.sendEmptyMessage(2);
|
|
|
+ } else if (!ScanActivity.this.isStopScan) {
|
|
|
+ ScanActivity.this.scanningProgressHandler.sendEmptyMessage(-1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ this.doscan.start();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public void check3GAndStartPrint() {
|
|
|
+ ScanContinueParam.judgeScanContinue(this, getListSavedJPGFilePath());
|
|
|
+ }
|
|
|
+
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public boolean canStartScan() {
|
|
|
+ StatFs statFs = new StatFs(CommonDefine.DEFAULT_DIR);
|
|
|
+ double availableBlocksLong = ((double) statFs.getAvailableBlocksLong()) * ((double) statFs.getBlockSizeLong());
|
|
|
+ double maxwidth = (double) (getMaxwidth() * getMaxheight() * 3);
|
|
|
+ if (availableBlocksLong > (!this.isDoctable ? maxwidth * ((double) (ScanContinueParam.getAvailableScanPageCount() + 1)) : maxwidth * 2.0d)) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public String makeImageName(SharedParamScan sharedParamScan) {
|
|
|
+ StringBuilder sb;
|
|
|
+ if (sharedParamScan.isAvailable()) {
|
|
|
+ File file = new File(sharedParamScan.getFolder_name());
|
|
|
+ file.mkdirs();
|
|
|
+ sb = new StringBuilder(file.getPath());
|
|
|
+ sb.append(CommonDefine.SLASH);
|
|
|
+ sb.append(sharedParamScan.getFile_name());
|
|
|
+ } else {
|
|
|
+ File file2 = new File(ExternalFileUtils.getInstance(this).getScannedImageDir());
|
|
|
+ file2.mkdirs();
|
|
|
+ if (!ScanContinueParam.isContinueScanning()) {
|
|
|
+ removeTempScannedImage(file2);
|
|
|
+ ScanContinueParam.resetParameter();
|
|
|
+ }
|
|
|
+ Calendar instance = Calendar.getInstance();
|
|
|
+ sb = new StringBuilder(file2.getPath());
|
|
|
+ sb.append(CommonDefine.SLASH);
|
|
|
+ sb.append(instance.get(1));
|
|
|
+ sb.append(instance.get(2) + 1);
|
|
|
+ sb.append(instance.get(5));
|
|
|
+ sb.append(instance.get(11));
|
|
|
+ sb.append(instance.get(12));
|
|
|
+ sb.append(instance.get(13));
|
|
|
+ }
|
|
|
+ return sb.toString();
|
|
|
+ }
|
|
|
+
|
|
|
+ private static void removeTempScannedImage(File file) {
|
|
|
+ if (!file.exists()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (file.isDirectory()) {
|
|
|
+ for (File file2 : file.listFiles()) {
|
|
|
+ if (file2.isFile()) {
|
|
|
+ file2.delete();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (file.isFile()) {
|
|
|
+ file.delete();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public void setupErrorMessage(int i) {
|
|
|
+ if (i != -500001) {
|
|
|
+ if (i != -1501) {
|
|
|
+ if (i != -1300) {
|
|
|
+ if (i != -1100) {
|
|
|
+ if (i == -1001) {
|
|
|
+ this.errorDialog = Utils.makeMessageBox(getContext(), getString(C2135R.string.str_blank), getString(C2135R.string.str_err_msg_out_of_memory_title), getString(C2135R.string.str_ok));
|
|
|
+ return;
|
|
|
+ } else if (i != C2135R.string.str_lbl_title_scan) {
|
|
|
+ switch (i) {
|
|
|
+ case 2:
|
|
|
+ this.errorDialog = Utils.makeMessageBox(getContext(), getString(C2135R.string.str_err_msg_scan_coveropen_title), getString(C2135R.string.str_err_msg_scan_coveropen), getString(C2135R.string.str_ok));
|
|
|
+ return;
|
|
|
+ case 3:
|
|
|
+ this.errorDialog = Utils.makeMessageBox(getContext(), getString(C2135R.string.str_err_msg_scan_paperjam_title), getString(C2135R.string.str_err_msg_scan_paperjam), getString(C2135R.string.str_ok));
|
|
|
+ return;
|
|
|
+ case 4:
|
|
|
+ this.errorDialog = Utils.makeMessageBox(getContext(), getString(C2135R.string.str_err_msg_scan_paperout_title), getString(C2135R.string.str_err_msg_scan_paperout), getString(C2135R.string.str_ok));
|
|
|
+ return;
|
|
|
+ case 5:
|
|
|
+ break;
|
|
|
+ case 6:
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ switch (i) {
|
|
|
+ case 100:
|
|
|
+ this.errorDialog = Utils.makeMessageBox(getContext(), getString(C2135R.string.str_err_msg_scan_adf_paperout_title), getString(C2135R.string.str_err_msg_scan_adf_paperout), getString(C2135R.string.str_ok));
|
|
|
+ return;
|
|
|
+ case 101:
|
|
|
+ this.errorDialog = Utils.makeMessageBox(getContext(), getString(C2135R.string.unknow_error_title), getString(C2135R.string.str_no_sdcard), getString(C2135R.string.str_ok));
|
|
|
+ return;
|
|
|
+ default:
|
|
|
+ this.errorDialog = Utils.makeMessageBox(getContext(), getString(C2135R.string.str_err_msg_scan_generic_internal_title), getString(C2135R.string.str_err_msg_scan_generic_internal), getString(C2135R.string.str_ok));
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.errorDialog = Utils.makeMessageBox(getContext(), getString(C2135R.string.str_lbl_title_scan), getString(C2135R.string.str_ok));
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.errorDialog = Utils.makeMessageBox(getContext(), getString(C2135R.string.str_err_msg_scan_comm_title), getString(C2135R.string.str_err_msg_scan_comm), getString(C2135R.string.str_ok));
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.errorDialog = Utils.makeMessageBox(getContext(), getString(C2135R.string.str_err_msg_scan_not_found_title), getString(C2135R.string.str_err_msg_scan_not_found_research), getString(C2135R.string.str_ok));
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.errorDialog = Utils.makeMessageBox(getContext(), getString(C2135R.string.str_err_msg_scan_busy_title), getString(C2135R.string.str_err_msg_scan_busy), getString(C2135R.string.str_ok));
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.errorDialog = Utils.makeMessageBox(this.context, getString(C2135R.string.EPS_PRNERR_COMM_TITLE2), getString(C2135R.string.str_ipprinter_comerror), getString(C2135R.string.str_ok));
|
|
|
+ }
|
|
|
+
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public void showScanningPop() {
|
|
|
+ LinearLayout linearLayout = this.llScanningProgress;
|
|
|
+ if (linearLayout != null) {
|
|
|
+ linearLayout.setVisibility(0);
|
|
|
+ findViewById(C2135R.C2137id.llScanFunctionBar).invalidate();
|
|
|
+ }
|
|
|
+ EPLog.m313i(TAG, "addFlags : FLAG_KEEP_SCREEN_ON ");
|
|
|
+ getWindow().addFlags(128);
|
|
|
+ }
|
|
|
+
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public void hideScanningPop() {
|
|
|
+ LinearLayout linearLayout = this.llScanningProgress;
|
|
|
+ if (linearLayout != null) {
|
|
|
+ linearLayout.setVisibility(8);
|
|
|
+ findViewById(C2135R.C2137id.llScanFunctionBar).invalidate();
|
|
|
+ }
|
|
|
+ EPLog.m313i(TAG, "clearFlags : FLAG_KEEP_SCREEN_ON ");
|
|
|
+ getWindow().clearFlags(128);
|
|
|
+ }
|
|
|
+
|
|
|
+ static PrintLog getPrintLog() {
|
|
|
+ PrintLog printLog = new PrintLog();
|
|
|
+ printLog.uiRoute = 4;
|
|
|
+ return printLog;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void getSelectedScannerInfo() {
|
|
|
+ if (this.isNeedGetScanSize) {
|
|
|
+ String prefString = Utils.getPrefString(getApplicationContext(), epson.common.Constants.SCAN_REFS_USED_SCANNER_PATH, epson.common.Constants.SCAN_REFS_SCANNER_ID);
|
|
|
+ if (!this.isNeedUpdateScanningArea) {
|
|
|
+ if (prefString.equals(this.usingScannerId)) {
|
|
|
+ this.isNeedUpdateScanningArea = false;
|
|
|
+ } else {
|
|
|
+ this.isNeedUpdateScanningArea = true;
|
|
|
+ setBm((Bitmap) null);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.usingScannerId = prefString;
|
|
|
+ this.usingScannerModel = Utils.getPrefString(getApplicationContext(), epson.common.Constants.SCAN_REFS_USED_SCANNER_PATH, epson.common.Constants.SCAN_REFS_SCANNER_MODEL);
|
|
|
+ this.usingScannerIp = Utils.getPrefString(getApplicationContext(), epson.common.Constants.SCAN_REFS_USED_SCANNER_PATH, epson.common.Constants.SCAN_REFS_SCANNER_IP);
|
|
|
+ this.usingScannerLocation = Utils.getPrefInt(getApplicationContext(), epson.common.Constants.SCAN_REFS_USED_SCANNER_PATH, epson.common.Constants.SCAN_REFS_SCANNER_LOCATION);
|
|
|
+ boolean z = Utils.getPrefInt(this.context, epson.common.Constants.SCAN_REFS_USED_SCANNER_PATH, epson.common.Constants.SCAN_REFS_SETTINGS_SOURCE) == 0;
|
|
|
+ if (z != this.isDoctable) {
|
|
|
+ this.isNeedClearBm = true;
|
|
|
+ setBm((Bitmap) null);
|
|
|
+ } else {
|
|
|
+ this.isNeedClearBm = false;
|
|
|
+ }
|
|
|
+ if (!z && z == this.isDoctable && !this.isNeedUpdateScanningArea) {
|
|
|
+ this.isNeedUpdateScanningArea = false;
|
|
|
+ }
|
|
|
+ if (z && z == this.isDoctable && !this.isNeedUpdateScanningArea) {
|
|
|
+ this.isNeedUpdateScanningArea = false;
|
|
|
+ } else {
|
|
|
+ this.isNeedUpdateScanningArea = true;
|
|
|
+ }
|
|
|
+ this.isDoctable = z;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public void loggerScanCountUp() {
|
|
|
+ if (this.totalScanned > 0) {
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public boolean isCompletedScanProcess() {
|
|
|
+ return getListSavedJPGFilePath().size() == this.totalScanned;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void preparingForScan() {
|
|
|
+ this.escan.setJobDone(false);
|
|
|
+ this.escan.setScanning(false);
|
|
|
+ this.isConfirmCancel = false;
|
|
|
+ this.previousTotalScanned = this.escan.getListScannedFile().size();
|
|
|
+ this.area = getRectScanArea();
|
|
|
+ if (!ScanContinueParam.isContinueScanning()) {
|
|
|
+ this.totalScanned = 0;
|
|
|
+ this.curentViewingFile = 0;
|
|
|
+ hideTotalScanned();
|
|
|
+ disableFunctionButtons();
|
|
|
+ getListSavedJPGFilePath().clear();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void showTotalScanned() {
|
|
|
+ this.tvScanResult.setVisibility(0);
|
|
|
+ TextView textView = this.tvScanResult;
|
|
|
+ textView.setText(this.curentViewingFile + epson.common.Constants.CROSS + this.totalScanned);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void hideTotalScanned() {
|
|
|
+ this.tvScanResult.setVisibility(8);
|
|
|
+ this.btnNext.setVisibility(8);
|
|
|
+ this.btnPrev.setVisibility(8);
|
|
|
+ }
|
|
|
+
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public void showDisplayingResult() {
|
|
|
+ TextView textView = this.tvScanResult;
|
|
|
+ textView.setText(this.curentViewingFile + epson.common.Constants.CROSS + this.totalScanned);
|
|
|
+ }
|
|
|
+
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public void updateDoneScanJob() {
|
|
|
+ this.totalScanned = this.escan.getListScannedFile().size();
|
|
|
+ if (this.totalScanned == this.previousTotalScanned) {
|
|
|
+ if (Utils.getPrefInt(this.context, epson.common.Constants.SCAN_REFS_USED_SCANNER_PATH, epson.common.Constants.SCAN_REFS_SETTINGS_SOURCE) == 1) {
|
|
|
+ this.error = 100;
|
|
|
+ this.scanningProgressHandler.sendEmptyMessage(-1);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.totalScanned = this.escan.getListScannedFile().size();
|
|
|
+ if (this.totalScanned == this.previousTotalScanned) {
|
|
|
+ this.error = -1100;
|
|
|
+ this.scanningProgressHandler.sendEmptyMessage(-1);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.totalScanned > 0) {
|
|
|
+ enableFunctionButtons();
|
|
|
+ }
|
|
|
+ if (this.totalScanned > 1) {
|
|
|
+ this.curentViewingFile = this.totalScanned;
|
|
|
+ this.btnNext.setVisibility(0);
|
|
|
+ this.btnPrev.setVisibility(8);
|
|
|
+ showTotalScanned();
|
|
|
+ }
|
|
|
+ if (!isCompletedScanProcess()) {
|
|
|
+ this.scanningProgressHandler.sendEmptyMessageDelayed(2, 1000);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.scanningProgressHandler.sendEmptyMessage(-3);
|
|
|
+ updateThumbResult(this.curentViewingFile);
|
|
|
+ }
|
|
|
+
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public void updateScreenPreviewToLastData() {
|
|
|
+ if (this.totalScanned > 1) {
|
|
|
+ this.curentViewingFile = this.totalScanned;
|
|
|
+ showTotalScanned();
|
|
|
+ updateThumbResult(this.curentViewingFile);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public void updateThumbResult(int i) {
|
|
|
+ if (this.totalScanned >= 1) {
|
|
|
+ if (this.totalScanned > 1) {
|
|
|
+ if (this.curentViewingFile == this.totalScanned) {
|
|
|
+ this.btnNext.setVisibility(8);
|
|
|
+ } else {
|
|
|
+ this.btnNext.setVisibility(0);
|
|
|
+ }
|
|
|
+ if (this.curentViewingFile == 1) {
|
|
|
+ this.btnPrev.setVisibility(8);
|
|
|
+ } else {
|
|
|
+ this.btnPrev.setVisibility(0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (i < 1) {
|
|
|
+ i = 1;
|
|
|
+ }
|
|
|
+ if (i > this.totalScanned) {
|
|
|
+ i = this.totalScanned;
|
|
|
+ }
|
|
|
+ String str = getListSavedJPGFilePath().get(i - 1);
|
|
|
+ try {
|
|
|
+ int width = (int) this.area.width();
|
|
|
+ int height = (int) this.area.height();
|
|
|
+ if (width * height < 819200) {
|
|
|
+ width = 1024;
|
|
|
+ height = Videoio.CAP_PVAPI;
|
|
|
+ }
|
|
|
+ Bitmap createBitmapWithUri = Photo.createBitmapWithUri(str, width, height, false);
|
|
|
+ setBmRectF(this.area);
|
|
|
+ setBm(createBitmapWithUri);
|
|
|
+ this.scanArea.postInvalidate();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ } catch (OutOfMemoryError e2) {
|
|
|
+ e2.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void disableFunctionButtons() {
|
|
|
+ CustomButtonWrapper.setScanButtonState(this.btnSave, C2135R.C2136drawable.scan_save, C2135R.string.str_save, false);
|
|
|
+ CustomButtonWrapper.setScanButtonState(this.btnMail, C2135R.C2136drawable.scan_mail, C2135R.string.str_btn_mail, false);
|
|
|
+ CustomButtonWrapper.setScanButtonState(this.btnPrint, C2135R.C2136drawable.scan_print, C2135R.string.str_print, false);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void enableFunctionButtons() {
|
|
|
+ CustomButtonWrapper.setScanButtonState(this.btnSave, C2135R.C2136drawable.scan_save, C2135R.string.str_save, true);
|
|
|
+ CustomButtonWrapper.setScanButtonState(this.btnMail, C2135R.C2136drawable.scan_mail, C2135R.string.str_btn_mail, true);
|
|
|
+ CustomButtonWrapper.setScanButtonState(this.btnPrint, C2135R.C2136drawable.scan_print, C2135R.string.str_print, true);
|
|
|
+ }
|
|
|
+
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public void confirmationDialog(String str) {
|
|
|
+ if (!this.isConfirmCancel) {
|
|
|
+ this.confirmAlertDialog = new AlertDialog.Builder(this.context).create();
|
|
|
+ this.confirmAlertDialog.setIcon(C2135R.C2136drawable.ic_action_warning);
|
|
|
+ this.confirmAlertDialog.setCancelable(false);
|
|
|
+ this.confirmAlertDialog.setOnKeyListener(new DialogInterface.OnKeyListener() {
|
|
|
+ public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) {
|
|
|
+ return keyEvent.getKeyCode() == 84;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.confirmAlertDialog.setMessage(str);
|
|
|
+ this.confirmAlertDialog.setButton(-2, getText(C2135R.string.str_no), new DialogInterface.OnClickListener() {
|
|
|
+ public void onClick(DialogInterface dialogInterface, int i) {
|
|
|
+ if (!ScanActivity.this.escan.isJobDone()) {
|
|
|
+ ScanActivity.this.showScanningPop();
|
|
|
+ }
|
|
|
+ boolean unused = ScanActivity.this.isConfirmCancel = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.confirmAlertDialog.setButton(-1, getText(C2135R.string.str_yes), new DialogInterface.OnClickListener() {
|
|
|
+ public void onClick(DialogInterface dialogInterface, int i) {
|
|
|
+ boolean unused = ScanActivity.this.isConfirmCancel = true;
|
|
|
+ String localClassName = ScanActivity.this.getLocalClassName();
|
|
|
+ EPLog.m313i(localClassName, "yes pressed, isConfirmCancel = " + ScanActivity.this.isConfirmCancel);
|
|
|
+ if (!ScanActivity.this.escan.isJobDone()) {
|
|
|
+ ScanActivity.this.showScanningPop();
|
|
|
+ }
|
|
|
+ ScanActivity.this.scanningProgressHandler.sendEmptyMessage(-2);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.confirmAlertDialog.show();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /* access modifiers changed from: protected */
|
|
|
+ public void onActivityResult(int i, int i2, Intent intent) {
|
|
|
+ super.onActivityResult(i, i2, intent);
|
|
|
+ if (i != 10) {
|
|
|
+ if (i != 20) {
|
|
|
+ switch (i) {
|
|
|
+ case 2:
|
|
|
+ this.escan.resetEscanLib();
|
|
|
+ this.escan.escanWrapperInitDriver(this);
|
|
|
+ this.escan.setScanHandler(this.scanningProgressHandler);
|
|
|
+ onScanSettingEnd(i2, intent);
|
|
|
+ this.bAutoStartScan = false;
|
|
|
+ return;
|
|
|
+ case 4:
|
|
|
+ if (i2 != -1) {
|
|
|
+ onBackPressed();
|
|
|
+ return;
|
|
|
+ } else if (!startI2ActivityIfEscIVersionMismatch()) {
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ } else if (i2 == 1) {
|
|
|
+ this.bAutoStartScan = I2ScanActivity.getAutoStartRequestedFromReturnIntent(intent);
|
|
|
+ Intent intent2 = new Intent();
|
|
|
+ intent2.putExtra(ScanSettingsActivity.IS_NEW_SAVE, true);
|
|
|
+ intent2.putExtra(ScanSettingsActivity.NO_CLEAR_RESULT, false);
|
|
|
+ onScanSettingEnd(-1, intent2);
|
|
|
+ this.bAutoStartScan = false;
|
|
|
+ } else if (this.isCustomAction) {
|
|
|
+ setResult(i2, intent);
|
|
|
+ finish();
|
|
|
+ } else {
|
|
|
+ finish();
|
|
|
+ }
|
|
|
+ } else if (i2 != -1) {
|
|
|
+ hideScanningPop();
|
|
|
+ } else {
|
|
|
+ this.mButtonScanListener.onClick(this.btnScan);
|
|
|
+ EPLog.m305d(TAG, "Send CHECK_PRINTER Message.");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void onScanSettingEnd(int i, Intent intent) {
|
|
|
+ if (i == -1) {
|
|
|
+ if (!startI2ActivityIfEscIVersionMismatch() && intent != null) {
|
|
|
+ Bundle extras = intent.getExtras();
|
|
|
+ String string = extras.getString(epson.common.Constants.ACT_RESULT);
|
|
|
+ if (string == null || !string.equals(epson.common.Constants.ACT_RESULT_BACK)) {
|
|
|
+ this.isNeedGetScanSize = extras.getBoolean(ScanSettingsActivity.IS_NEW_SAVE);
|
|
|
+ boolean z = extras.getBoolean(ScanSettingsActivity.NO_CLEAR_RESULT);
|
|
|
+ if (!z) {
|
|
|
+ setBm((Bitmap) null);
|
|
|
+ hideTotalScanned();
|
|
|
+ disableFunctionButtons();
|
|
|
+ removeTempContents(getApplicationContext());
|
|
|
+ if (this.escan.getListScannedFile() != null) {
|
|
|
+ this.escan.getListScannedFile().clear();
|
|
|
+ this.totalScanned = 0;
|
|
|
+ this.curentViewingFile = 0;
|
|
|
+ }
|
|
|
+ if (getListSavedJPGFilePath() != null) {
|
|
|
+ getListSavedJPGFilePath().clear();
|
|
|
+ }
|
|
|
+ ScanContinueParam.resetParameter();
|
|
|
+ }
|
|
|
+ getSelectedScannerInfo();
|
|
|
+ int prefInt = Utils.getPrefInt(getContext(), epson.common.Constants.SCAN_REFS_USED_SCANNER_PATH, epson.common.Constants.SCAN_REFS_SCANNER_CHOSEN_SIZE);
|
|
|
+ if (prefInt != Constants.PaperName.EPS_MSID_UNKNOWN.getCode()) {
|
|
|
+ chooseScanSize(prefInt);
|
|
|
+ } else {
|
|
|
+ String str = this.oldScannerId;
|
|
|
+ if (str == null || str.length() == 0 || this.usingScannerId.length() == 0 || this.oldScannerId.equals(this.usingScannerId)) {
|
|
|
+ int prefInt2 = Utils.getPrefInt(getContext(), epson.common.Constants.SCAN_REFS_SUPPORTED_OPTIONS, epson.common.Constants.SCAN_REFS_MAX_WIDTH);
|
|
|
+ int prefInt3 = Utils.getPrefInt(getContext(), epson.common.Constants.SCAN_REFS_SUPPORTED_OPTIONS, epson.common.Constants.SCAN_REFS_MAX_HEIGHT);
|
|
|
+ if (prefInt2 < getMaxwidth() || prefInt3 < getMaxheight()) {
|
|
|
+ chooseScanSize(ScanSizeHelper.getDefaultScanSize());
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ chooseScanSize(ScanSizeHelper.getDefaultScanSize());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!z) {
|
|
|
+ this.isNeedGetScanSize = true;
|
|
|
+ this.isNeedUpdateScanningArea = true;
|
|
|
+ }
|
|
|
+ if (this.bAutoStartScan) {
|
|
|
+ this.mButtonScanListener.onClick(this.btnScan);
|
|
|
+ EPLog.m305d(TAG, "Send CHECK_PRINTER Message.");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (i == 0 && !startI2ActivityIfEscIVersionMismatch()) {
|
|
|
+ this.isNeedGetScanSize = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public void onRequestScanAction() {
|
|
|
+ scanStart();
|
|
|
+ }
|
|
|
+
|
|
|
+ class ScanAreaGestureDetector extends GestureDetector.SimpleOnGestureListener {
|
|
|
+ ScanAreaGestureDetector() {
|
|
|
+ }
|
|
|
+
|
|
|
+ public void onLongPress(MotionEvent motionEvent) {
|
|
|
+ ScanActivity scanActivity = ScanActivity.this;
|
|
|
+ scanActivity.bLongTouch = true;
|
|
|
+ scanActivity.scanArea.postInvalidate();
|
|
|
+ super.onLongPress(motionEvent);
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean onFling(MotionEvent motionEvent, MotionEvent motionEvent2, float f, float f2) {
|
|
|
+ Display defaultDisplay = ScanActivity.this.getWindowManager().getDefaultDisplay();
|
|
|
+ Point point = new Point();
|
|
|
+ defaultDisplay.getSize(point);
|
|
|
+ float f3 = (float) point.y;
|
|
|
+ float f4 = (float) point.x;
|
|
|
+ if (f3 > f4) {
|
|
|
+ f3 = f4;
|
|
|
+ }
|
|
|
+ double rawX = (double) ((int) (motionEvent.getRawX() - motionEvent2.getRawX()));
|
|
|
+ if (rawX < ((double) (-f3)) * 0.1d) {
|
|
|
+ ScanActivity.this.prevPage();
|
|
|
+ return false;
|
|
|
+ } else if (rawX <= ((double) f3) * 0.1d) {
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ ScanActivity.this.nextPage();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void callScanSetting() {
|
|
|
+ this.escan.escanWrapperReleaseDriver();
|
|
|
+ this.oldScannerId = this.usingScannerId;
|
|
|
+ Intent intent = new Intent(this, ScanSettingsActivity.class);
|
|
|
+ if (this.isCustomAction) {
|
|
|
+ if (this.extParam.getRes_main() > 0 && this.extParam.getRes_sub() > 0) {
|
|
|
+ intent.putExtra(ScanSettingsActivity.HIDE_RESOLUTION, true);
|
|
|
+ }
|
|
|
+ intent.putExtra(ScanSettingsActivity.HIDE_COLOR_MODE, true);
|
|
|
+ intent.putExtra(ScanSettingsActivity.PARAM_KEY_EXTERNAL_DATA, this.extParam);
|
|
|
+ }
|
|
|
+ intent.setAction("android.intent.action.VIEW");
|
|
|
+ startActivityForResult(intent, 2);
|
|
|
+ }
|
|
|
+
|
|
|
+ class BitmapTask extends AsyncTask<String, Void, Bitmap> {
|
|
|
+ public BitmapTask() {
|
|
|
+ }
|
|
|
+
|
|
|
+ /* access modifiers changed from: protected */
|
|
|
+ public Bitmap doInBackground(String... strArr) {
|
|
|
+ if (ScanActivity.this.escan.isJobDone()) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ return ScanActivity.this.showBitmap(strArr[0]);
|
|
|
+ }
|
|
|
+
|
|
|
+ /* access modifiers changed from: protected */
|
|
|
+ public void onPostExecute(Bitmap bitmap) {
|
|
|
+ ScanActivity.this.displayPreview(bitmap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public Bitmap showBitmap(String str) {
|
|
|
+ Bitmap bitmap;
|
|
|
+ this.isDecoding = true;
|
|
|
+ EPLog.m313i(getCallingPackage(), "start decode for preview ");
|
|
|
+ File file = new File(str);
|
|
|
+ if (file.exists() && file.isFile()) {
|
|
|
+ try {
|
|
|
+ bitmap = Utils.decodeFile(file, this.areaHeightOnScreen - (this.MARGIN_TOP_BOT * 2));
|
|
|
+ } catch (FileNotFoundException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ } catch (OutOfMemoryError e2) {
|
|
|
+ e2.printStackTrace();
|
|
|
+ }
|
|
|
+ EPLog.m313i(getCallingPackage(), "end decode for preview ");
|
|
|
+ return bitmap;
|
|
|
+ }
|
|
|
+ bitmap = null;
|
|
|
+ EPLog.m313i(getCallingPackage(), "end decode for preview ");
|
|
|
+ return bitmap;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public void displayPreview(Bitmap bitmap) {
|
|
|
+ if (!this.escan.isJobDone()) {
|
|
|
+ EPLog.m313i(EpsoniPrintSharedActivity.ACTIVITY_SCAN, "update UI");
|
|
|
+ setBm(bitmap);
|
|
|
+ setBmRectF(this.area);
|
|
|
+ this.scanArea.postInvalidate();
|
|
|
+ }
|
|
|
+ this.isDecoding = false;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public void convert(String str) {
|
|
|
+ getListSavedJPGFilePath().add(str.substring(0, str.length() - 4).concat(".jpg"));
|
|
|
+ if (this.isCustomAction) {
|
|
|
+ this.extParam.setArrayOutFilePath(str);
|
|
|
+ } else {
|
|
|
+ Utils.deleteTempFile(str);
|
|
|
+ }
|
|
|
+ this.convertCount++;
|
|
|
+ updateThumbResult(this.convertCount);
|
|
|
+ }
|
|
|
+
|
|
|
+ @SuppressLint({"NewApi"})
|
|
|
+ static void localSetAllCaps(TextView textView, boolean z) {
|
|
|
+ if (Build.VERSION.SDK_INT >= 21) {
|
|
|
+ textView.setAllCaps(z);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /* access modifiers changed from: private */
|
|
|
+ public void checkLoggerServer(int i, int i2) {
|
|
|
+ I1ScanParams i1ScanParams;
|
|
|
+ if (this.mScanLog.action == 0) {
|
|
|
+ this.mScanLog.action = PrintLog.ACTION_SCAN;
|
|
|
+ }
|
|
|
+ CommonLog commonLog = this.mScanLog;
|
|
|
+ commonLog.numberOfSheet = i - this.previousTotalScanned;
|
|
|
+ commonLog.connectionType = i2;
|
|
|
+ ScannerInfo scannerInfo = new ScannerInfo();
|
|
|
+ ScanInfoStorage.getInstance().loadScannerConnectivityInfo(this, scannerInfo);
|
|
|
+ this.mScanLog.printerName = scannerInfo.getModelName();
|
|
|
+ synchronized (this) {
|
|
|
+ i1ScanParams = this.mI1ScanParams;
|
|
|
+ }
|
|
|
+ if (this.mScanLog.numberOfSheet > 0 && i1ScanParams != null) {
|
|
|
+ Analytics.sendScanI1Log(this, i1ScanParams, this.mScanLog, ScanContinueParam.isContinueScanning());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static ArrayList<String> getScanFileListFromReturnIntent(@Nullable Intent intent) {
|
|
|
+ if (intent == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ return intent.getStringArrayListExtra(RETURN_KEY_SCAN_FILE);
|
|
|
+ }
|
|
|
+}
|