Commit 58d6e72f by Kazuyuki Hida

課題5を修正(ただし、タイミングがいまいち)

parent a6d6e5bf
...@@ -36,6 +36,7 @@ import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException; ...@@ -36,6 +36,7 @@ import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException;
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.logic.AbstractLogic; import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.ContractLogic;
import jp.agentec.abook.abv.bl.logic.UserAuthenticateLogic; import jp.agentec.abook.abv.bl.logic.UserAuthenticateLogic;
import jp.agentec.abook.abv.cl.environment.NetworkAdapter; import jp.agentec.abook.abv.cl.environment.NetworkAdapter;
import jp.agentec.abook.abv.cl.push.FcmManager; import jp.agentec.abook.abv.cl.push.FcmManager;
...@@ -126,7 +127,7 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity { ...@@ -126,7 +127,7 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity {
logoutAlert(R.string.failed_to_get_terms_of_service); logoutAlert(R.string.failed_to_get_terms_of_service);
} }
private void logoutAlert(int messageRes) { private void logoutAlert(final int messageRes) {
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
...@@ -436,7 +437,22 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity { ...@@ -436,7 +437,22 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity {
AgreementToTermsHelper.AgreementListener listener = new AgreementToTermsHelper.AgreementListener() { AgreementToTermsHelper.AgreementListener listener = new AgreementToTermsHelper.AgreementListener() {
@Override @Override
public void onDisabled() { public void onDisabled() {
onAgreed(); try {
// fixme とってつけたような処理なので、もう少しいい感じのタイミングで処理したい
ContractLogic contractLogic = AbstractLogic.getLogic(ContractLogic.class);
contractLogic.initializeContractServiceOption();
if (ABVDataCache.getInstance().serviceOption.isUsableAgreementToTerms()) {
// サービスオプションが無効としてスルーするという場合には、
// 前回ログインだけしている状態で終了してしまった時に
// サービスオプションが読み込まれていなかったというパターンがあるので、
// 改めて読み込み直して有効だったら、ログアウトする
LogoutHelper.logout(ABVNoAuthenticatedActivity.this);
} else {
onAgreed();
}
} catch (Exception e) {
Logger.e(TAG, e);
}
} }
@Override @Override
......
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