Commit 4e03e1bd by Kim Jinsung

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

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