123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278 |
- package epson.print.screen;
- import android.app.AlertDialog;
- import android.app.Dialog;
- import android.content.ComponentName;
- import android.content.Context;
- import android.content.DialogInterface;
- import android.content.Intent;
- import android.content.ServiceConnection;
- import android.net.Uri;
- import android.os.Bundle;
- import android.os.Handler;
- import android.os.IBinder;
- import android.os.Message;
- import android.os.RemoteException;
- import android.view.ContextMenu;
- import android.view.MenuItem;
- import android.view.View;
- import android.view.ViewGroup;
- import android.widget.AdapterView;
- import android.widget.Button;
- import android.widget.ListView;
- import android.widget.ProgressBar;
- import android.widget.RadioButton;
- import android.widget.TextView;
- import com.epson.mobilephone.common.EpLog;
- import com.epson.mobilephone.common.escpr.MediaInfo;
- import com.epson.mobilephone.common.wifidirect.ActivityWiFiDirectStart;
- import com.epson.mobilephone.common.wifidirect.ActivityiPrintConnect;
- import com.epson.mobilephone.common.wifidirect.MacAddrUtils;
- import com.epson.mobilephone.common.wifidirect.SearchWiFiDirectPrinterTask;
- import com.epson.mobilephone.common.wifidirect.WiFiControl;
- import com.epson.mobilephone.common.wifidirect.WiFiDirectManager;
- import com.epson.mobilephone.common.wifidirect.WiFiDirectPrinterListUtils;
- import com.epson.mobilephone.common.wifidirect.escprLib;
- import epson.common.Constants;
- import epson.common.Utils;
- import epson.maintain.activity.PrinterNotFoundDialogCreator;
- import epson.print.ActivityIACommon;
- import epson.print.R;
- import epson.print.CommonDefine;
- import epson.print.CustomLayoutDialogFragment;
- import epson.print.CustomTitleDialogFragment;
- import epson.print.MyPrinter;
- import epson.print.Util.EPLog;
- import epson.print.service.EpsonService;
- import epson.print.service.IEpsonService;
- import epson.print.service.IEpsonServiceCallback;
- import epson.print.widgets.AbstractListBuilder;
- import epson.print.widgets.CustomTitleAlertDialogBuilder;
- import epson.print.widgets.ListControlHelper;
- import epson.print.widgets.PrinterInfoBuilder;
- import epson.print.widgets.PrinterInfoECBuilder;
- import epson.print.widgets.PrinterInfoIpBuilder;
- import java.util.ArrayList;
- import java.util.Locale;
- public class SearchPrinterScr extends ActivityIACommon implements CustomTitleDialogFragment.Callback {
- private static final int DELAY = 100;
- private static final int DIALOG_ID_PRINTER_NOT_FOUND_WITH_WEB_GUIDANCE = 1;
- private static final int DIALOG_INFORM = 0;
- private static final String DIALOG_TAG_PRINTER_NOT_FOUND = "printer_not_found_dialog";
- private static final String EXTRA_PRINTER = "myprinter";
- private static final String EXTRA_SIMPLEAP = "simpleap";
- private static final int Menu_Delete = 1;
- private static final int Menu_Edit = 2;
- private static final String TAG = "SearchPrinterScr";
- /* access modifiers changed from: private */
- public static boolean foundPrinter = false;
- /* access modifiers changed from: private */
- public static final Object mLock = new Object();
- private final int CANCEL_FIND_PRINTER = 2;
- private final int CONNECT_SIMPLEAP = 10;
- private final int DELETE_PRINTER = 7;
- private final int EDIT_IPPRINTER = 11;
- private final int EDIT_PRINTER = 8;
- private final int FOUND_SIMPLEAP = 9;
- private final int INFORM_DIALOG = 5;
- private final String PRINTER_COMMON_DEVICENAME = "common_devicename";
- private final String PRINTER_ID = "id";
- private final String PRINTER_IP = escprLib.PRINTER_IP;
- private final String PRINTER_NAME = "name";
- private final String PRINTER_SERIAL_NO = escprLib.PRINTER_SERIAL_NO;
- private final int PROBE_PRINTER = 12;
- private final int SEARCH_PRINTER = 1;
- private final int SEARCH_PRINTER_P2P = 14;
- private final int SELECT_PRINTER = 4;
- private final int SHOW_PRINTER_NOT_FOUND_DIALOG = 13;
- private final int UPDATE_PRINTER = 3;
- private boolean bCheckWiFiStatus = false;
- private String connectionInfo = null;
- int curError;
- ListControlHelper helper = null;
- /* access modifiers changed from: private */
- public boolean isDialogOpen = false;
- /* access modifiers changed from: private */
- public volatile boolean isFinishSearchPrinter = true;
- /* access modifiers changed from: private */
- public Boolean isFocused = true;
- private boolean isJapaneseLocale = false;
- /* access modifiers changed from: private */
- public volatile boolean isSearchSimpleAp = false;
- private AdapterView.AdapterContextMenuInfo listItemIndex;
- View mAboutRemoteButton;
- private boolean mActivityForegroundLifetime;
- Button mAddButton;
- AbstractListBuilder mBuilder;
- /* access modifiers changed from: private */
- public IEpsonServiceCallback mCallback = new IEpsonServiceCallback.Stub() {
- public void onGetInkState() throws RemoteException {
- }
- public void onGetStatusState() throws RemoteException {
- }
- public void onNotifyEndJob(int i) throws RemoteException {
- }
- public void onNotifyProgress(int i, int i2) throws RemoteException {
- }
- public void onFindPrinterResult(String str, String str2, String str3, String str4, String str5) throws RemoteException {
- EpLog.m77i(str);
- int access$200 = SearchPrinterScr.this.printer_location;
- if (access$200 == 1) {
- Message obtain = Message.obtain();
- obtain.what = 3;
- Bundle bundle = new Bundle();
- bundle.putString("name", str);
- bundle.putString(escprLib.PRINTER_IP, str2);
- bundle.putString("id", str3);
- bundle.putString(escprLib.PRINTER_SERIAL_NO, str4);
- bundle.putString("common_devicename", str5);
- obtain.setData(bundle);
- SearchPrinterScr.this.mHandler.sendMessage(obtain);
- } else if (access$200 == 3) {
- MyPrinter unused = SearchPrinterScr.this.probedPrinter = new MyPrinter(str, str2, str3, str4);
- }
- }
- public void onNotifyContinueable(int i) throws RemoteException {
- if (SearchPrinterScr.this.progress != null && SearchPrinterScr.this.progress.isShowing()) {
- SearchPrinterScr.this.progress.dismiss();
- }
- if (SearchPrinterScr.this.selectedPrinter != null && SearchPrinterScr.this.probedPrinter != null && SearchPrinterScr.this.printer_location == 3) {
- if (SearchPrinterScr.this.probedPrinter.getPrinterId().equals(SearchPrinterScr.this.selectedPrinter.getPrinterId())) {
- Message obtainMessage = SearchPrinterScr.this.mHandler.obtainMessage();
- obtainMessage.what = 4;
- obtainMessage.obj = SearchPrinterScr.this.selectedPrinter;
- SearchPrinterScr.this.mHandler.sendMessage(obtainMessage);
- return;
- }
- SearchPrinterScr searchPrinterScr = SearchPrinterScr.this;
- searchPrinterScr.curError = -500001;
- searchPrinterScr.mHandler.sendEmptyMessage(5);
- }
- }
- public void onNotifyError(int i, int i2, boolean z) throws RemoteException {
- if (!SearchPrinterScr.this.isSearchSimpleAp) {
- synchronized (SearchPrinterScr.mLock) {
- boolean unused = SearchPrinterScr.foundPrinter = Utils.getPrefBoolean(SearchPrinterScr.this.getApplicationContext(), "PrintSetting", CommonDefine.RE_SEARCH);
- if ((i2 == -1300 || i2 == -1351) && !SearchPrinterScr.foundPrinter) {
- i2 = -1100;
- } else if ((i2 == -1300 || i2 == -1351 || i2 == -1100) && SearchPrinterScr.foundPrinter) {
- i2 = -11001;
- }
- }
- SearchPrinterScr searchPrinterScr = SearchPrinterScr.this;
- searchPrinterScr.curError = i2;
- searchPrinterScr.mHandler.sendEmptyMessage(13);
- if (SearchPrinterScr.this.progress != null && SearchPrinterScr.this.progress.isShowing()) {
- SearchPrinterScr.this.progress.dismiss();
- }
- Boolean unused2 = SearchPrinterScr.this.isFocused = true;
- }
- }
- };
- /* access modifiers changed from: private */
- public Context mContext = null;
- /* access modifiers changed from: private */
- public int mDeletePos = -1;
- private ServiceConnection mEpsonConnection = new ServiceConnection() {
- public void onServiceDisconnected(ComponentName componentName) {
- try {
- SearchPrinterScr.this.mEpsonService.unregisterCallback(SearchPrinterScr.this.mCallback);
- } catch (RemoteException e) {
- e.printStackTrace();
- }
- IEpsonService unused = SearchPrinterScr.this.mEpsonService = null;
- }
- public void onServiceConnected(ComponentName componentName, IBinder iBinder) {
- IEpsonService unused = SearchPrinterScr.this.mEpsonService = IEpsonService.Stub.asInterface(iBinder);
- if (SearchPrinterScr.this.mEpsonService != null) {
- try {
- SearchPrinterScr.this.mEpsonService.registerCallback(SearchPrinterScr.this.mCallback);
- } catch (RemoteException e) {
- e.printStackTrace();
- }
- }
- }
- };
- /* access modifiers changed from: private */
- public IEpsonService mEpsonService = null;
- Handler mHandler = new Handler(new Handler.Callback() {
- /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r10v46, resolved type: java.lang.Object} */
- /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r2v22, resolved type: epson.print.MyPrinter} */
- /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r10v60, resolved type: java.lang.Object} */
- /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r2v29, resolved type: epson.print.MyPrinter} */
- /* JADX WARNING: Multi-variable type inference failed */
- /* Code decompiled incorrectly, please refer to instructions dump. */
- public boolean handleMessage(android.os.Message r10) {
- /*
- r9 = this;
- int r0 = r10.what
- r1 = 8
- r2 = 0
- r3 = -1
- r4 = 0
- r5 = 1
- switch(r0) {
- case 1: goto L_0x036b;
- case 2: goto L_0x0365;
- case 3: goto L_0x02c1;
- case 4: goto L_0x0247;
- case 5: goto L_0x0219;
- case 6: goto L_0x000b;
- case 7: goto L_0x0166;
- case 8: goto L_0x0122;
- case 9: goto L_0x00c6;
- case 10: goto L_0x000b;
- case 11: goto L_0x0080;
- case 12: goto L_0x0036;
- case 13: goto L_0x002b;
- case 14: goto L_0x000d;
- default: goto L_0x000b;
- }
- L_0x000b:
- goto L_0x0379
- L_0x000d:
- epson.print.screen.SearchPrinterScr r10 = epson.print.screen.SearchPrinterScr.this
- android.os.Handler r0 = r10.mHandler
- r1 = 9
- r2 = 60
- com.epson.mobilephone.common.wifidirect.SearchWiFiDirectPrinterTask r0 = com.epson.mobilephone.common.wifidirect.WiFiDirectManager.searchWiFiDirectPrinter(r10, r0, r1, r2)
- com.epson.mobilephone.common.wifidirect.SearchWiFiDirectPrinterTask unused = r10.searchWiFiDirectPrinter = r0
- epson.print.screen.SearchPrinterScr r10 = epson.print.screen.SearchPrinterScr.this
- com.epson.mobilephone.common.wifidirect.SearchWiFiDirectPrinterTask r10 = r10.searchWiFiDirectPrinter
- if (r10 != 0) goto L_0x0379
- epson.print.screen.SearchPrinterScr r10 = epson.print.screen.SearchPrinterScr.this
- boolean unused = r10.isSearchSimpleAp = r4
- goto L_0x0379
- L_0x002b:
- epson.print.screen.SearchPrinterScr r10 = epson.print.screen.SearchPrinterScr.this
- android.support.v4.app.DialogFragment r0 = r10.getPrinterNotFoundDialog()
- r10.showPrinterNotFoundDialog(r0)
- goto L_0x0379
- L_0x0036:
- epson.print.screen.SearchPrinterScr r0 = epson.print.screen.SearchPrinterScr.this
- java.lang.Object r10 = r10.obj
- epson.print.MyPrinter r10 = (epson.print.MyPrinter) r10
- epson.print.MyPrinter unused = r0.selectedPrinter = r10
- epson.print.screen.SearchPrinterScr r10 = epson.print.screen.SearchPrinterScr.this
- epson.print.MyPrinter unused = r10.probedPrinter = r2
- epson.print.screen.SearchPrinterScr r10 = epson.print.screen.SearchPrinterScr.this
- epson.print.screen.WorkingDialog r10 = r10.progress
- if (r10 != 0) goto L_0x0053
- epson.print.screen.SearchPrinterScr r10 = epson.print.screen.SearchPrinterScr.this
- epson.print.screen.WorkingDialog r0 = new epson.print.screen.WorkingDialog
- r0.<init>(r10)
- r10.progress = r0
- L_0x0053:
- epson.print.screen.SearchPrinterScr r10 = epson.print.screen.SearchPrinterScr.this
- epson.print.screen.WorkingDialog r10 = r10.progress
- r10.show()
- epson.print.screen.SearchPrinterScr r10 = epson.print.screen.SearchPrinterScr.this // Catch:{ RemoteException -> 0x007a }
- epson.print.service.IEpsonService r10 = r10.mEpsonService // Catch:{ RemoteException -> 0x007a }
- epson.print.screen.SearchPrinterScr r0 = epson.print.screen.SearchPrinterScr.this // Catch:{ RemoteException -> 0x007a }
- epson.print.MyPrinter r0 = r0.selectedPrinter // Catch:{ RemoteException -> 0x007a }
- java.lang.String r0 = r0.getPrinterId() // Catch:{ RemoteException -> 0x007a }
- epson.print.screen.SearchPrinterScr r1 = epson.print.screen.SearchPrinterScr.this // Catch:{ RemoteException -> 0x007a }
- epson.print.MyPrinter r1 = r1.selectedPrinter // Catch:{ RemoteException -> 0x007a }
- java.lang.String r1 = r1.getIp() // Catch:{ RemoteException -> 0x007a }
- r2 = 2
- r10.searchPrinters(r0, r1, r2) // Catch:{ RemoteException -> 0x007a }
- goto L_0x0379
- L_0x007a:
- r10 = move-exception
- r10.printStackTrace()
- goto L_0x0379
- L_0x0080:
- epson.print.screen.SearchPrinterScr r0 = epson.print.screen.SearchPrinterScr.this
- r0.interruptSearch()
- java.lang.Object r0 = r10.obj
- if (r0 == 0) goto L_0x008e
- java.lang.Object r10 = r10.obj
- r2 = r10
- epson.print.MyPrinter r2 = (epson.print.MyPrinter) r2
- L_0x008e:
- android.content.Intent r10 = new android.content.Intent
- epson.print.screen.SearchPrinterScr r0 = epson.print.screen.SearchPrinterScr.this
- java.lang.Class<epson.print.screen.ActivityIpPrinterSetting> r1 = epson.print.screen.ActivityIpPrinterSetting.class
- r10.<init>(r0, r1)
- android.os.Bundle r0 = new android.os.Bundle
- r0.<init>()
- if (r2 == 0) goto L_0x00ae
- java.lang.String r1 = r2.getIp()
- if (r1 == 0) goto L_0x00ae
- java.lang.String r1 = "PRINTER_KEY"
- java.lang.String r2 = r2.getPrinterId()
- r0.putString(r1, r2)
- goto L_0x00b5
- L_0x00ae:
- java.lang.String r1 = "PRINTER_IP"
- java.lang.String r2 = ""
- r0.putString(r1, r2)
- L_0x00b5:
- epson.print.screen.SearchPrinterScr r1 = epson.print.screen.SearchPrinterScr.this
- int unused = r1.mDeletePos = r3
- r10.putExtras(r0)
- epson.print.screen.SearchPrinterScr r0 = epson.print.screen.SearchPrinterScr.this
- r1 = 11
- r0.startActivityForResult(r10, r1)
- goto L_0x0379
- L_0x00c6:
- android.os.Bundle r10 = r10.getData()
- if (r10 == 0) goto L_0x00f7
- boolean r0 = r10.isEmpty()
- if (r0 != 0) goto L_0x00f7
- java.lang.String r0 = "ssid"
- java.lang.String r0 = r10.getString(r0)
- java.lang.String r1 = "name"
- java.lang.String r1 = r10.getString(r1)
- java.lang.String r2 = "addr_infra"
- java.lang.String r10 = r10.getString(r2)
- if (r1 != 0) goto L_0x00e7
- r1 = r0
- L_0x00e7:
- epson.print.MyPrinter r2 = new epson.print.MyPrinter
- java.lang.String r3 = ""
- r2.<init>(r1, r0, r10, r3)
- epson.print.screen.SearchPrinterScr r1 = epson.print.screen.SearchPrinterScr.this
- com.epson.mobilephone.common.wifidirect.WiFiDirectPrinterListUtils r1 = r1.wiFiDirectPrinterListUtils
- r1.addPrinter(r2, r4, r0, r10)
- goto L_0x0379
- L_0x00f7:
- epson.print.screen.SearchPrinterScr r10 = epson.print.screen.SearchPrinterScr.this
- boolean unused = r10.isSearchSimpleAp = r4
- epson.print.screen.SearchPrinterScr r10 = epson.print.screen.SearchPrinterScr.this
- boolean r10 = r10.isFinishSearchPrinter
- if (r10 == 0) goto L_0x0379
- epson.print.screen.SearchPrinterScr r10 = epson.print.screen.SearchPrinterScr.this
- r10.displaySearchResult()
- epson.print.screen.SearchPrinterScr r10 = epson.print.screen.SearchPrinterScr.this
- epson.print.widgets.AbstractListBuilder r10 = r10.mBuilder
- java.util.Vector r10 = r10.getData()
- int r10 = r10.size()
- if (r10 != 0) goto L_0x0379
- epson.print.screen.SearchPrinterScr r10 = epson.print.screen.SearchPrinterScr.this
- android.os.Handler r10 = r10.mHandler
- r0 = 13
- r10.sendEmptyMessage(r0)
- goto L_0x0379
- L_0x0122:
- epson.print.screen.SearchPrinterScr r0 = epson.print.screen.SearchPrinterScr.this
- r0.interruptSearch()
- java.lang.Object r0 = r10.obj
- if (r0 == 0) goto L_0x0130
- java.lang.Object r10 = r10.obj
- r2 = r10
- epson.print.MyPrinter r2 = (epson.print.MyPrinter) r2
- L_0x0130:
- android.content.Intent r10 = new android.content.Intent
- epson.print.screen.SearchPrinterScr r0 = epson.print.screen.SearchPrinterScr.this
- java.lang.Class<epson.print.screen.ActivityPrinterSetting> r5 = epson.print.screen.ActivityPrinterSetting.class
- r10.<init>(r0, r5)
- android.os.Bundle r0 = new android.os.Bundle
- r0.<init>()
- if (r2 == 0) goto L_0x0150
- java.lang.String r5 = r2.getEmailAddress()
- if (r5 == 0) goto L_0x0150
- java.lang.String r5 = "PRINTER_EMAIL_ADDRESS"
- java.lang.String r2 = r2.getEmailAddress()
- r0.putString(r5, r2)
- goto L_0x0157
- L_0x0150:
- java.lang.String r2 = "PRINTER_EMAIL_ADDRESS"
- java.lang.String r5 = ""
- r0.putString(r2, r5)
- L_0x0157:
- epson.print.screen.SearchPrinterScr r2 = epson.print.screen.SearchPrinterScr.this
- int unused = r2.mDeletePos = r3
- r10.putExtras(r0)
- epson.print.screen.SearchPrinterScr r0 = epson.print.screen.SearchPrinterScr.this
- r0.startActivityForResult(r10, r1)
- goto L_0x0379
- L_0x0166:
- epson.print.screen.SearchPrinterScr r10 = epson.print.screen.SearchPrinterScr.this
- int r10 = r10.mDeletePos
- if (r10 < 0) goto L_0x0379
- epson.print.screen.SearchPrinterScr r10 = epson.print.screen.SearchPrinterScr.this
- int r10 = r10.printer_location
- switch(r10) {
- case 2: goto L_0x01bc;
- case 3: goto L_0x0179;
- default: goto L_0x0177;
- }
- L_0x0177:
- goto L_0x01fe
- L_0x0179:
- epson.print.EPPrinterManager r10 = new epson.print.EPPrinterManager
- epson.print.screen.SearchPrinterScr r0 = epson.print.screen.SearchPrinterScr.this
- android.content.Context r0 = r0.mContext
- r10.<init>(r0)
- epson.print.screen.SearchPrinterScr r0 = epson.print.screen.SearchPrinterScr.this
- epson.print.widgets.AbstractListBuilder r0 = r0.mBuilder
- java.util.Vector r0 = r0.getData()
- epson.print.screen.SearchPrinterScr r2 = epson.print.screen.SearchPrinterScr.this
- int r2 = r2.mDeletePos
- java.lang.Object r0 = r0.elementAt(r2)
- epson.print.MyPrinter r0 = (epson.print.MyPrinter) r0
- java.lang.String r0 = r0.getPrinterId()
- r10.deleteIpPrinterInfo(r0)
- epson.print.screen.SearchPrinterScr r10 = epson.print.screen.SearchPrinterScr.this
- epson.print.widgets.AbstractListBuilder r10 = r10.mBuilder
- android.widget.BaseAdapter r10 = r10.getAdapter()
- epson.print.screen.SearchPrinterScr r0 = epson.print.screen.SearchPrinterScr.this
- epson.print.widgets.AbstractListBuilder r0 = r0.mBuilder
- java.util.Vector r0 = r0.getData()
- epson.print.screen.SearchPrinterScr r2 = epson.print.screen.SearchPrinterScr.this
- int r2 = r2.mDeletePos
- r0.remove(r2)
- r10.notifyDataSetChanged()
- goto L_0x01fe
- L_0x01bc:
- epson.print.EPPrinterManager r10 = new epson.print.EPPrinterManager
- epson.print.screen.SearchPrinterScr r0 = epson.print.screen.SearchPrinterScr.this
- android.content.Context r0 = r0.mContext
- r10.<init>(r0)
- epson.print.screen.SearchPrinterScr r0 = epson.print.screen.SearchPrinterScr.this
- epson.print.widgets.AbstractListBuilder r0 = r0.mBuilder
- java.util.Vector r0 = r0.getData()
- epson.print.screen.SearchPrinterScr r2 = epson.print.screen.SearchPrinterScr.this
- int r2 = r2.mDeletePos
- java.lang.Object r0 = r0.elementAt(r2)
- epson.print.MyPrinter r0 = (epson.print.MyPrinter) r0
- java.lang.String r0 = r0.getEmailAddress()
- r10.deleteRemotePrinterInfo(r0)
- epson.print.screen.SearchPrinterScr r10 = epson.print.screen.SearchPrinterScr.this
- epson.print.widgets.AbstractListBuilder r10 = r10.mBuilder
- android.widget.BaseAdapter r10 = r10.getAdapter()
- epson.print.screen.SearchPrinterScr r0 = epson.print.screen.SearchPrinterScr.this
- epson.print.widgets.AbstractListBuilder r0 = r0.mBuilder
- java.util.Vector r0 = r0.getData()
- epson.print.screen.SearchPrinterScr r2 = epson.print.screen.SearchPrinterScr.this
- int r2 = r2.mDeletePos
- r0.remove(r2)
- r10.notifyDataSetChanged()
- L_0x01fe:
- epson.print.screen.SearchPrinterScr r10 = epson.print.screen.SearchPrinterScr.this
- r10.displaySearchResult()
- epson.print.screen.SearchPrinterScr r10 = epson.print.screen.SearchPrinterScr.this
- int r10 = r10.printer_location
- if (r10 == r5) goto L_0x0212
- epson.print.screen.SearchPrinterScr r10 = epson.print.screen.SearchPrinterScr.this
- android.widget.Button r10 = r10.mSearchButton
- r10.setVisibility(r1)
- L_0x0212:
- epson.print.screen.SearchPrinterScr r10 = epson.print.screen.SearchPrinterScr.this
- int unused = r10.mDeletePos = r3
- goto L_0x0379
- L_0x0219:
- epson.print.screen.SearchPrinterScr r10 = epson.print.screen.SearchPrinterScr.this
- boolean r10 = r10.isDialogOpen
- if (r10 != 0) goto L_0x0379
- epson.print.screen.SearchPrinterScr r10 = epson.print.screen.SearchPrinterScr.this
- boolean unused = r10.isDialogOpen = r5
- java.lang.String r10 = "SearchPrinterScr"
- java.lang.StringBuilder r0 = new java.lang.StringBuilder
- r0.<init>()
- java.lang.String r1 = "mHandler curError = "
- r0.append(r1)
- epson.print.screen.SearchPrinterScr r1 = epson.print.screen.SearchPrinterScr.this
- int r1 = r1.curError
- r0.append(r1)
- java.lang.String r0 = r0.toString()
- epson.print.Util.EPLog.m313i(r10, r0)
- epson.print.screen.SearchPrinterScr r10 = epson.print.screen.SearchPrinterScr.this
- r10.showDialog(r4)
- goto L_0x0379
- L_0x0247:
- epson.print.screen.SearchPrinterScr r0 = epson.print.screen.SearchPrinterScr.this
- boolean r0 = r0.isFinishSearchPrinter
- if (r0 != 0) goto L_0x0257
- epson.print.screen.SearchPrinterScr r0 = epson.print.screen.SearchPrinterScr.this
- epson.print.service.IEpsonService r0 = r0.mEpsonService
- if (r0 != 0) goto L_0x025f
- L_0x0257:
- epson.print.screen.SearchPrinterScr r0 = epson.print.screen.SearchPrinterScr.this
- boolean r0 = r0.isSearchSimpleAp
- if (r0 == 0) goto L_0x0282
- L_0x025f:
- java.lang.String r0 = "SearchPrinterScr"
- java.lang.String r1 = "cancelSearch for SELECT_PRINTER"
- epson.print.Util.EPLog.m313i(r0, r1)
- epson.print.screen.SearchPrinterScr r0 = epson.print.screen.SearchPrinterScr.this
- r0.interruptSearch()
- epson.print.screen.SearchPrinterScr r0 = epson.print.screen.SearchPrinterScr.this
- android.os.Handler r0 = r0.mHandler
- int r1 = r10.what
- java.lang.Object r10 = r10.obj
- android.os.Message r10 = r0.obtainMessage(r1, r10)
- epson.print.screen.SearchPrinterScr r0 = epson.print.screen.SearchPrinterScr.this
- android.os.Handler r0 = r0.mHandler
- r1 = 200(0xc8, double:9.9E-322)
- r0.sendMessageDelayed(r10, r1)
- goto L_0x0379
- L_0x0282:
- java.lang.Object r10 = r10.obj
- epson.print.MyPrinter r10 = (epson.print.MyPrinter) r10
- android.content.Intent r0 = new android.content.Intent
- r0.<init>()
- java.lang.String r1 = "myprinter"
- r0.putExtra(r1, r10)
- epson.print.screen.SearchPrinterScr r1 = epson.print.screen.SearchPrinterScr.this
- int r1 = r1.printer_location
- if (r1 != r5) goto L_0x02ae
- epson.print.screen.SearchPrinterScr r1 = epson.print.screen.SearchPrinterScr.this
- java.lang.String r10 = r10.getPrinterId()
- java.lang.String r10 = com.epson.mobilephone.common.wifidirect.MacAddrUtils.getMacAddressFromPrinterId(r10)
- java.lang.String r10 = com.epson.mobilephone.common.wifidirect.WiFiDirectManager.getCurConnectInfo(r1, r10)
- if (r10 == 0) goto L_0x02b5
- java.lang.String r1 = "simpleap"
- r0.putExtra(r1, r10)
- goto L_0x02b5
- L_0x02ae:
- java.lang.String r10 = "simpleap"
- java.lang.String r1 = ""
- r0.putExtra(r10, r1)
- L_0x02b5:
- epson.print.screen.SearchPrinterScr r10 = epson.print.screen.SearchPrinterScr.this
- r10.setResult(r3, r0)
- epson.print.screen.SearchPrinterScr r10 = epson.print.screen.SearchPrinterScr.this
- r10.finish()
- goto L_0x0379
- L_0x02c1:
- android.os.Bundle r10 = r10.getData()
- java.lang.String r0 = "name"
- java.lang.String r0 = r10.getString(r0)
- if (r0 == 0) goto L_0x033f
- java.lang.String r1 = "FINISH"
- boolean r0 = r0.contentEquals(r1)
- if (r0 != 0) goto L_0x033f
- java.lang.Object r0 = epson.print.screen.SearchPrinterScr.mLock
- monitor-enter(r0)
- epson.print.screen.SearchPrinterScr r1 = epson.print.screen.SearchPrinterScr.this // Catch:{ all -> 0x033c }
- java.util.ArrayList r1 = r1.printerList // Catch:{ all -> 0x033c }
- java.lang.String r2 = "id"
- java.lang.String r2 = r10.getString(r2) // Catch:{ all -> 0x033c }
- boolean r1 = r1.contains(r2) // Catch:{ all -> 0x033c }
- if (r1 == 0) goto L_0x02ef
- monitor-exit(r0) // Catch:{ all -> 0x033c }
- goto L_0x0379
- L_0x02ef:
- epson.print.MyPrinter r1 = new epson.print.MyPrinter // Catch:{ all -> 0x033c }
- java.lang.String r2 = "name"
- java.lang.String r2 = r10.getString(r2) // Catch:{ all -> 0x033c }
- java.lang.String r6 = "ip"
- java.lang.String r6 = r10.getString(r6) // Catch:{ all -> 0x033c }
- java.lang.String r7 = "id"
- java.lang.String r7 = r10.getString(r7) // Catch:{ all -> 0x033c }
- java.lang.String r8 = "serial_no"
- java.lang.String r8 = r10.getString(r8) // Catch:{ all -> 0x033c }
- r1.<init>(r2, r6, r7, r8) // Catch:{ all -> 0x033c }
- java.lang.String r2 = "common_devicename"
- java.lang.String r2 = r10.getString(r2) // Catch:{ all -> 0x033c }
- r1.setCommonDeviceName(r2) // Catch:{ all -> 0x033c }
- epson.print.screen.SearchPrinterScr r2 = epson.print.screen.SearchPrinterScr.this // Catch:{ all -> 0x033c }
- com.epson.mobilephone.common.wifidirect.WiFiDirectPrinterListUtils r2 = r2.wiFiDirectPrinterListUtils // Catch:{ all -> 0x033c }
- java.lang.String r6 = r1.getIp() // Catch:{ all -> 0x033c }
- java.lang.String r7 = r1.getPrinterId() // Catch:{ all -> 0x033c }
- java.lang.String r7 = com.epson.mobilephone.common.wifidirect.MacAddrUtils.getMacAddressFromPrinterId(r7) // Catch:{ all -> 0x033c }
- r2.addPrinter(r1, r3, r6, r7) // Catch:{ all -> 0x033c }
- epson.print.screen.SearchPrinterScr r1 = epson.print.screen.SearchPrinterScr.this // Catch:{ all -> 0x033c }
- java.util.ArrayList r1 = r1.printerList // Catch:{ all -> 0x033c }
- java.lang.String r2 = "id"
- java.lang.String r10 = r10.getString(r2) // Catch:{ all -> 0x033c }
- r1.add(r10) // Catch:{ all -> 0x033c }
- boolean unused = epson.print.screen.SearchPrinterScr.foundPrinter = r5 // Catch:{ all -> 0x033c }
- monitor-exit(r0) // Catch:{ all -> 0x033c }
- goto L_0x0379
- L_0x033c:
- r10 = move-exception
- monitor-exit(r0) // Catch:{ all -> 0x033c }
- throw r10
- L_0x033f:
- java.lang.Object r10 = epson.print.screen.SearchPrinterScr.mLock
- monitor-enter(r10)
- epson.print.screen.SearchPrinterScr r0 = epson.print.screen.SearchPrinterScr.this // Catch:{ all -> 0x0362 }
- boolean r0 = r0.isFinishSearchPrinter // Catch:{ all -> 0x0362 }
- if (r0 == 0) goto L_0x034e
- monitor-exit(r10) // Catch:{ all -> 0x0362 }
- goto L_0x0379
- L_0x034e:
- epson.print.screen.SearchPrinterScr r0 = epson.print.screen.SearchPrinterScr.this // Catch:{ all -> 0x0362 }
- boolean unused = r0.isFinishSearchPrinter = r5 // Catch:{ all -> 0x0362 }
- monitor-exit(r10) // Catch:{ all -> 0x0362 }
- epson.print.screen.SearchPrinterScr r10 = epson.print.screen.SearchPrinterScr.this
- boolean r10 = r10.isSearchSimpleAp
- if (r10 != 0) goto L_0x0379
- epson.print.screen.SearchPrinterScr r10 = epson.print.screen.SearchPrinterScr.this
- r10.displaySearchResult()
- goto L_0x0379
- L_0x0362:
- r0 = move-exception
- monitor-exit(r10) // Catch:{ all -> 0x0362 }
- throw r0
- L_0x0365:
- epson.print.screen.SearchPrinterScr r10 = epson.print.screen.SearchPrinterScr.this
- r10.interruptSearch()
- goto L_0x0379
- L_0x036b:
- epson.print.screen.SearchPrinterScr r10 = epson.print.screen.SearchPrinterScr.this
- int r10 = r10.printer_location
- if (r10 == r5) goto L_0x0374
- goto L_0x0379
- L_0x0374:
- epson.print.screen.SearchPrinterScr r10 = epson.print.screen.SearchPrinterScr.this
- r10.search()
- L_0x0379:
- return r4
- */
- throw new UnsupportedOperationException("Method not decompiled: epson.print.screen.SearchPrinterScr.C234613.handleMessage(android.os.Message):boolean");
- }
- });
- RadioButton mIpButton;
- boolean mIsClickSelect = false;
- ViewGroup mLayout;
- private TextView mListEmptyMessageTextView;
- /* access modifiers changed from: private */
- public ListView mListView;
- RadioButton mLocalButton;
- ProgressBar mProgressBar;
- RadioButton mRemoteButton;
- Button mSearchButton;
- TextView mTextDetail;
- View mWiFiSettingButton;
- private String printerEmailAddress = "";
- private String printerId = "";
- private String printerKey = "";
- /* access modifiers changed from: private */
- public ArrayList<String> printerList = new ArrayList<>();
- /* access modifiers changed from: private */
- public volatile int printer_location = 0;
- /* access modifiers changed from: private */
- public MyPrinter probedPrinter = null;
- WorkingDialog progress;
- /* access modifiers changed from: private */
- public SearchWiFiDirectPrinterTask searchWiFiDirectPrinter = null;
- /* access modifiers changed from: private */
- public MyPrinter selectedPrinter = null;
- WiFiDirectPrinterListUtils wiFiDirectPrinterListUtils = null;
- /* access modifiers changed from: protected */
- public void onCreate(Bundle bundle) {
- super.onCreate(bundle);
- if (Locale.getDefault().getLanguage().equalsIgnoreCase(Locale.JAPAN.getLanguage()) || Locale.getDefault().getLanguage().equalsIgnoreCase(Locale.JAPANESE.getLanguage())) {
- this.isJapaneseLocale = true;
- } else {
- this.isJapaneseLocale = false;
- }
- if (this.mEpsonService == null) {
- bindService(new Intent(this, EpsonService.class), this.mEpsonConnection, 1);
- }
- this.mLayout = (ViewGroup) getLayoutInflater().inflate(R.layout.search_printer_layout, (ViewGroup) null);
- addWiFiSetupButton();
- addAboutRemoteButton();
- this.mListEmptyMessageTextView = (TextView) this.mLayout.findViewById(R.id.list_empty_message);
- this.mListView = (ListView) this.mLayout.findViewById(16908298);
- Intent intent = getIntent();
- this.printer_location = intent.getIntExtra(Constants.PRINTER_LOCATION, 1);
- if (this.printer_location == 0) {
- this.printer_location = 1;
- }
- switch (this.printer_location) {
- case 2:
- this.printerEmailAddress = intent.getStringExtra(Constants.PRINTER_EMAIL_ADDRESS);
- break;
- case 3:
- this.printerKey = intent.getStringExtra(Constants.PRINTER_ID);
- break;
- default:
- this.printerId = intent.getStringExtra(Constants.PRINTER_ID);
- this.connectionInfo = intent.getStringExtra(EXTRA_SIMPLEAP);
- break;
- }
- buildElements();
- setContentView((View) this.mLayout);
- this.mContext = this;
- this.mIsClickSelect = false;
- if (this.printer_location != 1) {
- displaySearchResult();
- this.mSearchButton.setVisibility(8);
- ((TextView) this.mLayout.findViewById(R.id.empty)).setVisibility(8);
- }
- setNotFoundPrinterButton();
- setBleWifiSetupButton();
- setActionBar((int) R.string.title_addprint, true);
- }
- private void setBleWifiSetupButton() {
- this.mLayout.findViewById(R.id.ble_wifi_setting).setVisibility(8);
- }
- private void setNotFoundPrinterButton() {
- this.mLayout.findViewById(R.id.not_found_printer_epsonsn).setOnClickListener(new View.OnClickListener() {
- public void onClick(View view) {
- SearchPrinterScr searchPrinterScr = SearchPrinterScr.this;
- searchPrinterScr.startActivity(PrinterNotFoundDialogCreator.getStartIntent(searchPrinterScr.getApplicationContext()));
- }
- });
- }
- private void addWiFiSetupButton() {
- this.mWiFiSettingButton = this.mLayout.findViewById(R.id.rlWifiSettings);
- if (this.isJapaneseLocale) {
- ((TextView) this.mWiFiSettingButton).setText(R.string.str_goto_wifidirect_settings);
- } else {
- ((TextView) this.mWiFiSettingButton).setText(R.string.str_wifidirect_settings);
- }
- this.mWiFiSettingButton.setOnClickListener(new View.OnClickListener() {
- public void onClick(View view) {
- SearchPrinterScr.this.startWifiPrinterSelect();
- }
- });
- }
- /* access modifiers changed from: private */
- public void startWifiPrinterSelect() {
- startActivityForResult(new Intent(this, ActivityWiFiDirectStart.class), 10);
- }
- private void addAboutRemoteButton() {
- this.mAboutRemoteButton = this.mLayout.findViewById(R.id.AboutRemoteFrame);
- this.mAboutRemoteButton.setOnClickListener(new View.OnClickListener() {
- public void onClick(View view) {
- SearchPrinterScr.this.startActivity(new Intent("android.intent.action.VIEW", Uri.parse("https://www.epsonconnect.com/iguide/")));
- }
- });
- }
- /* access modifiers changed from: private */
- public void buildElements() {
- this.mSearchButton = (Button) this.mLayout.findViewById(R.id.function_button);
- this.mProgressBar = (ProgressBar) this.mLayout.findViewById(R.id.progress_bar);
- this.mAddButton = (Button) this.mLayout.findViewById(R.id.edit_button);
- this.mTextDetail = (TextView) this.mLayout.findViewById(R.id.detail);
- searchButtonSetEnabled(false);
- this.mProgressBar.setVisibility(0);
- this.mAddButton.setVisibility(8);
- this.mTextDetail.setVisibility(0);
- this.mWiFiSettingButton.setVisibility(0);
- this.mLocalButton = (RadioButton) this.mLayout.findViewById(R.id.btn_local);
- this.mIpButton = (RadioButton) this.mLayout.findViewById(R.id.btn_ip);
- this.mRemoteButton = (RadioButton) this.mLayout.findViewById(R.id.btn_remote);
- Utils.setDrawble2TextView(this, this.mLocalButton, R.C2136drawable.printer_selector_icon_local);
- Utils.setDrawble2TextView(this, this.mIpButton, R.C2136drawable.printer_selector_icon_ip);
- Utils.setDrawble2TextView(this, this.mRemoteButton, R.C2136drawable.printer_selector_icon_remote);
- TextView textView = null;
- switch (this.printer_location) {
- case 1:
- this.mListView.setEmptyView((View) null);
- this.mListEmptyMessageTextView.setText((CharSequence) null);
- this.mListEmptyMessageTextView.setVisibility(8);
- this.mBuilder = new PrinterInfoBuilder(getBaseContext(), this.mLayout, 0);
- this.mBuilder.setResource(WiFiDirectPrinterListUtils.getCurPrinterString(this, this.printerId, this.connectionInfo));
- this.helper = new ListControlHelper((PrinterInfoBuilder) this.mBuilder);
- this.wiFiDirectPrinterListUtils = new WiFiDirectPrinterListUtils(this, this.mBuilder.getData(), this.helper, this.connectionInfo);
- this.mLocalButton.setChecked(true);
- this.mTextDetail.setText(R.string.str_detailtext_local);
- this.mLayout.findViewById(R.id.not_found_printer_epsonsn).setVisibility(0);
- break;
- case 2:
- this.mAddButton.setVisibility(0);
- this.mListEmptyMessageTextView.setText(R.string.printer_list_empty_message);
- textView = this.mListEmptyMessageTextView;
- this.mBuilder = new PrinterInfoECBuilder(getBaseContext(), this.mLayout);
- this.mBuilder.setResource(this.printerEmailAddress);
- this.mRemoteButton.setChecked(true);
- this.mTextDetail.setText(R.string.str_detailtext_remote);
- this.mSearchButton.setVisibility(8);
- this.mLayout.findViewById(R.id.not_found_printer_epsonsn).setVisibility(8);
- this.mWiFiSettingButton.setVisibility(8);
- break;
- case 3:
- this.mAddButton.setVisibility(0);
- this.mListEmptyMessageTextView.setText(R.string.printer_list_empty_message);
- textView = this.mListEmptyMessageTextView;
- this.mBuilder = new PrinterInfoIpBuilder(getBaseContext(), this.mLayout, 0);
- this.mBuilder.setResource(this.printerKey);
- this.mIpButton.setChecked(true);
- this.mTextDetail.setText(R.string.str_detailtext_ip);
- this.mSearchButton.setVisibility(8);
- this.mLayout.findViewById(R.id.not_found_printer_epsonsn).setVisibility(8);
- this.mWiFiSettingButton.setVisibility(8);
- break;
- }
- this.mBuilder.build();
- this.mBuilder.refresh();
- this.mListView.setEmptyView(textView);
- if (this.printer_location == 2) {
- this.mAboutRemoteButton.setVisibility(0);
- } else {
- this.mAboutRemoteButton.setVisibility(8);
- }
- this.mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
- public void onItemClick(AdapterView<?> adapterView, View view, int i, long j) {
- if (SearchPrinterScr.this.isFocused.booleanValue()) {
- Boolean unused = SearchPrinterScr.this.isFocused = false;
- SearchPrinterScr searchPrinterScr = SearchPrinterScr.this;
- searchPrinterScr.mIsClickSelect = true;
- Message obtainMessage = searchPrinterScr.mHandler.obtainMessage();
- obtainMessage.obj = SearchPrinterScr.this.mBuilder.getData().elementAt(i);
- int access$200 = SearchPrinterScr.this.printer_location;
- if (access$200 == 1) {
- String ip = ((MyPrinter) obtainMessage.obj).getIp();
- if (!WiFiControl.ConnectType.NONE.equals(WiFiDirectManager.getConnectType(SearchPrinterScr.this, ip))) {
- SearchPrinterScr.this.interruptSearch();
- WiFiDirectManager.connect(SearchPrinterScr.this, ip, 10);
- } else {
- obtainMessage.what = 4;
- }
- } else if (access$200 != 3) {
- obtainMessage.what = 4;
- } else {
- obtainMessage.what = 12;
- }
- SearchPrinterScr.this.mHandler.sendMessageDelayed(obtainMessage, 100);
- }
- }
- });
- this.mListView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
- public boolean onItemLongClick(AdapterView<?> adapterView, View view, int i, long j) {
- if (SearchPrinterScr.this.printer_location == 1) {
- return true;
- }
- int unused = SearchPrinterScr.this.mDeletePos = i;
- SearchPrinterScr searchPrinterScr = SearchPrinterScr.this;
- searchPrinterScr.registerForContextMenu(searchPrinterScr.mListView);
- return false;
- }
- });
- this.mAddButton.setOnClickListener(new View.OnClickListener() {
- public void onClick(View view) {
- switch (SearchPrinterScr.this.printer_location) {
- case 2:
- if (SearchPrinterScr.this.mBuilder.getData().size() >= 32) {
- new AlertDialog.Builder(SearchPrinterScr.this.mContext).setCancelable(false).setTitle(SearchPrinterScr.this.getString(R.string.epsonconnect_err_regist_remote_printer_max_size_title)).setMessage(SearchPrinterScr.this.getString(R.string.epsonconnect_err_regist_remote_printer_max_size)).setPositiveButton(SearchPrinterScr.this.getString(R.string.str_yes), new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialogInterface, int i) {
- }
- }).show();
- return;
- } else if (SearchPrinterScr.this.getSharedPreferences(Constants.PREFS_EPSON_CONNECT, 0).getBoolean(Constants.ENABLE_SHOW_WARNING, true)) {
- AlertDialog.Builder cancelable = new AlertDialog.Builder(SearchPrinterScr.this.mContext).setCancelable(false);
- cancelable.setMessage(SearchPrinterScr.this.getString(R.string.epsonconnect_str_remote_print_warning) + "\n\n" + SearchPrinterScr.this.getString(R.string.epsonconnect_str_remote_print_warning2)).setPositiveButton(SearchPrinterScr.this.getString(R.string.str_yes), new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialogInterface, int i) {
- Message message = new Message();
- message.what = 8;
- message.obj = null;
- SearchPrinterScr.this.mHandler.sendMessage(message);
- }
- }).setNegativeButton(SearchPrinterScr.this.getString(R.string.str_no), new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialogInterface, int i) {
- }
- }).show();
- return;
- } else {
- Message message = new Message();
- message.what = 8;
- message.obj = null;
- SearchPrinterScr.this.mHandler.sendMessage(message);
- return;
- }
- case 3:
- if (SearchPrinterScr.this.mBuilder.getData().size() >= 32) {
- new AlertDialog.Builder(SearchPrinterScr.this.mContext).setCancelable(false).setTitle(SearchPrinterScr.this.getString(R.string.epsonconnect_err_regist_remote_printer_max_size_title)).setMessage(SearchPrinterScr.this.getString(R.string.epsonconnect_err_regist_remote_printer_max_size)).setPositiveButton(SearchPrinterScr.this.getString(R.string.str_yes), new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialogInterface, int i) {
- }
- }).show();
- return;
- }
- Message message2 = new Message();
- message2.what = 11;
- message2.obj = null;
- SearchPrinterScr.this.mHandler.sendMessage(message2);
- return;
- default:
- return;
- }
- }
- });
- this.mSearchButton.setOnClickListener(new View.OnClickListener() {
- public void onClick(View view) {
- if (SearchPrinterScr.this.printer_location == 1) {
- SearchPrinterScr.this.mHandler.sendEmptyMessageDelayed(1, 100);
- }
- }
- });
- this.mLocalButton.setOnClickListener(new View.OnClickListener() {
- public void onClick(View view) {
- if (SearchPrinterScr.this.printer_location != 1) {
- SearchPrinterScr.this.mAddButton.setVisibility(8);
- ((TextView) SearchPrinterScr.this.mLayout.findViewById(R.id.empty)).setVisibility(0);
- SearchPrinterScr.this.interruptSearch();
- int unused = SearchPrinterScr.this.printer_location = 1;
- SearchPrinterScr.this.buildElements();
- SearchPrinterScr.this.mHandler.sendEmptyMessageDelayed(1, 100);
- }
- }
- });
- this.mRemoteButton.setOnClickListener(new View.OnClickListener() {
- public void onClick(View view) {
- if (SearchPrinterScr.this.printer_location != 2) {
- int unused = SearchPrinterScr.this.printer_location = 2;
- SearchPrinterScr.this.interruptSearch();
- ((TextView) SearchPrinterScr.this.mLayout.findViewById(R.id.empty)).setVisibility(8);
- SearchPrinterScr.this.mBuilder.refresh();
- SearchPrinterScr.this.buildElements();
- SearchPrinterScr.this.displaySearchResult();
- SearchPrinterScr.this.mSearchButton.setVisibility(8);
- }
- }
- });
- this.mIpButton.setOnClickListener(new View.OnClickListener() {
- public void onClick(View view) {
- if (SearchPrinterScr.this.printer_location != 3) {
- int unused = SearchPrinterScr.this.printer_location = 3;
- SearchPrinterScr.this.interruptSearch();
- ((TextView) SearchPrinterScr.this.mLayout.findViewById(R.id.empty)).setVisibility(8);
- SearchPrinterScr.this.mBuilder.refresh();
- SearchPrinterScr.this.buildElements();
- SearchPrinterScr.this.displaySearchResult();
- SearchPrinterScr.this.mSearchButton.setVisibility(8);
- }
- }
- });
- }
- public void onCreateContextMenu(ContextMenu contextMenu, View view, ContextMenu.ContextMenuInfo contextMenuInfo) {
- super.onCreateContextMenu(contextMenu, view, contextMenuInfo);
- contextMenu.setHeaderTitle(R.string.str_edit_bookmark);
- contextMenu.add(0, 1, 0, R.string.str_delete);
- contextMenu.add(0, 2, 0, R.string.str_edit_bookmark);
- }
- public boolean onContextItemSelected(MenuItem menuItem) {
- this.listItemIndex = (AdapterView.AdapterContextMenuInfo) menuItem.getMenuInfo();
- if (this.listItemIndex == null) {
- return true;
- }
- switch (menuItem.getItemId()) {
- case 1:
- new AlertDialog.Builder(this.mContext).setCancelable(false).setTitle(getString(R.string.delete_file)).setIcon(getResources().getDrawable(R.C2136drawable.delete_file)).setNegativeButton(getString(R.string.str_ok), new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialogInterface, int i) {
- Message obtainMessage = SearchPrinterScr.this.mHandler.obtainMessage();
- obtainMessage.what = 7;
- SearchPrinterScr.this.mHandler.sendMessageDelayed(obtainMessage, 100);
- }
- }).setPositiveButton(getString(R.string.str_cancel), new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialogInterface, int i) {
- }
- }).show();
- break;
- case 2:
- Message message = new Message();
- switch (this.printer_location) {
- case 2:
- message.what = 8;
- break;
- case 3:
- message.what = 11;
- break;
- }
- message.obj = this.mBuilder.getData().elementAt(this.mDeletePos);
- this.mHandler.sendMessage(message);
- break;
- }
- return true;
- }
- /* access modifiers changed from: protected */
- public void onDestroy() {
- this.mBuilder.destructor();
- super.onDestroy();
- unbindEpsonService();
- }
- public void onBackPressed() {
- super.onBackPressed();
- interruptSearch();
- finish();
- }
- /* access modifiers changed from: protected */
- public void onResume() {
- super.onResume();
- EPLog.m305d(TAG, "onResume()");
- this.mActivityForegroundLifetime = true;
- dismissPrinterNotFoundDialog();
- if (this.printer_location == 1) {
- this.mHandler.sendEmptyMessageDelayed(1, 100);
- EPLog.m305d(TAG, "Send CHECK_PRINTER Message.");
- }
- }
- /* access modifiers changed from: protected */
- public void onPause() {
- EPLog.m305d(TAG, "onPause()");
- super.onPause();
- this.mActivityForegroundLifetime = false;
- interruptSearch();
- removeAllDialog();
- }
- /* access modifiers changed from: protected */
- public void onActivityResult(int i, int i2, Intent intent) {
- super.onActivityResult(i, i2, intent);
- interruptSearch();
- switch (i) {
- case 8:
- if (i2 == -1) {
- Intent intent2 = new Intent();
- intent2.putExtra(EXTRA_PRINTER, (MyPrinter) intent.getParcelableExtra(ActivityPrinterSetting.KEY_MYPRINTER));
- setResult(-1, intent2);
- finish();
- return;
- }
- return;
- case 10:
- if (i2 == -1) {
- MyPrinter myPrinter = new MyPrinter(intent.getStringExtra("name"), intent.getStringExtra(escprLib.PRINTER_IP), intent.getStringExtra("id"), intent.getStringExtra(escprLib.PRINTER_SERIAL_NO));
- Intent intent3 = new Intent();
- intent3.putExtra(EXTRA_PRINTER, myPrinter);
- String curConnectInfo = WiFiDirectManager.getCurConnectInfo(this, MacAddrUtils.getMacAddressFromPrinterId(myPrinter.getPrinterId()));
- if (this.printer_location != 1 || curConnectInfo == null) {
- intent3.putExtra(EXTRA_SIMPLEAP, "");
- } else {
- intent3.putExtra(EXTRA_SIMPLEAP, curConnectInfo);
- }
- intent.getBooleanExtra(ActivityiPrintConnect.FINISH_EAYSETUP, false);
- setResult(-1, intent3);
- finish();
- return;
- }
- this.isFocused = true;
- this.mIsClickSelect = false;
- return;
- case 11:
- if (i2 == -1) {
- MyPrinter myPrinter2 = new MyPrinter(intent.getStringExtra(Constants.PRINTER_NAME), intent.getStringExtra(Constants.PRINTER_IP), intent.getStringExtra(Constants.PRINTER_ID), intent.getStringExtra(Constants.PRINTER_SERIAL_NO), "", 3);
- Intent intent4 = new Intent();
- intent4.putExtra(EXTRA_PRINTER, myPrinter2);
- setResult(-1, intent4);
- finish();
- return;
- }
- return;
- default:
- return;
- }
- }
- /* access modifiers changed from: private */
- public void search() {
- interruptSearch();
- synchronized (mLock) {
- this.printerList.clear();
- this.mBuilder.refresh();
- this.wiFiDirectPrinterListUtils.clearPrinterInfoList();
- }
- this.mIsClickSelect = false;
- this.isFinishSearchPrinter = false;
- searchButtonSetEnabled(false);
- this.mProgressBar.setVisibility(0);
- ((TextView) this.mLayout.findViewById(R.id.empty)).setText(getString(R.string.searching_text));
- this.isFocused = true;
- if (WiFiDirectManager.getCurSSID(this) != null) {
- this.mHandler.sendEmptyMessageDelayed(14, 5000);
- this.isSearchSimpleAp = true;
- } else if (WiFiDirectManager.isWifiEnabled(this)) {
- this.mHandler.sendEmptyMessage(14);
- this.isSearchSimpleAp = true;
- } else {
- boolean z = this.bCheckWiFiStatus;
- if (!z && !z) {
- this.bCheckWiFiStatus = true;
- WiFiDirectManager.enableWiFi(this, -1);
- return;
- }
- }
- WiFiDirectManager.setPriorityToSimpleAP(this, true);
- if (this.mEpsonService != null) {
- try {
- synchronized (mLock) {
- this.isFinishSearchPrinter = false;
- }
- this.mEpsonService.searchPrinters((String) null, (String) null, 1);
- } catch (RemoteException e) {
- e.printStackTrace();
- }
- } else {
- this.mHandler.sendEmptyMessageDelayed(1, 100);
- }
- }
- /* access modifiers changed from: private */
- public void interruptSearch() {
- EPLog.m305d(TAG, "interruptSearch()");
- this.mHandler.removeMessages(1);
- this.mHandler.removeMessages(14);
- this.mHandler.removeMessages(3);
- this.mHandler.removeMessages(9);
- this.mHandler.removeMessages(13);
- SearchWiFiDirectPrinterTask searchWiFiDirectPrinterTask = this.searchWiFiDirectPrinter;
- if (searchWiFiDirectPrinterTask != null) {
- searchWiFiDirectPrinterTask.interrupt();
- this.searchWiFiDirectPrinter = null;
- }
- this.isSearchSimpleAp = false;
- IEpsonService iEpsonService = this.mEpsonService;
- if (iEpsonService != null) {
- try {
- iEpsonService.cancelSearchPrinter();
- } catch (RemoteException e) {
- e.printStackTrace();
- }
- }
- WorkingDialog workingDialog = this.progress;
- if (workingDialog != null && workingDialog.isShowing()) {
- this.progress.dismiss();
- }
- this.isFocused = true;
- }
- public void displaySearchResult() {
- if (!this.mIsClickSelect) {
- if (this.mBuilder.getData().size() <= 0) {
- ((TextView) this.mLayout.findViewById(R.id.empty)).setText(getString(R.string.EPS_PRNERR_COMM_TITLE1));
- } else if (Locale.getDefault().getLanguage().equalsIgnoreCase(Locale.JAPAN.getLanguage()) || Locale.getDefault().getLanguage().equalsIgnoreCase(Locale.JAPANESE.getLanguage())) {
- ((TextView) this.mLayout.findViewById(R.id.empty)).setText(getString(R.string.numberOfPrintersAvailable));
- } else {
- ((TextView) this.mLayout.findViewById(R.id.empty)).setText(String.format(getString(R.string.numberOfPrintersAvailable), new Object[]{Integer.valueOf(this.mBuilder.getData().size())}));
- }
- }
- this.mBuilder.getAdapter().notifyDataSetChanged();
- this.mProgressBar.setVisibility(8);
- searchButtonSetEnabled(true);
- this.isFinishSearchPrinter = true;
- }
- /* access modifiers changed from: private */
- public DialogFragment getPrinterNotFoundDialog() {
- String str;
- boolean prefBoolean = Utils.getPrefBoolean(getApplicationContext(), "PrintSetting", CommonDefine.RE_SEARCH);
- int i = R.string.EPS_PRNERR_COMM_TITLE4;
- if (prefBoolean) {
- this.curError = -11001;
- String ssid = Utils.getSSID(this);
- if (!Utils.isConnectedWifi(this) || ssid == null) {
- return CustomLayoutDialogFragment.newInstance(1, getString(R.string.EPS_PRNERR_COMM4), (int) R.string.EPS_PRNERR_COMM_TITLE4, 0, (int) R.string.str_btn_close);
- }
- str = String.format(getString(R.string.EPS_ERR_PRINTER_NOT_FOUND_RESEARCH2), new Object[]{ssid});
- } else {
- this.curError = -1100;
- i = R.string.EPS_PRNERR_COMM_TITLE1;
- str = getString(R.string.EPS_PRNERR_COMM1);
- }
- return CustomLayoutDialogFragment.newInstance(1, str + "\n\n" + getString(R.string.confirm_browse_wlan_setup_info), i, (int) R.string.browse_site, (int) R.string.str_btn_close);
- }
- /* access modifiers changed from: private */
- public void showPrinterNotFoundDialog(DialogFragment dialogFragment) {
- if (this.mActivityForegroundLifetime) {
- dialogFragment.show(getSupportFragmentManager(), DIALOG_TAG_PRINTER_NOT_FOUND);
- }
- }
- /* access modifiers changed from: protected */
- public Dialog onCreateDialog(int i) {
- if (i != 0) {
- return null;
- }
- EPLog.m313i(TAG, "DIALOG_INFORM curError = " + this.curError);
- int i2 = this.curError;
- if (i2 == -1100 || i2 == -11001) {
- if (Utils.getPrefBoolean(getApplicationContext(), "PrintSetting", CommonDefine.RE_SEARCH)) {
- this.curError = -11001;
- } else {
- this.curError = -1100;
- }
- }
- Integer[] stringId = MediaInfo.ErrorTable.getStringId(this.curError);
- if (stringId == null) {
- stringId = new Integer[]{Integer.valueOf(R.string.NOT_IMPLEMENT), Integer.valueOf(R.string.NOT_IMPLEMENT_TITLE)};
- }
- String string = getString(stringId[0].intValue());
- String ssid = Utils.getSSID(this);
- if (Utils.isConnectedWifi(this) && this.curError == -11001 && ssid != null) {
- string = String.format(getString(R.string.EPS_ERR_PRINTER_NOT_FOUND_RESEARCH), new Object[]{ssid});
- }
- return new CustomTitleAlertDialogBuilder(this).setTitle((CharSequence) getString(stringId[1].intValue())).setMessage(string).setCancelable(false).setNegativeButton(getString(R.string.str_ok), new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialogInterface, int i) {
- SearchPrinterScr.this.removeDialog(0);
- boolean unused = SearchPrinterScr.this.isDialogOpen = false;
- }
- }).create();
- }
- private void dismissPrinterNotFoundDialog() {
- DialogFragment dialogFragment = (DialogFragment) getSupportFragmentManager().findFragmentByTag(DIALOG_TAG_PRINTER_NOT_FOUND);
- if (dialogFragment != null) {
- dialogFragment.dismiss();
- }
- }
- /* access modifiers changed from: package-private */
- /* JADX WARNING: Failed to process nested try/catch */
- /* JADX WARNING: Missing exception handler attribute for start block: B:3:0x0004 */
- /* Code decompiled incorrectly, please refer to instructions dump. */
- public void removeAllDialog() {
- /*
- r1 = this;
- r0 = 0
- r1.removeDialog(r0) // Catch:{ IllegalArgumentException -> 0x0004 }
- L_0x0004:
- r1.dismissPrinterNotFoundDialog() // Catch:{ Exception -> 0x0007 }
- L_0x0007:
- return
- */
- throw new UnsupportedOperationException("Method not decompiled: epson.print.screen.SearchPrinterScr.removeAllDialog():void");
- }
- public void searchButtonSetEnabled(boolean z) {
- this.mSearchButton.setVisibility(0);
- if (z) {
- this.mSearchButton.setEnabled(true);
- } else {
- this.mSearchButton.setEnabled(false);
- }
- }
- private void unbindEpsonService() {
- if (this.mEpsonService != null) {
- if (!this.isFinishSearchPrinter) {
- this.mHandler.sendEmptyMessageDelayed(2, 200);
- }
- try {
- this.mEpsonService.unregisterCallback(this.mCallback);
- unbindService(this.mEpsonConnection);
- } catch (RemoteException e) {
- e.printStackTrace();
- }
- }
- }
- public void onLocalPositiveCallback(int i) {
- if (i == 1) {
- startActivity(PrinterNotFoundDialogCreator.getStartIntent(this));
- this.isDialogOpen = false;
- }
- }
- public void onLocalNegativeCallback(int i) {
- this.isDialogOpen = false;
- }
- }
|