12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250 |
- 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";
- private static boolean foundPrinter = false;
- private 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;
- private boolean isDialogOpen = false;
- private volatile boolean isFinishSearchPrinter = true;
- private Boolean isFocused = true;
- private boolean isJapaneseLocale = false;
- private volatile boolean isSearchSimpleAp = false;
- private AdapterView.AdapterContextMenuInfo listItemIndex;
- View mAboutRemoteButton;
- private boolean mActivityForegroundLifetime;
- Button mAddButton;
- AbstractListBuilder mBuilder;
- private 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.i(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;
- }
- }
- };
- private Context mContext = null;
- private 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();
- }
- }
- }
- };
- private 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.i(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.i(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;
- private ListView mListView;
- RadioButton mLocalButton;
- ProgressBar mProgressBar;
- RadioButton mRemoteButton;
- Button mSearchButton;
- TextView mTextDetail;
- View mWiFiSettingButton;
- private String printerEmailAddress = "";
- private String printerId = "";
- private String printerKey = "";
- private ArrayList<String> printerList = new ArrayList<>();
- private volatile int printer_location = 0;
- private MyPrinter probedPrinter = null;
- WorkingDialog progress;
- private SearchWiFiDirectPrinterTask searchWiFiDirectPrinter = null;
- private MyPrinter selectedPrinter = null;
- WiFiDirectPrinterListUtils wiFiDirectPrinterListUtils = null;
- protected 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();
- }
- });
- }
- private 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/")));
- }
- });
- }
- private 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.drawable.printer_selector_icon_local);
- Utils.setDrawble2TextView(this, this.mIpButton, R.drawable.printer_selector_icon_ip);
- Utils.setDrawble2TextView(this, this.mRemoteButton, R.drawable.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.drawable.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;
- }
- protected void onDestroy() {
- this.mBuilder.destructor();
- super.onDestroy();
- unbindEpsonService();
- }
- public void onBackPressed() {
- super.onBackPressed();
- interruptSearch();
- finish();
- }
- protected void onResume() {
- super.onResume();
- EPLog.d(TAG, "onResume()");
- this.mActivityForegroundLifetime = true;
- dismissPrinterNotFoundDialog();
- if (this.printer_location == 1) {
- this.mHandler.sendEmptyMessageDelayed(1, 100);
- EPLog.d(TAG, "Send CHECK_PRINTER Message.");
- }
- }
- protected void onPause() {
- EPLog.d(TAG, "onPause()");
- super.onPause();
- this.mActivityForegroundLifetime = false;
- interruptSearch();
- removeAllDialog();
- }
- protected 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;
- }
- }
- private 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);
- }
- }
- private void interruptSearch() {
- EPLog.d(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;
- }
- private 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);
- }
- private void showPrinterNotFoundDialog(DialogFragment dialogFragment) {
- if (this.mActivityForegroundLifetime) {
- dialogFragment.show(getSupportFragmentManager(), DIALOG_TAG_PRINTER_NOT_FOUND);
- }
- }
- protected Dialog onCreateDialog(int i) {
- if (i != 0) {
- return null;
- }
- EPLog.i(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;
- }
- }
|