Commit 8c512c3f by Kim Jinsung

サイネージ再生画面からメンテナンス画面に遷移時に通信失敗数およびネットワーク接続状態を送る処理追加

parent 0148a589
......@@ -34,6 +34,16 @@ public class MainActivity extends ParentActivity {
mMessageTextView = findViewById(R.id.fullscreen_content);
mMessageTextView.setTypeface(Typeface.createFromAsset(getAssets(), "meiryob.ttf"));
//サイネージ画面から戻った時の情報収集
Intent intent = getIntent();
if (intent != null) {
int errorCount = intent.getIntExtra(ToiletConstants.KEY_ERROR_COUNT, -1);
boolean isNetworkConnect = intent.getBooleanExtra(ToiletConstants.KEY_NETWORK_CONNECT, false);
if (errorCount != -1 && errorCount != 0) {
reloadDisplayView(errorCount, isNetworkConnect);
}
}
if (!toiletInfo.getUsbFileCopyComplete()) {
//外部ストレージの権限付与
if (checkPermission()) {
......
......@@ -36,7 +36,8 @@ public class SignageActivity extends ParentActivity {
} else if (toiletInfo.getToiletGateType() == ToiletConstants.VALUE_TOILET_GATE_TYPE_3) {
setContentView(R.layout.activity_signage_3);
} else { //USBから取得したトイレ情報がない場合
moveMainView();
//強制にエラーカウント1設定
moveMainView(1, true);
return;
}
......@@ -135,19 +136,23 @@ public class SignageActivity extends ParentActivity {
runOnUiThread(new Runnable() {
@Override
public void run() {
if (toiletInfo.getConnectErrorCount() > ToiletInfo.MAX_ERROR_COUNT) {
if (errorCount > ToiletInfo.MAX_ERROR_COUNT) {
//サーバ側から取得したトイレ情報削除
toiletInfo.clearResultToiletJsonMap();
moveMainView();
moveMainView(errorCount, isNetworkConnect);
} else {
settingDisplay();
if (errorCount == 0) {
settingDisplay();
}
}
}
});
}
private void moveMainView() {
private void moveMainView(int errorCount, boolean isNetworkConnect) {
Intent intent = new Intent(SignageActivity.this, MainActivity.class);
intent.putExtra(ToiletConstants.KEY_ERROR_COUNT, errorCount);
intent.putExtra(ToiletConstants.KEY_NETWORK_CONNECT, isNetworkConnect);
startActivity(intent);
finish();
}
......@@ -156,8 +161,8 @@ public class SignageActivity extends ParentActivity {
ArrayList<USBToiletDefaultJson> toiletDefaultJsonArray = toiletInfo.getToiletDefaultJsonArray();
if (toiletDefaultJsonArray == null || toiletDefaultJsonArray.size() == 0) {
//MainActivity 移動
moveMainView();
//MainActivity 移動(強制にエラーカウント1)
moveMainView(1, true);
}
int vacantCount = 0;
......@@ -208,7 +213,8 @@ public class SignageActivity extends ParentActivity {
//サーバから取得したデータが不正なのでMainに遷移
if (vacantCount == -1 || totalCount == -1) {
moveMainView();
//強制にエラーカウント1設定
moveMainView(1, true);
}
}
}
......@@ -28,14 +28,11 @@ public class ToiletInfo {
public static final int VALUE_NETWORK_DIS_CONNECT = 2;
public static final int VALUE_TOILET_SERVER_CONNECT_FAIL = 3;
public static final int MAX_ERROR_COUNT = 6;
public static final int MAX_ERROR_COUNT = 5;
private ArrayList<USBToiletDefaultJson> mToiletDefaultJsonArray;
private Map<Integer, ArrayList<ResultToiletJson>> mResultToiletJsonMap = new HashMap<>();
private boolean isValidation = false;
private boolean isUsbFileCopyComplete = false;
private int mConnectErrorCount = 0;
private boolean isNetworkConnect = false;
public static synchronized ToiletInfo getInstance() {
if (instance == null) {
......@@ -98,14 +95,6 @@ public class ToiletInfo {
return -1;
}
public void setValidation(boolean validation) {
isValidation = validation;
}
public boolean getValidation() {
return isValidation;
}
public void setUsbFileCopyComplete(boolean usbFileCopyComplete) {
isUsbFileCopyComplete = usbFileCopyComplete;
}
......@@ -114,22 +103,6 @@ public class ToiletInfo {
return isUsbFileCopyComplete;
}
public void setConnectErrorCount(int connectErrorCount) {
mConnectErrorCount = connectErrorCount;
}
public int getConnectErrorCount() {
return mConnectErrorCount;
}
public void setNetworkConnect(boolean networkConnect) {
isNetworkConnect = networkConnect;
}
public boolean getNetworkConnect() {
return isNetworkConnect;
}
public int getToiletGateType() {
if (mToiletDefaultJsonArray == null) {
return ToiletConstants.VALUE_TOILET_GATE_TYPE_0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment