Commit 5c1bb4bc by Kim Jinsung

Merge branch 'features/1.2.0_34869' into 'features/1.2.0'

Features/1.2.0 34869

See merge request !35
parents 2aedb779 d90aa885
......@@ -13,13 +13,11 @@ import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.data.ABVDataCache;
import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
import jp.agentec.abook.abv.bl.data.dao.OperationDao;
import jp.agentec.abook.abv.bl.data.dao.OperationGroupMasterDao;
import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.bl.dto.OperationGroupMasterDto;
import jp.agentec.abook.abv.bl.dto.OperationGroupMasterRelationDto;
import jp.agentec.abook.abv.bl.dto.comparator.OperationGroupMasterLevelComparator;
/**
......
......@@ -493,6 +493,10 @@ public class OperationListActivity extends ABVUIActivity {
public void run() {
Logger.d(TAG, "onResume Sync operationId : " + operationId);
if (operationDto != null && operationDto.needSyncFlg) {
if (!ABVEnvironment.getInstance().networkAdapter.isNetworkConnected()) {
ABVToastUtil.showMakeText(OperationListActivity.this, R.string.msg_network_offline, Toast.LENGTH_SHORT);
return;
}
// 同期処理後、直列処理で新着更新を行う。
singleSyncOperation(operationId, operationDto.reportType);
} else {
......@@ -734,7 +738,19 @@ public class OperationListActivity extends ABVUIActivity {
@Override
public void onDownloadingContentZip(final ContentZipDownloadNotification notification) {
Logger.d(TAG, "[onDownloadingContentZip]");
super.onDownloadingContentZip(notification);
String errorCodeStr = "";
if (isShowingBatchSync()) {
if (notification.getError() != null) {
Exception e = notification.getError();
Logger.e(TAG, e);
if (e instanceof AcmsException && ((AcmsException)e).getCode() != null) {
errorCodeStr = Integer.toString(((AcmsException)e).getHttpStatus());
}
}
} else {
// 一括同期以外は親Activityに通知する
super.onDownloadingContentZip(notification);
}
OperationContentDto operationContentDto = mOperationContentDao.getOperationContentForContentId(notification.getContentId());
if (operationContentDto != null) {
if (notification.downloadStatus == DownloadStatusType.Succeeded) {
......@@ -751,7 +767,7 @@ public class OperationListActivity extends ABVUIActivity {
if (isShowingBatchSync()) {
// 一括同期からのダウンロード失敗時、エラーメッセージ表示
OperationDto operationDto = mOperationLogic.getOperation(operationContentDto.operationId);
batchSyncView.showBatchSyncErrorAlert(operationDto, getString(R.string.msg_batch_sync_content_download_fail));
batchSyncView.showBatchSyncErrorAlert(operationDto, getString(R.string.msg_batch_sync_content_download_fail) + (StringUtil.isNullOrEmpty(errorCodeStr) ? "" : "(" + errorCodeStr + ")"));
}
closeProgressPopup();
}
......@@ -1850,8 +1866,6 @@ public class OperationListActivity extends ABVUIActivity {
dialog.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// ポップアップ非表示
dialog.dismiss();
getABVUIDataCache().setSortCondition((int)id);
refreshOperationList();
}
......
......@@ -149,7 +149,9 @@ public class ABookCheckWebViewHelper extends ABookHelper {
* @param taskKey タスクキー
*/
private void sendTaskData(final ABVContentViewActivity context, final long operationId, final String taskKey, final int taskReportLevel) {
// TODO 以下の処理見直し
// needSyncFlgをtrueに設定
mOperationLogic.updateSyncOperation(operationId, true);
// ネットワーク通信チェック
if (!ABVEnvironment.getInstance().networkAdapter.isNetworkConnected()) {
mFinishCallback.callback(false);
......@@ -177,11 +179,9 @@ public class ABookCheckWebViewHelper extends ABookHelper {
CommonExecutor.execute(new Runnable() {
@Override
public void run() {
OperationDto operationDto = mOperationLogic.getOperation(operationId);
boolean isError = false;
try {
mOperationLogic.updateSyncOperation(operationId, true);
mOperationLogic.sendTaskReportSendData(operationId, taskKey, taskReportLevel, progressCallback);
} catch (AcmsException ex) {
//noinspection EnumSwitchStatementWhichMissesCases
......
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