|
@@ -23,6 +23,8 @@ import android.widget.ListView;
|
|
import android.widget.ProgressBar;
|
|
import android.widget.ProgressBar;
|
|
import android.widget.TextView;
|
|
import android.widget.TextView;
|
|
|
|
|
|
|
|
+import androidx.annotation.NonNull;
|
|
|
|
+
|
|
import com.epson.iprint.prtlogger.Analytics;
|
|
import com.epson.iprint.prtlogger.Analytics;
|
|
import com.epson.mobilephone.common.ble.util.BLEUtility;
|
|
import com.epson.mobilephone.common.ble.util.BLEUtility;
|
|
import com.epson.mobilephone.common.ble.util.ScannedDevice;
|
|
import com.epson.mobilephone.common.ble.util.ScannedDevice;
|
|
@@ -32,6 +34,8 @@ import epson.maintain.activity.PrinterNotFoundDialogCreator;
|
|
import epson.print.ActivityIACommon;
|
|
import epson.print.ActivityIACommon;
|
|
|
|
|
|
import epson.print.CommonDefine;
|
|
import epson.print.CommonDefine;
|
|
|
|
+import epson.print.R;
|
|
|
|
+import epson.print.Util.EPLog;
|
|
|
|
|
|
import java.io.UnsupportedEncodingException;
|
|
import java.io.UnsupportedEncodingException;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
@@ -137,86 +141,86 @@ public class BleWorkActivity extends ActivityIACommon {
|
|
sb.append(bool.booleanValue());
|
|
sb.append(bool.booleanValue());
|
|
EPLog.i(sb.toString());
|
|
EPLog.i(sb.toString());
|
|
if (bool.booleanValue()) {
|
|
if (bool.booleanValue()) {
|
|
- BleWorkActivity.this.count = BleWorkActivity.TOTAL_PROGRESS_SEC;
|
|
+ count = TOTAL_PROGRESS_SEC;
|
|
- EPLog.i("count = " + BleWorkActivity.this.count);
|
|
+ EPLog.i("count = " + count);
|
|
}
|
|
}
|
|
- BleWorkActivity.this.stopCallbacks();
|
|
+ stopCallbacks();
|
|
- if (BleWorkActivity.mAlertDialog != null && BleWorkActivity.mAlertDialog.isShowing()) {
|
|
+ if (mAlertDialog != null && mAlertDialog.isShowing()) {
|
|
- BleWorkActivity.this.runOnUiThread(new Runnable() {
|
|
+ runOnUiThread(new Runnable() {
|
|
public void run() {
|
|
public void run() {
|
|
EPLog.i("dismiss ");
|
|
EPLog.i("dismiss ");
|
|
- BleWorkActivity.mAlertDialog.dismiss();
|
|
+ mAlertDialog.dismiss();
|
|
- BleWorkActivity.mAlertDialog = null;
|
|
+ mAlertDialog = null;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- BleWorkActivity.mBleWork.resetSequence();
|
|
+ mBleWork.resetSequence();
|
|
- BleWorkActivity.this.settingResultDailog(bool.booleanValue());
|
|
+ settingResultDailog(bool.booleanValue());
|
|
}
|
|
}
|
|
};
|
|
};
|
|
mNext = new CallbackWork() {
|
|
mNext = new CallbackWork() {
|
|
public void call(Object obj) {
|
|
public void call(Object obj) {
|
|
- BleWorkActivity.this.stopWifiSearch();
|
|
+ stopWifiSearch();
|
|
- Handler unused = BleWorkActivity.mWifiSearchHandler = new Handler();
|
|
+ Handler unused = mWifiSearchHandler = new Handler();
|
|
- BleWorkActivity.this.runOnUiThread(new Runnable() {
|
|
+ runOnUiThread(new Runnable() {
|
|
public void run() {
|
|
public void run() {
|
|
EPLog.i("setSSID");
|
|
EPLog.i("setSSID");
|
|
- BleWorkActivity.mBleWork.setSSID(new BLEUtility.BleWorkCallback() {
|
|
+ mBleWork.setSSID(new BLEUtility.BleWorkCallback() {
|
|
public void call(Object obj) {
|
|
public void call(Object obj) {
|
|
- Runnable unused = BleWorkActivity.this.runnableWifiSearch = new Runnable() {
|
|
+ Runnable unused = runnableWifiSearch = new Runnable() {
|
|
int postCount = 0;
|
|
int postCount = 0;
|
|
|
|
|
|
public void run() {
|
|
public void run() {
|
|
int i = postCount;
|
|
int i = postCount;
|
|
if (i >= 2) {
|
|
if (i >= 2) {
|
|
EPLog.i("postCount >= 2 ");
|
|
EPLog.i("postCount >= 2 ");
|
|
- BleWorkActivity.mProbePrinter.interruptSearch();
|
|
+ mProbePrinter.interruptSearch();
|
|
- if (BleWorkActivity.mAlertDialog != null) {
|
|
+ if (mAlertDialog != null) {
|
|
- BleWorkActivity.mAlertDialog.dismiss();
|
|
+ mAlertDialog.dismiss();
|
|
- BleWorkActivity.mAlertDialog = null;
|
|
+ mAlertDialog = null;
|
|
}
|
|
}
|
|
- if (BleWorkActivity.mCompletion != null) {
|
|
+ if (mCompletion != null) {
|
|
- BleWorkActivity.mCompletion.call(false);
|
|
+ mCompletion.call(false);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
if (i == 1) {
|
|
if (i == 1) {
|
|
- BleWorkActivity.mProbePrinter.setMacAddress(BleWorkActivity.mBleWork.getDeviceMacAddress());
|
|
+ mProbePrinter.setMacAddress(mBleWork.getDeviceMacAddress());
|
|
- BleWorkActivity.mProbePrinter.setBleCallback(BleWorkActivity.mCompletion);
|
|
+ mProbePrinter.setBleCallback(mCompletion);
|
|
try {
|
|
try {
|
|
- BleWorkActivity.mProbePrinter.search();
|
|
+ mProbePrinter.search();
|
|
} catch (IllegalStateException e) {
|
|
} catch (IllegalStateException e) {
|
|
EPLog.e(e.getMessage());
|
|
EPLog.e(e.getMessage());
|
|
- BleWorkActivity.mProbePrinter.interruptSearch();
|
|
+ mProbePrinter.interruptSearch();
|
|
- if (BleWorkActivity.mAlertDialog != null) {
|
|
+ if (mAlertDialog != null) {
|
|
- BleWorkActivity.mAlertDialog.dismiss();
|
|
+ mAlertDialog.dismiss();
|
|
- BleWorkActivity.mAlertDialog = null;
|
|
+ mAlertDialog = null;
|
|
}
|
|
}
|
|
- if (BleWorkActivity.mCompletion != null) {
|
|
+ if (mCompletion != null) {
|
|
- BleWorkActivity.mCompletion.call(false);
|
|
+ mCompletion.call(false);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
postCount++;
|
|
postCount++;
|
|
- if (BleWorkActivity.mCompletion != null) {
|
|
+ if (mCompletion != null) {
|
|
StringBuilder sb = new StringBuilder();
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append("postDelayed postCount = ");
|
|
sb.append("postDelayed postCount = ");
|
|
- sb.append(this.postCount);
|
|
+ sb.append(postCount);
|
|
sb.append(" delay ");
|
|
sb.append(" delay ");
|
|
- sb.append(this.postCount == 1 ? 10000 : BleWorkActivity.SECOND_DELAY);
|
|
+ sb.append(postCount == 1 ? 10000 : SECOND_DELAY);
|
|
EPLog.i(sb.toString());
|
|
EPLog.i(sb.toString());
|
|
- BleWorkActivity.mWifiSearchHandler.postDelayed(this, postCount == 1 ? 10000 : 200000);
|
|
+ mWifiSearchHandler.postDelayed(this, postCount == 1 ? 10000 : 200000);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|
|
- BleWorkActivity.mWifiSearchHandler.post(BleWorkActivity.this.runnableWifiSearch);
|
|
+ mWifiSearchHandler.post(runnableWifiSearch);
|
|
}
|
|
}
|
|
}, new BLEUtility.BleWorkCallback() {
|
|
}, new BLEUtility.BleWorkCallback() {
|
|
public void call(Object obj) {
|
|
public void call(Object obj) {
|
|
EPLog.e("BleWorkCallback");
|
|
EPLog.e("BleWorkCallback");
|
|
- if (BleWorkActivity.mCompletion != null) {
|
|
+ if (mCompletion != null) {
|
|
- BleWorkActivity.mCompletion.call(false);
|
|
+ mCompletion.call(false);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -229,23 +233,23 @@ public class BleWorkActivity extends ActivityIACommon {
|
|
BleWork.jobSequence jobsequence = (BleWork.jobSequence) obj;
|
|
BleWork.jobSequence jobsequence = (BleWork.jobSequence) obj;
|
|
EPLog.i("mSequenceCallbackSuccess " + jobsequence);
|
|
EPLog.i("mSequenceCallbackSuccess " + jobsequence);
|
|
if (jobsequence == BleWork.jobSequence.UNINITIALIZED || jobsequence == BleWork.jobSequence.BEFORE_CHECK_SSID || jobsequence == BleWork.jobSequence.MIB_GET_MACADDRESS || jobsequence == BleWork.jobSequence.AFTER_SETTING_PASSWORD) {
|
|
if (jobsequence == BleWork.jobSequence.UNINITIALIZED || jobsequence == BleWork.jobSequence.BEFORE_CHECK_SSID || jobsequence == BleWork.jobSequence.MIB_GET_MACADDRESS || jobsequence == BleWork.jobSequence.AFTER_SETTING_PASSWORD) {
|
|
- BleWorkActivity.this.stopConnectTimeOut();
|
|
+ stopConnectTimeOut();
|
|
}
|
|
}
|
|
- if (!(jobsequence == BleWork.jobSequence.UNINITIALIZED || jobsequence == BleWork.jobSequence.BEFORE_CHECK_SSID || !BleWorkActivity.mBleWork.getSSIDPassword().isEmpty() || BleWorkActivity.mAlertDialog == null || ((jobsequence == BleWork.jobSequence.CHECK_SSID && BleWorkActivity.mBleWork.getSecurityType() == 1) || BleWorkActivity.mBleWork.getSecurityType() == 255))) {
|
|
+ if (!(jobsequence == BleWork.jobSequence.UNINITIALIZED || jobsequence == BleWork.jobSequence.BEFORE_CHECK_SSID || !mBleWork.getSSIDPassword().isEmpty() || mAlertDialog == null || ((jobsequence == BleWork.jobSequence.CHECK_SSID && mBleWork.getSecurityType() == 1) || mBleWork.getSecurityType() == 255))) {
|
|
- BleWorkActivity.mAlertDialog.dismiss();
|
|
+ mAlertDialog.dismiss();
|
|
- BleWorkActivity.mAlertDialog = null;
|
|
+ mAlertDialog = null;
|
|
EPLog.i("mAlertDialog dismiss " + jobsequence);
|
|
EPLog.i("mAlertDialog dismiss " + jobsequence);
|
|
}
|
|
}
|
|
if (jobsequence == BleWork.jobSequence.CHECK_SSID) {
|
|
if (jobsequence == BleWork.jobSequence.CHECK_SSID) {
|
|
- BleWorkActivity.this.setSSIDPassword();
|
|
+ setSSIDPassword();
|
|
} else if (jobsequence == BleWork.jobSequence.MIB_GET_SSID_LIST) {
|
|
} else if (jobsequence == BleWork.jobSequence.MIB_GET_SSID_LIST) {
|
|
- BleWorkActivity.this.showSSIDList();
|
|
+ showSSIDList();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|
|
mSequenceCallbackFailed = new BLEUtility.BleWorkCallback() {
|
|
mSequenceCallbackFailed = new BLEUtility.BleWorkCallback() {
|
|
public void call(Object obj) {
|
|
public void call(Object obj) {
|
|
- BleWorkActivity.this.failedDialog((BleWork.jobSequence) obj);
|
|
+ failedDialog((BleWork.jobSequence) obj);
|
|
}
|
|
}
|
|
};
|
|
};
|
|
}
|
|
}
|
|
@@ -260,7 +264,7 @@ public class BleWorkActivity extends ActivityIACommon {
|
|
private void stopSetUpProgress() {
|
|
private void stopSetUpProgress() {
|
|
Handler handler = setUpProgressHandler;
|
|
Handler handler = setUpProgressHandler;
|
|
if (handler != null) {
|
|
if (handler != null) {
|
|
- handler.removeCallbacks(this.runnableSetUpProgress);
|
|
+ handler.removeCallbacks(runnableSetUpProgress);
|
|
setUpProgressHandler = null;
|
|
setUpProgressHandler = null;
|
|
runnableSetUpProgress = null;
|
|
runnableSetUpProgress = null;
|
|
}
|
|
}
|
|
@@ -269,7 +273,7 @@ public class BleWorkActivity extends ActivityIACommon {
|
|
private void stopWifiSearch() {
|
|
private void stopWifiSearch() {
|
|
Handler handler = mWifiSearchHandler;
|
|
Handler handler = mWifiSearchHandler;
|
|
if (handler != null) {
|
|
if (handler != null) {
|
|
- handler.removeCallbacks(this.runnableWifiSearch);
|
|
+ handler.removeCallbacks(runnableWifiSearch);
|
|
mWifiSearchHandler = null;
|
|
mWifiSearchHandler = null;
|
|
runnableWifiSearch = null;
|
|
runnableWifiSearch = null;
|
|
}
|
|
}
|
|
@@ -278,43 +282,43 @@ public class BleWorkActivity extends ActivityIACommon {
|
|
private void settingResultDailog(final boolean z) {
|
|
private void settingResultDailog(final boolean z) {
|
|
runOnUiThread(new Runnable() {
|
|
runOnUiThread(new Runnable() {
|
|
public void run() {
|
|
public void run() {
|
|
- AlertDialog.Builder cancelable = new AlertDialog.Builder(BleWorkActivity.mContext).setCancelable(false);
|
|
+ AlertDialog.Builder cancelable = new AlertDialog.Builder(mContext).setCancelable(false);
|
|
if (z) {
|
|
if (z) {
|
|
- cancelable.setTitle(BleWorkActivity.this.getString(R.string.BLE_success_setup_printer_title));
|
|
+ cancelable.setTitle(getString(R.string.BLE_success_setup_printer_title));
|
|
- cancelable.setMessage(BleWorkActivity.this.getString(R.string.BLE_success_setup_printer_msg));
|
|
+ cancelable.setMessage(getString(R.string.BLE_success_setup_printer_msg));
|
|
- cancelable.setPositiveButton(BleWorkActivity.this.getString(R.string.ok_button), new DialogInterface.OnClickListener() {
|
|
+ cancelable.setPositiveButton(getString(R.string.ok_button), new DialogInterface.OnClickListener() {
|
|
public void onClick(DialogInterface dialogInterface, int i) {
|
|
public void onClick(DialogInterface dialogInterface, int i) {
|
|
Analytics.SetUpPath setUpPath;
|
|
Analytics.SetUpPath setUpPath;
|
|
- if (BleWorkActivity.this.getCallingActivity() != null) {
|
|
+ if (getCallingActivity() != null) {
|
|
- BleWorkActivity.this.setResult(-1);
|
|
+ setResult(-1);
|
|
setUpPath = Analytics.SetUpPath.Button;
|
|
setUpPath = Analytics.SetUpPath.Button;
|
|
} else {
|
|
} else {
|
|
setUpPath = Analytics.SetUpPath.Home;
|
|
setUpPath = Analytics.SetUpPath.Home;
|
|
}
|
|
}
|
|
- Analytics.sendSetup(BleWorkActivity.mBleWork.getDeviceName(), setUpPath, Analytics.SetUpResult.Success);
|
|
+ Analytics.sendSetup(mBleWork.getDeviceName(), setUpPath, Analytics.SetUpResult.Success);
|
|
- Intent intent = new Intent(BleWorkActivity.this, ActivityECConfiguration.class);
|
|
+ Intent intent = new Intent(this, ActivityECConfiguration.class);
|
|
intent.putExtra(ActivityECConfiguration.INTENT_EC_BLE_CONTENT, true);
|
|
intent.putExtra(ActivityECConfiguration.INTENT_EC_BLE_CONTENT, true);
|
|
- BleWorkActivity.this.startActivityForResult(intent, BleWorkActivity.REQUEST_CODE_EPSON_CONNECT_REGISTRATION);
|
|
+ startActivityForResult(intent, REQUEST_CODE_EPSON_CONNECT_REGISTRATION);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
- cancelable.setTitle(BleWorkActivity.this.getString(R.string.BLE_fail_setup_printer_title));
|
|
+ cancelable.setTitle(getString(R.string.BLE_fail_setup_printer_title));
|
|
- cancelable.setMessage(BleWorkActivity.this.getString(R.string.BLE_fail_setup_printer_msg));
|
|
+ cancelable.setMessage(getString(R.string.BLE_fail_setup_printer_msg));
|
|
- cancelable.setPositiveButton(BleWorkActivity.this.getString(R.string.BLE_fail_setup_printer_other_method_button), new DialogInterface.OnClickListener() {
|
|
+ cancelable.setPositiveButton(getString(R.string.BLE_fail_setup_printer_other_method_button), new DialogInterface.OnClickListener() {
|
|
public void onClick(DialogInterface dialogInterface, int i) {
|
|
public void onClick(DialogInterface dialogInterface, int i) {
|
|
- BleWorkActivity.this.startActivity(PrinterNotFoundDialogCreator.getStartIntent(BleWorkActivity.this.getApplicationContext()));
|
|
+ startActivity(PrinterNotFoundDialogCreator.getStartIntent(getApplicationContext()));
|
|
- Analytics.sendSetup(BleWorkActivity.mBleWork.getDeviceName(), BleWorkActivity.this.getCallingActivity() != null ? Analytics.SetUpPath.Button : Analytics.SetUpPath.Home, Analytics.SetUpResult.Fail);
|
|
+ Analytics.sendSetup(mBleWork.getDeviceName(), getCallingActivity() != null ? Analytics.SetUpPath.Button : Analytics.SetUpPath.Home, Analytics.SetUpResult.Fail);
|
|
- BleWorkActivity.this.finish();
|
|
+ finish();
|
|
}
|
|
}
|
|
- }).setNeutralButton(BleWorkActivity.this.getString(R.string.str_btn_close), new DialogInterface.OnClickListener() {
|
|
+ }).setNeutralButton(getString(R.string.str_btn_close), new DialogInterface.OnClickListener() {
|
|
public void onClick(DialogInterface dialogInterface, int i) {
|
|
public void onClick(DialogInterface dialogInterface, int i) {
|
|
- Analytics.sendSetup(BleWorkActivity.mBleWork.getDeviceName(), BleWorkActivity.this.getCallingActivity() != null ? Analytics.SetUpPath.Button : Analytics.SetUpPath.Home, Analytics.SetUpResult.Fail);
|
|
+ Analytics.sendSetup(mBleWork.getDeviceName(), getCallingActivity() != null ? Analytics.SetUpPath.Button : Analytics.SetUpPath.Home, Analytics.SetUpResult.Fail);
|
|
- BleWorkActivity.this.finish();
|
|
+ finish();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- BleWorkActivity.mAlertDialog = cancelable.create();
|
|
+ mAlertDialog = cancelable.create();
|
|
- BleWorkActivity.mAlertDialog.show();
|
|
+ mAlertDialog.show();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -351,41 +355,41 @@ public class BleWorkActivity extends ActivityIACommon {
|
|
runnableSetUpProgress = new Runnable() {
|
|
runnableSetUpProgress = new Runnable() {
|
|
public void run() {
|
|
public void run() {
|
|
int i;
|
|
int i;
|
|
- if (BleWorkActivity.this.isStopSetUpProgress) {
|
|
+ if (isStopSetUpProgress) {
|
|
EPLog.i("☆☆runnableSetUpProgress retuen ");
|
|
EPLog.i("☆☆runnableSetUpProgress retuen ");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- EPLog.i("mSequence " + BleWorkActivity.mBleWork.mSequence);
|
|
+ EPLog.i("mSequence " + mBleWork.mSequence);
|
|
- BleWorkActivity bleWorkActivity = BleWorkActivity.this;
|
|
+ BleWorkActivity bleWorkActivity = this;
|
|
- bleWorkActivity.count = bleWorkActivity.count + 1;
|
|
+ count = count + 1;
|
|
- int i2 = BleWorkActivity.this.count;
|
|
+ int i2 = count;
|
|
- int i3 = BleWorkActivity.TOTAL_PROGRESS_SEC;
|
|
+ int i3 = TOTAL_PROGRESS_SEC;
|
|
- if (i2 > BleWorkActivity.TOTAL_PROGRESS_SEC) {
|
|
+ if (i2 > TOTAL_PROGRESS_SEC) {
|
|
- if (BleWorkActivity.mAlertDialog != null) {
|
|
+ if (mAlertDialog != null) {
|
|
- BleWorkActivity.mAlertDialog.dismiss();
|
|
+ mAlertDialog.dismiss();
|
|
- BleWorkActivity.mAlertDialog = null;
|
|
+ mAlertDialog = null;
|
|
}
|
|
}
|
|
EPLog.e("TIME OUT");
|
|
EPLog.e("TIME OUT");
|
|
- BleWorkActivity.mCompletion.call(false);
|
|
+ mCompletion.call(false);
|
|
- CallbackWork unused = BleWorkActivity.mCompletion = null;
|
|
+ CallbackWork unused = mCompletion = null;
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- if (BleWorkActivity.this.count <= 90) {
|
|
+ if (count <= 90) {
|
|
- i = BleWorkActivity.this.count;
|
|
+ i = count;
|
|
} else {
|
|
} else {
|
|
- if (BleWorkActivity.this.count <= BleWorkActivity.TOTAL_PROGRESS_SEC) {
|
|
+ if (count <= TOTAL_PROGRESS_SEC) {
|
|
- i3 = BleWorkActivity.this.count;
|
|
+ i3 = count;
|
|
}
|
|
}
|
|
i = ((((i3 - 90)) / 12.0d) + 90.0d);
|
|
i = ((((i3 - 90)) / 12.0d) + 90.0d);
|
|
}
|
|
}
|
|
- EPLog.i(BleWorkActivity.this.count + "::" + i + " %");
|
|
+ EPLog.i(count + "::" + i + " %");
|
|
- BleWorkActivity.this.updateProgress(i);
|
|
+ updateProgress(i);
|
|
- if (!BleWorkActivity.this.isStopSetUpProgress) {
|
|
+ if (!isStopSetUpProgress) {
|
|
- BleWorkActivity.this.setUpProgressHandler.postDelayed(this, 1000);
|
|
+ setUpProgressHandler.postDelayed(this, 1000);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|
|
- setUpProgressHandler.post(this.runnableSetUpProgress);
|
|
+ setUpProgressHandler.post(runnableSetUpProgress);
|
|
}
|
|
}
|
|
|
|
|
|
private void updateProgress(int i) {
|
|
private void updateProgress(int i) {
|
|
@@ -406,9 +410,9 @@ public class BleWorkActivity extends ActivityIACommon {
|
|
}
|
|
}
|
|
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
|
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
|
public void onItemClick(AdapterView<?> adapterView, View view, int i, long j) {
|
|
public void onItemClick(AdapterView<?> adapterView, View view, int i, long j) {
|
|
- ScannedDevice scannedDevice = (ScannedDevice) BleWorkActivity.mDeviceAdapter.getItem(i);
|
|
+ ScannedDevice scannedDevice = (ScannedDevice) mDeviceAdapter.getItem(i);
|
|
if (scannedDevice != null) {
|
|
if (scannedDevice != null) {
|
|
- BleWorkActivity.this.selectDevice(scannedDevice);
|
|
+ selectDevice(scannedDevice);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -442,7 +446,7 @@ public class BleWorkActivity extends ActivityIACommon {
|
|
String property = System.getProperty("line.separator");
|
|
String property = System.getProperty("line.separator");
|
|
AlertDialog alertDialog = mAlertDialog;
|
|
AlertDialog alertDialog = mAlertDialog;
|
|
alertDialog.setMessage(str + property + property + getString(R.string.BLE_inquiry_access_point_information_msg));
|
|
alertDialog.setMessage(str + property + property + getString(R.string.BLE_inquiry_access_point_information_msg));
|
|
- if (this.isAlive && !isFinishing()) {
|
|
+ if (isAlive && !isFinishing()) {
|
|
mAlertDialog.show();
|
|
mAlertDialog.show();
|
|
}
|
|
}
|
|
setConnectTimeOut();
|
|
setConnectTimeOut();
|
|
@@ -452,11 +456,11 @@ public class BleWorkActivity extends ActivityIACommon {
|
|
mTimeoutHandler = new Handler();
|
|
mTimeoutHandler = new Handler();
|
|
mTimeoutHandler.postDelayed(new Runnable() {
|
|
mTimeoutHandler.postDelayed(new Runnable() {
|
|
public void run() {
|
|
public void run() {
|
|
- EPLog.e(" timeout ------------" + BleWorkActivity.mBleWork.mSequence);
|
|
+ EPLog.e(" timeout ------------" + mBleWork.mSequence);
|
|
- if (BleWorkActivity.mBleWork.mSequence == BleWork.jobSequence.AFTER_SETTING_PASSWORD || BleWorkActivity.mBleWork.mSequence == BleWork.jobSequence.MIB_GET_MACADDRESS || BleWorkActivity.mBleWork.mSequence == BleWork.jobSequence.BEFORE_CHECK_SSID || BleWorkActivity.mBleWork.mSequence == BleWork.jobSequence.UNINITIALIZED) {
|
|
+ if (mBleWork.mSequence == BleWork.jobSequence.AFTER_SETTING_PASSWORD || mBleWork.mSequence == BleWork.jobSequence.MIB_GET_MACADDRESS || mBleWork.mSequence == BleWork.jobSequence.BEFORE_CHECK_SSID || mBleWork.mSequence == BleWork.jobSequence.UNINITIALIZED) {
|
|
- BleWorkActivity.mBleWork.failedProcessing();
|
|
+ mBleWork.failedProcessing();
|
|
}
|
|
}
|
|
- BleWorkActivity.mBleWork.setRetryFinish();
|
|
+ mBleWork.setRetryFinish();
|
|
}
|
|
}
|
|
}, DateUtils.MILLIS_PER_MINUTE);
|
|
}, DateUtils.MILLIS_PER_MINUTE);
|
|
}
|
|
}
|
|
@@ -472,25 +476,25 @@ public class BleWorkActivity extends ActivityIACommon {
|
|
private void failedDialog(final BleWork.jobSequence jobsequence) {
|
|
private void failedDialog(final BleWork.jobSequence jobsequence) {
|
|
runOnUiThread(new Runnable() {
|
|
runOnUiThread(new Runnable() {
|
|
public void run() {
|
|
public void run() {
|
|
- BleWorkActivity.this.stopCallbacks();
|
|
+ stopCallbacks();
|
|
BleWork.jobSequence jobsequence = jobsequence;
|
|
BleWork.jobSequence jobsequence = jobsequence;
|
|
EPLog.i("sequence = " + jobsequence);
|
|
EPLog.i("sequence = " + jobsequence);
|
|
- if (BleWorkActivity.mAlertDialog != null) {
|
|
+ if (mAlertDialog != null) {
|
|
- BleWorkActivity.mAlertDialog.dismiss();
|
|
+ mAlertDialog.dismiss();
|
|
}
|
|
}
|
|
- BleWorkActivity bleWorkActivity = BleWorkActivity.this;
|
|
+ BleWorkActivity bleWorkActivity = this;
|
|
- bleWorkActivity.mAlertDialog = null;
|
|
+ mAlertDialog = null;
|
|
- AlertDialog.Builder cancelable = new AlertDialog.Builder(bleWorkActivity.mContext).setCancelable(false);
|
|
+ AlertDialog.Builder cancelable = new AlertDialog.Builder(mContext).setCancelable(false);
|
|
- cancelable.setMessage(BleWorkActivity.this.getString(R.string.BLE_setup_general_error_msg));
|
|
+ cancelable.setMessage(getString(R.string.BLE_setup_general_error_msg));
|
|
- cancelable.setPositiveButton(BleWorkActivity.this.getString(R.string.BLE_setup_abort_button), new DialogInterface.OnClickListener() {
|
|
+ cancelable.setPositiveButton(getString(R.string.BLE_setup_abort_button), new DialogInterface.OnClickListener() {
|
|
public void onClick(DialogInterface dialogInterface, int i) {
|
|
public void onClick(DialogInterface dialogInterface, int i) {
|
|
- Analytics.sendSetup(BleWorkActivity.mBleWork.getDeviceName(), BleWorkActivity.this.getCallingActivity() != null ? Analytics.SetUpPath.Button : Analytics.SetUpPath.Home, Analytics.SetUpResult.Error);
|
|
+ Analytics.sendSetup(mBleWork.getDeviceName(), getCallingActivity() != null ? Analytics.SetUpPath.Button : Analytics.SetUpPath.Home, Analytics.SetUpResult.Error);
|
|
- BleWorkActivity.this.finish();
|
|
+ finish();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- if (BleWorkActivity.this.isAlive && !BleWorkActivity.this.isFinishing()) {
|
|
+ if (isAlive && !isFinishing()) {
|
|
- BleWorkActivity.mAlertDialog = cancelable.create();
|
|
+ mAlertDialog = cancelable.create();
|
|
- BleWorkActivity.mAlertDialog.show();
|
|
+ mAlertDialog.show();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -505,23 +509,23 @@ public class BleWorkActivity extends ActivityIACommon {
|
|
}
|
|
}
|
|
|
|
|
|
public final void run() {
|
|
public final void run() {
|
|
- BleWorkActivity.lambda$SSIDfailedDialog$1(BleWorkActivity.this, f$1);
|
|
+ lambda$SSIDfailedDialog$1(this, f$1);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
public static void lambda$SSIDfailedDialog$1(BleWorkActivity bleWorkActivity, BleWork.jobSequence jobsequence) {
|
|
public static void lambda$SSIDfailedDialog$1(BleWorkActivity bleWorkActivity, BleWork.jobSequence jobsequence) {
|
|
- bleWorkActivity.stopCallbacks();
|
|
+ stopCallbacks();
|
|
EPLog.i("sequence = " + jobsequence);
|
|
EPLog.i("sequence = " + jobsequence);
|
|
- AlertDialog alertDialog = bleWorkActivity.mAlertDialog;
|
|
+ AlertDialog alertDialog = mAlertDialog;
|
|
if (alertDialog != null) {
|
|
if (alertDialog != null) {
|
|
alertDialog.dismiss();
|
|
alertDialog.dismiss();
|
|
}
|
|
}
|
|
- bleWorkActivity.mAlertDialog = null;
|
|
+ mAlertDialog = null;
|
|
- boolean z = !bleWorkActivity.mBleWork.getSsidLis().isEmpty();
|
|
+ boolean z = !mBleWork.getSsidLis().isEmpty();
|
|
- AlertDialog.Builder cancelable = new AlertDialog.Builder(bleWorkActivity.mContext).setCancelable(false);
|
|
+ AlertDialog.Builder cancelable = new AlertDialog.Builder(mContext).setCancelable(false);
|
|
- cancelable.setMessage(bleWorkActivity.getString(R.string.BLE_not_support_security_type));
|
|
+ cancelable.setMessage(getString(R.string.BLE_not_support_security_type));
|
|
- cancelable.setPositiveButton(bleWorkActivity.getString(z ? R.string.str_btn_close : R.string.BLE_setup_abort_button), new DialogInterface.OnClickListener(z) {
|
|
+ cancelable.setPositiveButton(getString(z ? R.string.str_btn_close : R.string.BLE_setup_abort_button), new DialogInterface.OnClickListener(z) {
|
|
private final boolean f$1;
|
|
private final boolean f$1;
|
|
|
|
|
|
{
|
|
{
|
|
@@ -529,74 +533,74 @@ public class BleWorkActivity extends ActivityIACommon {
|
|
}
|
|
}
|
|
|
|
|
|
public final void onClick(DialogInterface dialogInterface, int i) {
|
|
public final void onClick(DialogInterface dialogInterface, int i) {
|
|
- BleWorkActivity.lambda$null$0(BleWorkActivity.this, f$1, dialogInterface, i);
|
|
+ lambda$null$0(this, f$1, dialogInterface, i);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- if (bleWorkActivity.isAlive && !bleWorkActivity.isFinishing()) {
|
|
+ if (isAlive && !isFinishing()) {
|
|
- bleWorkActivity.mAlertDialog = cancelable.create();
|
|
+ mAlertDialog = cancelable.create();
|
|
- bleWorkActivity.mAlertDialog.show();
|
|
+ mAlertDialog.show();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
public static void lambda$null$0(BleWorkActivity bleWorkActivity, boolean z, DialogInterface dialogInterface, int i) {
|
|
public static void lambda$null$0(BleWorkActivity bleWorkActivity, boolean z, DialogInterface dialogInterface, int i) {
|
|
- Analytics.sendSetup(bleWorkActivity.mBleWork.getDeviceName(), bleWorkActivity.getCallingActivity() != null ? Analytics.SetUpPath.Button : Analytics.SetUpPath.Home, z ? Analytics.SetUpResult.Error119 : Analytics.SetUpResult.Error106);
|
|
+ Analytics.sendSetup(mBleWork.getDeviceName(), getCallingActivity() != null ? Analytics.SetUpPath.Button : Analytics.SetUpPath.Home, z ? Analytics.SetUpResult.Error119 : Analytics.SetUpResult.Error106);
|
|
if (z) {
|
|
if (z) {
|
|
- bleWorkActivity.mBleWork.mSequence = BleWork.jobSequence.MIB_GET_SSID_LIST;
|
|
+ mBleWork.mSequence = BleWork.jobSequence.MIB_GET_SSID_LIST;
|
|
- bleWorkActivity.mBleWork.setSecurityType(0);
|
|
+ mBleWork.setSecurityType(0);
|
|
- bleWorkActivity.showSSIDList();
|
|
+ showSSIDList();
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- bleWorkActivity.mBleWork.disconnect();
|
|
+ mBleWork.disconnect();
|
|
- bleWorkActivity.finish();
|
|
+ finish();
|
|
}
|
|
}
|
|
|
|
|
|
private void showSSIDList() {
|
|
private void showSSIDList() {
|
|
runOnUiThread(new Runnable() {
|
|
runOnUiThread(new Runnable() {
|
|
public void run() {
|
|
public void run() {
|
|
- BleWorkActivity.mBleWork.mSequence = BleWork.jobSequence.MIB_SET_SSID;
|
|
+ mBleWork.mSequence = BleWork.jobSequence.MIB_SET_SSID;
|
|
- BleWorkActivity.mBleWork.disconnect(false);
|
|
+ mBleWork.disconnect(false);
|
|
- EPLog.d("sequence = " + BleWorkActivity.mBleWork.mSequence);
|
|
+ EPLog.d("sequence = " + mBleWork.mSequence);
|
|
- List<String> ssidLis = BleWorkActivity.mBleWork.getSsidLis();
|
|
+ List<String> ssidLis = mBleWork.getSsidLis();
|
|
- ssidLis.remove(BleWorkActivity.this.getResources().getText(R.string.BLE_select_SSID_manual_button).toString());
|
|
+ ssidLis.remove(getResources().getText(R.string.BLE_select_SSID_manual_button).toString());
|
|
- BleWorkActivity.this.sortSSIDlist(ssidLis);
|
|
+ sortSSIDlist(ssidLis);
|
|
- ssidLis.add(BleWorkActivity.this.getResources().getText(R.string.BLE_select_SSID_manual_button).toString());
|
|
+ ssidLis.add(getResources().getText(R.string.BLE_select_SSID_manual_button).toString());
|
|
final String[] strArr = (String[]) ssidLis.toArray(new String[ssidLis.size()]);
|
|
final String[] strArr = (String[]) ssidLis.toArray(new String[ssidLis.size()]);
|
|
- LinearLayout linearLayout = new LinearLayout(BleWorkActivity.this);
|
|
+ LinearLayout linearLayout = new LinearLayout(this);
|
|
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-2, -2);
|
|
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-2, -2);
|
|
layoutParams.setMargins(40, 25, 40, 25);
|
|
layoutParams.setMargins(40, 25, 40, 25);
|
|
- TextView textView = new TextView(BleWorkActivity.this);
|
|
+ TextView textView = new TextView(this);
|
|
- textView.setText(BleWorkActivity.this.getResources().getText(R.string.BLE_select_SSID_screen_msg));
|
|
+ textView.setText(getResources().getText(R.string.BLE_select_SSID_screen_msg));
|
|
textView.setTextSize(20.0f);
|
|
textView.setTextSize(20.0f);
|
|
textView.setLayoutParams(layoutParams);
|
|
textView.setLayoutParams(layoutParams);
|
|
linearLayout.addView(textView);
|
|
linearLayout.addView(textView);
|
|
- AlertDialog.Builder cancelable = new AlertDialog.Builder(BleWorkActivity.this).setCancelable(false);
|
|
+ AlertDialog.Builder cancelable = new AlertDialog.Builder(this).setCancelable(false);
|
|
cancelable.setCustomTitle(linearLayout);
|
|
cancelable.setCustomTitle(linearLayout);
|
|
cancelable.setItems(strArr, new DialogInterface.OnClickListener() {
|
|
cancelable.setItems(strArr, new DialogInterface.OnClickListener() {
|
|
public void onClick(DialogInterface dialogInterface, int i) {
|
|
public void onClick(DialogInterface dialogInterface, int i) {
|
|
String str = strArr[i];
|
|
String str = strArr[i];
|
|
EPLog.d("select = " + str);
|
|
EPLog.d("select = " + str);
|
|
if (i == strArr.length - 1) {
|
|
if (i == strArr.length - 1) {
|
|
- BleWorkActivity.this.setSSID();
|
|
+ setSSID();
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- EPLog.i("☆" + BleWorkActivity.mBleWork.mSequence + "::" + BleWorkActivity.mBleWork.mStatus);
|
|
+ EPLog.i("☆" + mBleWork.mSequence + "::" + mBleWork.mStatus);
|
|
- BleWorkActivity.mBleWork.setSSID(str);
|
|
+ mBleWork.setSSID(str);
|
|
- if (BleWorkActivity.mBleWork.mSequence == BleWork.jobSequence.DISCONNECTED || BleWorkActivity.mBleWork.mStatus == 0) {
|
|
+ if (mBleWork.mSequence == BleWork.jobSequence.DISCONNECTED || mBleWork.mStatus == 0) {
|
|
- EPLog.i("☆☆ " + BleWorkActivity.mBleWork.mSequence + "::" + BleWorkActivity.mBleWork.mStatus);
|
|
+ EPLog.i("☆☆ " + mBleWork.mSequence + "::" + mBleWork.mStatus);
|
|
- BleWorkActivity.mBleWork.mSequence = BleWork.jobSequence.BEFORE_CHECK_SSID;
|
|
+ mBleWork.mSequence = BleWork.jobSequence.BEFORE_CHECK_SSID;
|
|
- BleWorkActivity.mBleWork.connect();
|
|
+ mBleWork.connect();
|
|
EPLog.d(" getInfoForConnectDialog");
|
|
EPLog.d(" getInfoForConnectDialog");
|
|
- BleWorkActivity.this.getInfoForConnectDialog(BleWorkActivity.mBleWork.getDeviceName());
|
|
+ getInfoForConnectDialog(mBleWork.getDeviceName());
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- EPLog.i("☆☆☆☆ " + BleWorkActivity.mBleWork.mSequence + "::" + BleWorkActivity.mBleWork.mStatus);
|
|
+ EPLog.i("☆☆☆☆ " + mBleWork.mSequence + "::" + mBleWork.mStatus);
|
|
- BleWorkActivity.mBleWork.setSSIDType();
|
|
+ mBleWork.setSSIDType();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- cancelable.setNegativeButton(BleWorkActivity.this.getString(R.string.BLE_setup_abort_button), new DialogInterface.OnClickListener() {
|
|
+ cancelable.setNegativeButton(getString(R.string.BLE_setup_abort_button), new DialogInterface.OnClickListener() {
|
|
public void onClick(DialogInterface dialogInterface, int i) {
|
|
public void onClick(DialogInterface dialogInterface, int i) {
|
|
EPLog.i();
|
|
EPLog.i();
|
|
- BleWorkActivity.mBleWork.disconnect(true);
|
|
+ mBleWork.disconnect(true);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
cancelable.show();
|
|
cancelable.show();
|
|
@@ -629,9 +633,9 @@ public class BleWorkActivity extends ActivityIACommon {
|
|
runOnUiThread(new Runnable() {
|
|
runOnUiThread(new Runnable() {
|
|
public void run() {
|
|
public void run() {
|
|
EPLog.i("inputs = ");
|
|
EPLog.i("inputs = ");
|
|
- final EditText editText = new EditText(BleWorkActivity.this);
|
|
+ final EditText editText = new EditText(this);
|
|
editText.setInputType(33);
|
|
editText.setInputType(33);
|
|
- editText.setFilters(BleWorkActivity.this.getInputFilters(100));
|
|
+ editText.setFilters(getInputFilters(100));
|
|
editText.addTextChangedListener(new TextWatcher() {
|
|
editText.addTextChangedListener(new TextWatcher() {
|
|
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
|
|
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
|
|
}
|
|
}
|
|
@@ -641,39 +645,39 @@ public class BleWorkActivity extends ActivityIACommon {
|
|
|
|
|
|
public void afterTextChanged(Editable editable) {
|
|
public void afterTextChanged(Editable editable) {
|
|
EPLog.i("afterTextChanged " + editable);
|
|
EPLog.i("afterTextChanged " + editable);
|
|
- BleWorkActivity.this.validateInputText(100, editable.toString());
|
|
+ validateInputText(100, editable.toString());
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- AlertDialog.Builder cancelable = new AlertDialog.Builder(BleWorkActivity.this).setCancelable(false);
|
|
+ AlertDialog.Builder cancelable = new AlertDialog.Builder(this).setCancelable(false);
|
|
- cancelable.setTitle(BleWorkActivity.this.getString(R.string.BLE_input_SSID_by_manual_dialog_title));
|
|
+ cancelable.setTitle(getString(R.string.BLE_input_SSID_by_manual_dialog_title));
|
|
- cancelable.setMessage(BleWorkActivity.this.getString(R.string.BLE_input_SSID_by_manual_dialog_msg));
|
|
+ cancelable.setMessage(getString(R.string.BLE_input_SSID_by_manual_dialog_msg));
|
|
cancelable.setView(editText);
|
|
cancelable.setView(editText);
|
|
- cancelable.setPositiveButton(BleWorkActivity.this.getString(R.string.ok_button), new DialogInterface.OnClickListener() {
|
|
+ cancelable.setPositiveButton(getString(R.string.ok_button), new DialogInterface.OnClickListener() {
|
|
public void onClick(DialogInterface dialogInterface, int i) {
|
|
public void onClick(DialogInterface dialogInterface, int i) {
|
|
EPLog.i(editText.getText().toString());
|
|
EPLog.i(editText.getText().toString());
|
|
- BleWorkActivity.mBleWork.setSSID(editText.getText().toString());
|
|
+ mBleWork.setSSID(editText.getText().toString());
|
|
- BleWorkActivity.mBleWork.setSecurityType(255);
|
|
+ mBleWork.setSecurityType(255);
|
|
- BleWorkActivity.mBleWork.mSequence = BleWork.jobSequence.SET_PASSWORD;
|
|
+ mBleWork.mSequence = BleWork.jobSequence.SET_PASSWORD;
|
|
- BleWorkActivity.this.setSSIDPassword();
|
|
+ setSSIDPassword();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- cancelable.setNegativeButton(BleWorkActivity.this.getString(R.string.no_button), new DialogInterface.OnClickListener() {
|
|
+ cancelable.setNegativeButton(getString(R.string.no_button), new DialogInterface.OnClickListener() {
|
|
public void onClick(DialogInterface dialogInterface, int i) {
|
|
public void onClick(DialogInterface dialogInterface, int i) {
|
|
EPLog.i();
|
|
EPLog.i();
|
|
- ((InputMethodManager) BleWorkActivity.this.getSystemService("input_method")).hideSoftInputFromWindow(editText.getWindowToken(), 2);
|
|
+ ((InputMethodManager) getSystemService("input_method")).hideSoftInputFromWindow(editText.getWindowToken(), 2);
|
|
- if (!BleWorkActivity.mBleWork.getSsidLis().isEmpty()) {
|
|
+ if (!mBleWork.getSsidLis().isEmpty()) {
|
|
- BleWorkActivity.mBleWork.mSequence = BleWork.jobSequence.MIB_GET_SSID_LIST;
|
|
+ mBleWork.mSequence = BleWork.jobSequence.MIB_GET_SSID_LIST;
|
|
- BleWorkActivity.mBleWork.setSecurityType(0);
|
|
+ mBleWork.setSecurityType(0);
|
|
- BleWorkActivity.this.showSSIDList();
|
|
+ showSSIDList();
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- BleWorkActivity.mBleWork.disconnect();
|
|
+ mBleWork.disconnect();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- if (!BleWorkActivity.this.isFinishing()) {
|
|
+ if (!isFinishing()) {
|
|
- BleWorkActivity.mDialog = cancelable.create();
|
|
+ mDialog = cancelable.create();
|
|
- BleWorkActivity.mDialog.show();
|
|
+ mDialog.show();
|
|
- BleWorkActivity.mDialog.getButton(-1).setEnabled(false);
|
|
+ mDialog.getButton(-1).setEnabled(false);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -685,14 +689,14 @@ public class BleWorkActivity extends ActivityIACommon {
|
|
runOnUiThread(new Runnable() {
|
|
runOnUiThread(new Runnable() {
|
|
public void run() {
|
|
public void run() {
|
|
EPLog.i("password mNext");
|
|
EPLog.i("password mNext");
|
|
- BleWorkActivity.mNext.call("");
|
|
+ mNext.call("");
|
|
- if (BleWorkActivity.this.setUpProgressHandler == null && BleWorkActivity.this.runnableSetUpProgress == null) {
|
|
+ if (setUpProgressHandler == null && runnableSetUpProgress == null) {
|
|
- if (BleWorkActivity.mAlertDialog != null) {
|
|
+ if (mAlertDialog != null) {
|
|
- BleWorkActivity.mAlertDialog.dismiss();
|
|
+ mAlertDialog.dismiss();
|
|
- BleWorkActivity.mAlertDialog = null;
|
|
+ mAlertDialog = null;
|
|
}
|
|
}
|
|
EPLog.d("waitingCommunicationDaialog");
|
|
EPLog.d("waitingCommunicationDaialog");
|
|
- BleWorkActivity.this.waitingCommunicationDaialog();
|
|
+ waitingCommunicationDaialog();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -700,15 +704,15 @@ public class BleWorkActivity extends ActivityIACommon {
|
|
runOnUiThread(new Runnable() {
|
|
runOnUiThread(new Runnable() {
|
|
public void run() {
|
|
public void run() {
|
|
EPLog.i("inputs = ");
|
|
EPLog.i("inputs = ");
|
|
- final short securityType = BleWorkActivity.mBleWork.getSecurityType();
|
|
+ final short securityType = mBleWork.getSecurityType();
|
|
if (securityType == 7 || securityType == 10) {
|
|
if (securityType == 7 || securityType == 10) {
|
|
- BleWorkActivity bleWorkActivity = BleWorkActivity.this;
|
|
+ BleWorkActivity bleWorkActivity = this;
|
|
- bleWorkActivity.SSIDfailedDialog(bleWorkActivity.mBleWork.mSequence);
|
|
+ SSIDfailedDialog(mBleWork.mSequence);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- final EditText editText = new EditText(BleWorkActivity.this);
|
|
+ final EditText editText = new EditText(this);
|
|
editText.setInputType(33);
|
|
editText.setInputType(33);
|
|
- editText.setFilters(BleWorkActivity.this.getInputFilters(securityType));
|
|
+ editText.setFilters(getInputFilters(securityType));
|
|
editText.addTextChangedListener(new TextWatcher() {
|
|
editText.addTextChangedListener(new TextWatcher() {
|
|
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
|
|
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
|
|
}
|
|
}
|
|
@@ -718,53 +722,53 @@ public class BleWorkActivity extends ActivityIACommon {
|
|
|
|
|
|
public void afterTextChanged(Editable editable) {
|
|
public void afterTextChanged(Editable editable) {
|
|
EPLog.i("afterTextChanged " + editable);
|
|
EPLog.i("afterTextChanged " + editable);
|
|
- BleWorkActivity.this.validateInputText(securityType, editable.toString());
|
|
+ validateInputText(securityType, editable.toString());
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- AlertDialog.Builder cancelable = new AlertDialog.Builder(BleWorkActivity.this).setCancelable(false);
|
|
+ AlertDialog.Builder cancelable = new AlertDialog.Builder(this).setCancelable(false);
|
|
- cancelable.setTitle(BleWorkActivity.this.getString(R.string.BLE_input_password_of_SSID_dialog_title));
|
|
+ cancelable.setTitle(getString(R.string.BLE_input_password_of_SSID_dialog_title));
|
|
- BleWorkActivity bleWorkActivity2 = BleWorkActivity.this;
|
|
+ BleWorkActivity bleWorkActivity2 = this;
|
|
boolean z = true;
|
|
boolean z = true;
|
|
cancelable.setMessage(bleWorkActivity2.getString(R.string.BLE_input_password_of_SSID_dialog_msg, new Object[]{bleWorkActivity2.mBleWork.getSSID()}));
|
|
cancelable.setMessage(bleWorkActivity2.getString(R.string.BLE_input_password_of_SSID_dialog_msg, new Object[]{bleWorkActivity2.mBleWork.getSSID()}));
|
|
cancelable.setView(editText);
|
|
cancelable.setView(editText);
|
|
- cancelable.setPositiveButton(BleWorkActivity.this.getString(R.string.ok_button), new DialogInterface.OnClickListener() {
|
|
+ cancelable.setPositiveButton(getString(R.string.ok_button), new DialogInterface.OnClickListener() {
|
|
public void onClick(DialogInterface dialogInterface, int i) {
|
|
public void onClick(DialogInterface dialogInterface, int i) {
|
|
EPLog.i(editText.getText().toString());
|
|
EPLog.i(editText.getText().toString());
|
|
- BleWorkActivity.mBleWork.setSSIDPassword(editText.getText().toString());
|
|
+ mBleWork.setSSIDPassword(editText.getText().toString());
|
|
- BleWorkActivity.mBleWork.mSequence = BleWork.jobSequence.MIB_GET_MACADDRESS;
|
|
+ mBleWork.mSequence = BleWork.jobSequence.MIB_GET_MACADDRESS;
|
|
- BleWorkActivity.mBleWork.connect();
|
|
+ mBleWork.connect();
|
|
- BleWorkActivity.this.setConnectTimeOut();
|
|
+ setConnectTimeOut();
|
|
EPLog.d("waitingCommunicationDaialog");
|
|
EPLog.d("waitingCommunicationDaialog");
|
|
- BleWorkActivity.this.waitingCommunicationDaialog();
|
|
+ waitingCommunicationDaialog();
|
|
- ((InputMethodManager) BleWorkActivity.this.getSystemService("input_method")).hideSoftInputFromWindow(editText.getWindowToken(), 2);
|
|
+ ((InputMethodManager) getSystemService("input_method")).hideSoftInputFromWindow(editText.getWindowToken(), 2);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- cancelable.setNegativeButton(BleWorkActivity.this.getString(R.string.no_button), new DialogInterface.OnClickListener() {
|
|
+ cancelable.setNegativeButton(getString(R.string.no_button), new DialogInterface.OnClickListener() {
|
|
public void onClick(DialogInterface dialogInterface, int i) {
|
|
public void onClick(DialogInterface dialogInterface, int i) {
|
|
EPLog.i();
|
|
EPLog.i();
|
|
- ((InputMethodManager) BleWorkActivity.this.getSystemService("input_method")).hideSoftInputFromWindow(editText.getWindowToken(), 2);
|
|
+ ((InputMethodManager) getSystemService("input_method")).hideSoftInputFromWindow(editText.getWindowToken(), 2);
|
|
- if (!BleWorkActivity.mBleWork.getSsidLis().isEmpty()) {
|
|
+ if (!mBleWork.getSsidLis().isEmpty()) {
|
|
- BleWorkActivity.mBleWork.mSequence = BleWork.jobSequence.MIB_GET_SSID_LIST;
|
|
+ mBleWork.mSequence = BleWork.jobSequence.MIB_GET_SSID_LIST;
|
|
- BleWorkActivity.mBleWork.setSecurityType(0);
|
|
+ mBleWork.setSecurityType(0);
|
|
- BleWorkActivity.this.showSSIDList();
|
|
+ showSSIDList();
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- BleWorkActivity.mBleWork.disconnect();
|
|
+ mBleWork.disconnect();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- if (!BleWorkActivity.this.isFinishing()) {
|
|
+ if (!isFinishing()) {
|
|
- BleWorkActivity.mDialog = cancelable.create();
|
|
+ mDialog = cancelable.create();
|
|
- BleWorkActivity.mDialog.show();
|
|
+ mDialog.show();
|
|
- Button button = BleWorkActivity.mDialog.getButton(-1);
|
|
+ Button button = mDialog.getButton(-1);
|
|
if (securityType != 255) {
|
|
if (securityType != 255) {
|
|
z = false;
|
|
z = false;
|
|
}
|
|
}
|
|
button.setEnabled(z);
|
|
button.setEnabled(z);
|
|
}
|
|
}
|
|
- EPLog.d("sequence = " + BleWorkActivity.mBleWork.mSequence);
|
|
+ EPLog.d("sequence = " + mBleWork.mSequence);
|
|
- BleWorkActivity.mBleWork.mSequence = BleWork.jobSequence.AFTER_SETTING_PASSWORD;
|
|
+ mBleWork.mSequence = BleWork.jobSequence.AFTER_SETTING_PASSWORD;
|
|
- BleWorkActivity.mBleWork.disconnect(false);
|
|
+ mBleWork.disconnect(false);
|
|
- EPLog.d("sequence = " + BleWorkActivity.mBleWork.mSequence);
|
|
+ EPLog.d("sequence = " + mBleWork.mSequence);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -830,131 +834,9 @@ public class BleWorkActivity extends ActivityIACommon {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
+
|
|
-
|
|
|
|
- if (r11 > 63) goto L_0x00ac;
|
|
|
|
- */
|
|
|
|
-
|
|
|
|
- if (r11 <= 63) goto L_0x00ad;
|
|
|
|
- */
|
|
|
|
-
|
|
|
|
- if (java.util.Arrays.asList(new java.lang.Integer[]{13, 26}).contains(java.lang.Integer.valueOf(r11)) != false) goto L_0x00ad;
|
|
|
|
- */
|
|
|
|
-
|
|
|
|
- if (java.util.Arrays.asList(new java.lang.Integer[]{5, 10}).contains(java.lang.Integer.valueOf(r11)) != false) goto L_0x00ad;
|
|
|
|
- */
|
|
|
|
-
|
|
|
|
- if (java.util.Arrays.asList(new java.lang.Integer[]{5, 10, 13, 26}).contains(java.lang.Integer.valueOf(r11)) != false) goto L_0x00ad;
|
|
|
|
- */
|
|
|
|
-
|
|
|
|
- if (r11 <= 32) goto L_0x00ad;
|
|
|
|
- */
|
|
|
|
-
|
|
|
|
- if (r11 <= 63) goto L_0x00ad;
|
|
|
|
- */
|
|
|
|
-
|
|
|
|
public void validateInputText(int r10, java.lang.String r11) {
|
|
public void validateInputText(int r10, java.lang.String r11) {
|
|
-
|
|
+
|
|
- r9 = this;
|
|
+ throw new UnsupportedOperationException("Method not decompiled: com.epson.mobilephone.common.ble.validateInputText(int, java.lang.String):void");
|
|
- java.lang.String r0 = r11.toString()
|
|
|
|
- java.lang.String r1 = "^[^ -~。-゚]+$"
|
|
|
|
- boolean r0 = r0.matches(r1)
|
|
|
|
- r1 = 0
|
|
|
|
- r2 = 1
|
|
|
|
- if (r0 != 0) goto L_0x00ac
|
|
|
|
- int r11 = r11.length()
|
|
|
|
- r0 = 7
|
|
|
|
- r3 = 63
|
|
|
|
- r4 = 8
|
|
|
|
- if (r10 == r0) goto L_0x00a7
|
|
|
|
- r0 = 100
|
|
|
|
- if (r10 == r0) goto L_0x00a0
|
|
|
|
- r0 = 26
|
|
|
|
- r5 = 13
|
|
|
|
- r6 = 10
|
|
|
|
- r7 = 2
|
|
|
|
- r8 = 5
|
|
|
|
- switch(r10) {
|
|
|
|
- case 2: goto L_0x0075;
|
|
|
|
- case 3: goto L_0x0058;
|
|
|
|
- case 4: goto L_0x003b;
|
|
|
|
- case 5: goto L_0x00a7;
|
|
|
|
- default: goto L_0x0028;
|
|
|
|
- }
|
|
|
|
- L_0x0028:
|
|
|
|
- switch(r10) {
|
|
|
|
- case 9: goto L_0x0035;
|
|
|
|
- case 10: goto L_0x0035;
|
|
|
|
- case 11: goto L_0x0035;
|
|
|
|
- default: goto L_0x002b;
|
|
|
|
- }
|
|
|
|
- L_0x002b:
|
|
|
|
- if (r11 == 0) goto L_0x00ad
|
|
|
|
- if (r11 == r8) goto L_0x00ad
|
|
|
|
- if (r11 < r4) goto L_0x00ac
|
|
|
|
- if (r11 > r3) goto L_0x00ac
|
|
|
|
- goto L_0x00ad
|
|
|
|
- L_0x0035:
|
|
|
|
- if (r11 < r4) goto L_0x00ac
|
|
|
|
- if (r11 > r3) goto L_0x00ac
|
|
|
|
- goto L_0x00ad
|
|
|
|
- L_0x003b:
|
|
|
|
- java.lang.Integer[] r10 = new java.lang.Integer[r7]
|
|
|
|
- java.lang.Integer r3 = java.lang.Integer.valueOf(r5)
|
|
|
|
- r10[r1] = r3
|
|
|
|
- java.lang.Integer r0 = java.lang.Integer.valueOf(r0)
|
|
|
|
- r10[r2] = r0
|
|
|
|
- java.util.List r10 = java.util.Arrays.asList(r10)
|
|
|
|
- java.lang.Integer r11 = java.lang.Integer.valueOf(r11)
|
|
|
|
- boolean r10 = r10.contains(r11)
|
|
|
|
- if (r10 == 0) goto L_0x00ac
|
|
|
|
- goto L_0x00ad
|
|
|
|
- L_0x0058:
|
|
|
|
- java.lang.Integer[] r10 = new java.lang.Integer[r7]
|
|
|
|
- java.lang.Integer r0 = java.lang.Integer.valueOf(r8)
|
|
|
|
- r10[r1] = r0
|
|
|
|
- java.lang.Integer r0 = java.lang.Integer.valueOf(r6)
|
|
|
|
- r10[r2] = r0
|
|
|
|
- java.util.List r10 = java.util.Arrays.asList(r10)
|
|
|
|
- java.lang.Integer r11 = java.lang.Integer.valueOf(r11)
|
|
|
|
- boolean r10 = r10.contains(r11)
|
|
|
|
- if (r10 == 0) goto L_0x00ac
|
|
|
|
- goto L_0x00ad
|
|
|
|
- L_0x0075:
|
|
|
|
- r10 = 4
|
|
|
|
- java.lang.Integer[] r10 = new java.lang.Integer[r10]
|
|
|
|
- java.lang.Integer r3 = java.lang.Integer.valueOf(r8)
|
|
|
|
- r10[r1] = r3
|
|
|
|
- java.lang.Integer r3 = java.lang.Integer.valueOf(r6)
|
|
|
|
- r10[r2] = r3
|
|
|
|
- java.lang.Integer r3 = java.lang.Integer.valueOf(r5)
|
|
|
|
- r10[r7] = r3
|
|
|
|
- r3 = 3
|
|
|
|
- java.lang.Integer r0 = java.lang.Integer.valueOf(r0)
|
|
|
|
- r10[r3] = r0
|
|
|
|
- java.util.List r10 = java.util.Arrays.asList(r10)
|
|
|
|
- java.lang.Integer r11 = java.lang.Integer.valueOf(r11)
|
|
|
|
- boolean r10 = r10.contains(r11)
|
|
|
|
- if (r10 == 0) goto L_0x00ac
|
|
|
|
- goto L_0x00ad
|
|
|
|
- L_0x00a0:
|
|
|
|
- if (r11 < r2) goto L_0x00ac
|
|
|
|
- r10 = 32
|
|
|
|
- if (r11 > r10) goto L_0x00ac
|
|
|
|
- goto L_0x00ad
|
|
|
|
- L_0x00a7:
|
|
|
|
- if (r11 < r4) goto L_0x00ac
|
|
|
|
- if (r11 > r3) goto L_0x00ac
|
|
|
|
- goto L_0x00ad
|
|
|
|
- L_0x00ac:
|
|
|
|
- r2 = 0
|
|
|
|
- L_0x00ad:
|
|
|
|
- android.app.AlertDialog r10 = r9.mDialog
|
|
|
|
- r11 = -1
|
|
|
|
- android.widget.Button r10 = r10.getButton(r11)
|
|
|
|
- r10.setEnabled(r2)
|
|
|
|
- return
|
|
|
|
- */
|
|
|
|
- throw new UnsupportedOperationException("Method not decompiled: com.epson.mobilephone.common.ble.BleWorkActivity.validateInputText(int, java.lang.String):void");
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|