Commit 4e03e1bd by Kim Jinsung

・新着更新中にログアウトするとアプリ強制される問題対応

・新着更新中にログアウトするとサーバ通信エラーメッセージ非表示
parent 52f75401
......@@ -171,6 +171,8 @@ public class ContentDownloader {
Logger.e(TAG, "execKickTask encountered an exception.", e);
} catch (NetworkDisconnectedException e) {
Logger.e(TAG, "execKickTask encountered an exception.", e);
} catch (Exception e) {
Logger.e(TAG, "execKickTask encountered an exception.", e);
} finally {
isKickTask = false;
}
......@@ -178,7 +180,7 @@ public class ContentDownloader {
});
}
private void execKickTask() throws AcmsException, NetworkDisconnectedException {
private void execKickTask() throws AcmsException, NetworkDisconnectedException, Exception {
autoPaused = false;
if (Logger.isDebugEnabled()) {
Logger.d(TAG, "downloaderMap %s", getDownloadMapForDebug());
......@@ -622,7 +624,7 @@ public class ContentDownloader {
* @throws AcmsException
* @throws NetworkDisconnectedException
*/
private void startDownload(ContentDto contentDto) throws AcmsException, NetworkDisconnectedException {
private void startDownload(ContentDto contentDto) throws AcmsException, NetworkDisconnectedException, Exception {
contentDto.status = DownloadStatusType.Downloading.type();
contentDto.resourcePath = ABVEnvironment.getInstance().getContentResourcesDirectoryPath(contentDto.contentId, false);
contentDto.downloadStartDate = DateTimeUtil.getCurrentDate();
......@@ -691,7 +693,7 @@ public class ContentDownloader {
return downloadUrl;
}
private GetContentParameters getContentParameter(ContentDto contentDto) {
private GetContentParameters getContentParameter(ContentDto contentDto) throws NullPointerException {
GetContentParameters param;
param = new GetContentParameters(contentDto.contentId, cache.getMemberInfo().sid, ContentZipType.ContentDownload);
return param;
......
......@@ -500,9 +500,12 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
configureKeepScreen();
}
if (e != null) {
//新着更新時にログアウトすることで、SIDが取得できなく、例外が発生したときにはトースト非表示
if (ABVDataCache.getInstance().getMemberInfo() != null) {
handleError(e);
}
}
}
});
}
......@@ -737,6 +740,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
ErrorMessage.showErrorMessageToast(ABVAuthenticatedActivity.this, error);
}
}
public void showUnAuthorizedContentWarningDialog(String msg) {
ABookAlertDialog alertDialog = AlertDialogUtil.createAlertDialog(this, getString(R.string.app_name), msg);
alertDialog.setPositiveButton(R.string.ok, null);
......@@ -765,4 +769,12 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
public boolean isShowingBatchSync() {
return batchSyncView != null && batchSyncView.isShowing();
}
/**
* @version 1.2.300
* 新着情報更新処理を中止
*/
public void stopContentRefresher() {
contentRefresher.stopRefresh();
}
}
......@@ -442,10 +442,13 @@ public abstract class ABVUIActivity extends ABVAuthenticatedActivity {
}
});
}
//ログアウト時にも呼ばれるのでチェック
ABVDataCache cache = ABVDataCache.getInstance();
if (cache.getMemberInfo() != null) {
// 自動ダウンロード対象がある場合、新着更新が完了したあとに開始するように修正(jang)
ContentDownloader.getInstance().autoDownload();
}
}
/**
* メモ・マーキング・しおりをコピーします
......
......@@ -83,4 +83,8 @@ public class ABookSettingActivity extends PreferenceActivity {
return (getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_NORMAL;
}
public void stopContentRefresher() {
ABVUIActivity activity = ActivityHandlingHelper.getInstance().getPreviousOfSettingActivity();
activity.stopContentRefresher();
}
}
......@@ -35,7 +35,6 @@ import jp.agentec.abook.abv.bl.acms.type.AcmsApis;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.CommonExecutor;
import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.data.ABVDataCache;
import jp.agentec.abook.abv.bl.dto.MemberInfoDto;
......@@ -49,19 +48,14 @@ import jp.agentec.abook.abv.launcher.android.OnAppDownloadReceiver;
import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.UserPrefKey;
import jp.agentec.abook.abv.ui.common.appinfo.options.Options;
import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog;
import jp.agentec.abook.abv.ui.common.helper.ProgressDialogHelper;
import jp.agentec.abook.abv.ui.common.util.ABVToastUtil;
import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
import jp.agentec.abook.abv.ui.common.util.PatternStringUtil;
import jp.agentec.abook.abv.ui.home.helper.ABookPermissionHelper;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
import static jp.agentec.abook.abv.cl.util.PreferenceUtil.getUserPref;
import static jp.agentec.abook.abv.cl.util.PreferenceUtil.putUserPref;
public class ABookSettingFragment extends PreferenceFragment {
private static final String TAG = "ABookSettingActivity";
......@@ -191,6 +185,9 @@ public class ABookSettingFragment extends PreferenceFragment {
ABVToastUtil.showMakeText(getActivity(), R.string.ERROR, Toast.LENGTH_SHORT);
}
// 新着更新が実行されている場合停止
((ABookSettingActivity)getActivity()).stopContentRefresher();
SharedPreferences sharedPreferences = getActivity().getSharedPreferences(AppDefType.PrefName.USER_PREFERENCE, Context.MODE_PRIVATE);
sharedPreferences.edit().remove(AppDefType.UserPrefKey.GUEST_LOGIN).commit();
......
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