Commit d3aea6cc by Kazuyuki Hida

不要なコードを削除

parent 9ae2850b
...@@ -63,9 +63,6 @@ import jp.agentec.adf.util.StringUtil; ...@@ -63,9 +63,6 @@ import jp.agentec.adf.util.StringUtil;
public abstract class ABVNoAuthenticatedActivity extends ABVActivity { public abstract class ABVNoAuthenticatedActivity extends ABVActivity {
private static final String TAG = "ABVNoAuthenticatedActivity"; private static final String TAG = "ABVNoAuthenticatedActivity";
private static final int REQUEST_AGREEMENT = 120391; // ユニークで適当な値
private static final int REQUEST_AGREEMENT_FROM_LOGIN = 120392; // ユニークで適当な値
private final Context mContext = ABVNoAuthenticatedActivity.this; private final Context mContext = ABVNoAuthenticatedActivity.this;
@Override @Override
...@@ -475,35 +472,9 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity { ...@@ -475,35 +472,9 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity {
doMoveToHome(); doMoveToHome();
} }
}; };
AgreementToTermsHelper.clearVersion(this); // for debug
AgreementToTermsHelper.confirmAgreement(this, isNormalSize(), listener); AgreementToTermsHelper.confirmAgreement(this, isNormalSize(), listener);
} }
@Override
protected void onActivityResult( int requestCode, int resultCode, Intent data ) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == REQUEST_AGREEMENT) {
if (resultCode == RESULT_OK) {
// 同意したら初期化
doMoveToHome();
} else {
// 規約に同意しなかったので、ログアウト
LogoutHelper.logout(this);
}
}
if (requestCode == REQUEST_AGREEMENT_FROM_LOGIN) {
if (resultCode == RESULT_OK) {
// 同意したら初期化
doShowMainActivity();
} else {
// 規約に同意しなかったので、ログアウト
LogoutHelper.logout(this);
}
}
}
private void doMoveToHome() { private void doMoveToHome() {
Bundle extras = getIntent().getExtras(); Bundle extras = getIntent().getExtras();
Intent intent = new Intent(); Intent intent = new Intent();
......
...@@ -63,7 +63,7 @@ public class AgreementToTermsHelper { ...@@ -63,7 +63,7 @@ public class AgreementToTermsHelper {
CommonExecutor.execute(new Runnable() { CommonExecutor.execute(new Runnable() {
@Override @Override
public void run() { public void run() {
AgreementToTermsJSON termsJSON = null; AgreementToTermsJSON termsJSON;
try { try {
AgreementToTermsLogic logic = AbstractLogic.getLogic(AgreementToTermsLogic.class); AgreementToTermsLogic logic = AbstractLogic.getLogic(AgreementToTermsLogic.class);
termsJSON = logic.getTerms(); termsJSON = logic.getTerms();
...@@ -75,13 +75,8 @@ public class AgreementToTermsHelper { ...@@ -75,13 +75,8 @@ public class AgreementToTermsHelper {
if (getLatestVersion(context).equals(termsJSON.getTermsVersion())) { if (getLatestVersion(context).equals(termsJSON.getTermsVersion())) {
// 規約のバージョンが、すでに同意しているものと同じときは表示しない // 規約のバージョンが、すでに同意しているものと同じときは表示しない
listener.onAgreed(); listener.onAgreed();
return;
} }
} catch (Exception e) {
Logger.e(TAG, e);
// 取得に失敗した場合
listener.onFailed(e);
} finally {
assert termsJSON != null; // nullなら onEmpty()に流れているはず
final AgreementToTermsJSON termsJSON1 = termsJSON; final AgreementToTermsJSON termsJSON1 = termsJSON;
context.runOnUiThread(new Runnable() { context.runOnUiThread(new Runnable() {
@Override @Override
...@@ -91,6 +86,10 @@ public class AgreementToTermsHelper { ...@@ -91,6 +86,10 @@ public class AgreementToTermsHelper {
showAgreementDialog(context, termsJSON1, isNomalSize, listener); showAgreementDialog(context, termsJSON1, isNomalSize, listener);
} }
}); });
} catch (Exception e) {
Logger.e(TAG, e);
// 取得に失敗した場合
listener.onFailed(e);
} }
} }
}); });
...@@ -253,13 +252,4 @@ public class AgreementToTermsHelper { ...@@ -253,13 +252,4 @@ public class AgreementToTermsHelper {
private static void setLatestVersion(Context context, String version) { private static void setLatestVersion(Context context, String version) {
PreferenceUtil.putUserPref(context, ABookKeys.AGREEMENT_TO_TERMS_VERSION, version); PreferenceUtil.putUserPref(context, ABookKeys.AGREEMENT_TO_TERMS_VERSION, version);
} }
/**
* バージョン情報のクリア(後で消す)
*
* @param context コンテクスト
*/
public static void clearVersion(Context context) {
PreferenceUtil.removeUserPref(context, ABookKeys.AGREEMENT_TO_TERMS_VERSION);
}
} }
...@@ -38,16 +38,12 @@ app_versioncode=1 ...@@ -38,16 +38,12 @@ app_versioncode=1
# abvEnvironments.xml # abvEnvironments.xml
#cms server #cms server
#acms_address=https://chatdev2.agentec.jp/acms acms_address=https://chatdev2.agentec.jp/acms
#download_server_address=https://chatdev2.agentec.jp/acms download_server_address=https://chatdev2.agentec.jp/acms
acms_address=https://check130.abook.bz/acms
download_server_address=https://check130.abook.bz/acms
#syncview server #syncview server
#websocket_server_http_url=https://check130.agentec.jp/v1 websocket_server_http_url=https://check130.agentec.jp/v1
#websocket_server_ws_url=wss://check130.agentec.jp/v1 websocket_server_ws_url=wss://check130.agentec.jp/v1
websocket_server_http_url=https://check130.abook.bz:10443/v1
websocket_server_ws_url=wss://check130.abook.bz:10443/v1
#WebSocket debug出力 #WebSocket debug出力
websocket_debug=false websocket_debug=false
......
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