Commit decce445 by Kang Donghun

#73480 通信仕組み改善検証

parent ed09a6a5
......@@ -42,6 +42,7 @@ import jp.agentec.abook.abv.bl.acms.client.json.WorkerGroupJSON;
import jp.agentec.abook.abv.bl.acms.client.parameters.AbstractAcmsLoginParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.AcmsContentParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.AcmsParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.ShopSyncWatermarkParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.AddMemberGroupParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.AppStoreNewLoginParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.ContentReadingLogParameters;
......@@ -981,8 +982,7 @@ public class AcmsClient implements AcmsClientResponseListener {
AcmsApis.ApiSendPushMessage,
AcmsApis.ApiLockReport,
AcmsApis.ApiUnlockReport,
AcmsApis.ApiGetDashboardStatus,
AcmsApis.ApiShopSyncWatermark
AcmsApis.ApiGetDashboardStatus
};
public HttpTaskWorker(String methodName, String apiUrl, T param) {
......@@ -1060,7 +1060,7 @@ public class AcmsClient implements AcmsClientResponseListener {
/**
* DB同期の必要性を判定するウォーターマーク情報を取得する
*/
public ShopSyncWatermarkJSON checkShopSyncWatermark(AcmsParameters param) throws NetworkDisconnectedException, AcmsException {
public ShopSyncWatermarkJSON checkShopSyncWatermark(ShopSyncWatermarkParameters param) throws NetworkDisconnectedException, AcmsException {
HttpResponse response = send(AcmsApis.ApiShopSyncWatermark, param);
return new ShopSyncWatermarkJSON(response.httpResponseBody);
}
......
......@@ -6,7 +6,8 @@ import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.common.exception.JSONValidationException;
/**
* checkapi/shopSyncWatermark/ のレスポンスを変換するクラス
* checkapi/shopSyncWatermark/ のレスポンスを変換するクラス。
* <p>リクエストは {@code screen=OPERATION_LIST}(作業一覧)/{@code REPORT_LIST}(報告・コンテンツ側)で区分する。</p>
*/
public class ShopSyncWatermarkJSON extends AcmsCommonJSON {
public static final String NeedsFullSync = "needsFullSync";
......
package jp.agentec.abook.abv.bl.acms.client.parameters;
import java.net.URLEncoder;
import jp.agentec.abook.abv.bl.common.exception.ABVRuntimeException;
import jp.agentec.adf.util.StringUtil;
/**
* GET checkapi/shopSyncWatermark/?sid=&screen=&lastFetchDate=(任意)
*/
public class ShopSyncWatermarkParameters extends AcmsParameters {
public static final String SCREEN_OPERATION_LIST = "OPERATION_LIST";
public static final String SCREEN_REPORT_LIST = "REPORT_LIST";
private final String screen;
private final String lastFetchDate;
public ShopSyncWatermarkParameters(String sid, String screen, String lastFetchDate) {
super(sid);
this.screen = screen;
this.lastFetchDate = lastFetchDate;
}
@Override
public String toHttpParameterString(String encoding) {
try {
StringBuilder sb = new StringBuilder();
sb.append(URLEncoder.encode("sid", encoding)).append("=")
.append(URLEncoder.encode(getSid(), encoding).replace("+", "%20"));
sb.append("&");
sb.append(URLEncoder.encode("screen", encoding)).append("=")
.append(URLEncoder.encode(screen, encoding).replace("+", "%20"));
if (!StringUtil.isNullOrEmpty(lastFetchDate)) {
sb.append("&");
sb.append(URLEncoder.encode("lastFetchDate", encoding)).append("=")
.append(URLEncoder.encode(lastFetchDate, encoding).replace("+", "%20"));
}
return sb.toString();
} catch (Exception e) {
throw new ABVRuntimeException(e);
}
}
}
......@@ -163,5 +163,12 @@ public interface ServiceOption {
* 利用しない:N(通常)、利用する:Y
*/
int UsableIOReport = 186;
/**
* 事業者オプション:自動同期(CMS側 ON/OFF)
* Y … アプリ設定に「自動同期」を表示し、ユーザーの ON/OFF に従って一覧復帰時の自動同期を行う
* N または未定義 … 設定に項目を出さず、自動同期は常にオフ扱い(新着更新の画面別API自体は事業者共通)
*/
int EnterpriseAutoSync = 187;
}
}
\ No newline at end of file
......@@ -246,7 +246,7 @@ public class ABVDataCache {
}
}
public class ServiceOption {
public class ServiceOption {
public boolean isUndelivarableDelete() {
return isServiceOptionEnable(ServiceOptionId.UndeliverableDelete);
}
......@@ -367,6 +367,15 @@ public class ServiceOption {
public boolean isUnableIOReport() {
return isServiceOptionEnable(ServiceOptionId.UsableIOReport);
}
/**
* {@link ServiceOptionId#EnterpriseAutoSync} が CMS で Y のとき true。
* <p>設定画面で自動同期チェックを表示し、一覧復帰時の自動同期をユーザ設定で許可する前提となる。</p>
*/
public boolean isEnterpriseAutoSyncOptionUsed() {
ServiceOptionDto dto = getServiceOption(ServiceOptionId.EnterpriseAutoSync);
return dto != null && ContractLogic.getBooleanValue(dto.val);
}
}
public void setDiffMinFromUTC(String timeZone) {
......
......@@ -2,8 +2,6 @@ package jp.agentec.abook.abv.bl.data.dao;
import jp.agentec.abook.abv.bl.common.db.Cursor;
import jp.agentec.abook.abv.bl.dto.AcmsDto;
public class AcmsDao extends AbstractDao {
/*package*/ AcmsDao() {
......@@ -41,9 +39,13 @@ public class AcmsDao extends AbstractDao {
if (colnum != -1) {
dto.contentVersionLastFetchDate = cursor.getString(colnum);
}
colnum = cursor.getColumnIndex("shopsyncwatermark_last_fetch_date");
colnum = cursor.getColumnIndex("shopsyncwatermark_operation_list_last_fetch_date");
if (colnum != -1) {
dto.shopSyncWatermarkLastFetchDate = cursor.getString(colnum);
dto.shopSyncWatermarkOperationListLastFetchDate = cursor.getString(colnum);
}
colnum = cursor.getColumnIndex("shopsyncwatermark_report_list_last_fetch_date");
if (colnum != -1) {
dto.shopSyncWatermarkReportListLastFetchDate = cursor.getString(colnum);
}
return dto;
......@@ -58,7 +60,7 @@ public class AcmsDao extends AbstractDao {
}
public void insert(AcmsDto acmsDto) {
insert("insert into m_acms (url_path, acms_address,download_server_address, websocket_server_http_url, websocket_server_ws_url, schedulelist_last_fetch_date, contentversion_last_fetch_date, shopsyncwatermark_last_fetch_date) values (?,?,?,?,?,?,?,?)", acmsDto.getInsertValues());
insert("insert into m_acms (url_path, acms_address,download_server_address, websocket_server_http_url, websocket_server_ws_url, schedulelist_last_fetch_date, contentversion_last_fetch_date, shopsyncwatermark_operation_list_last_fetch_date, shopsyncwatermark_report_list_last_fetch_date) values (?,?,?,?,?,?,?,?,?)", acmsDto.getInsertValues());
}
public boolean isTodayLastAnnounceChangePasswordDate() {
......@@ -88,12 +90,23 @@ public class AcmsDao extends AbstractDao {
return count > 0;
}
public String selectShopSyncWatermarkLastFetchDate() {
return rawQueryGetString("select shopsyncwatermark_last_fetch_date from m_acms order by shopsyncwatermark_last_fetch_date desc limit 1", null);
/** 作業一覧プロファイル用(m_acms.shopsyncwatermark_operation_list_last_fetch_date)。 */
public String selectShopSyncWatermarkOperationListLastFetchDate() {
return rawQueryGetString("select shopsyncwatermark_operation_list_last_fetch_date from m_acms limit 1", null);
}
/** 報告・コンテンツ側プロファイル用(m_acms.shopsyncwatermark_report_list_last_fetch_date)。 */
public String selectShopSyncWatermarkReportListLastFetchDate() {
return rawQueryGetString("select shopsyncwatermark_report_list_last_fetch_date from m_acms limit 1", null);
}
public boolean updateShopSyncWatermarkOperationListLastFetchDate(String fetchDate) {
long count = update("update m_acms set shopsyncwatermark_operation_list_last_fetch_date=?", new Object[]{fetchDate});
return count > 0;
}
public boolean updateShopSyncWatermarkLastFetchDate(String fetchDate) {
long count = update("update m_acms set shopsyncwatermark_last_fetch_date=?", new Object[]{fetchDate});
public boolean updateShopSyncWatermarkReportListLastFetchDate(String fetchDate) {
long count = update("update m_acms set shopsyncwatermark_report_list_last_fetch_date=?", new Object[]{fetchDate});
return count > 0;
}
......
......@@ -29,7 +29,8 @@ public class MAcms extends SQLiteTableScript {
sql.append(" , websocket_server_ws_url VARCHAR(256) ");
sql.append(" , schedulelist_last_fetch_date VARCHAR(256) ");
sql.append(" , contentversion_last_fetch_date VARCHAR(256) ");
sql.append(" , shopsyncwatermark_last_fetch_date VARCHAR(256) ");
sql.append(" , shopsyncwatermark_operation_list_last_fetch_date VARCHAR(256) ");
sql.append(" , shopsyncwatermark_report_list_last_fetch_date VARCHAR(256) ");
sql.append(" , PRIMARY KEY (url_path) ");
sql.append(" ) ");
......@@ -47,7 +48,8 @@ public class MAcms extends SQLiteTableScript {
public List<String> getUpgradeScript(int oldVersion, int newVersion) {
List<String> ddl = new ArrayList<String>();
if (oldVersion < DatabaseVersions.Ver1_0_613) {
ddl.add("ALTER TABLE m_acms ADD COLUMN shopsyncwatermark_last_fetch_date VARCHAR(256)");
ddl.add("ALTER TABLE m_acms ADD COLUMN shopsyncwatermark_operation_list_last_fetch_date VARCHAR(256)");
ddl.add("ALTER TABLE m_acms ADD COLUMN shopsyncwatermark_report_list_last_fetch_date VARCHAR(256)");
}
return ddl;
}
......
package jp.agentec.abook.abv.bl.download;
/**
* 新着更新のAPIセット(画面コンテキスト別)。
* <p>
* 共通(オンライン時・{@link ContentRefresher#refreshContentList} 入口):<br>
* ・checkSid(SID確認)<br>
* ・enqueteReply / contentDownloadLog / contentReadingLog(失敗分の再送・ログ送信)
* </p>
* <p>
* {@link #OPERATION_LIST_SCREEN} … 作業一覧に必要な最小セット(ウォーターマークFull時のワーカー内):<br>
* ・serviceOption({@code initializeContractServiceOption})<br>
* ・workingGroupList(operationList のグループ解釈と揃えるため operationList 取得前に実行)<br>
* ・category<br>
* ・operationGroupMaster<br>
* 完了後: operationList / getPushMessageList({@link jp.agentec.abook.abv.bl.logic.OperationLogic#syncOperationListFromServer} /
* {@link jp.agentec.abook.abv.bl.logic.PushMessageLogic#initializePushMessage})
* </p>
* <p>
* {@link #REPORT_LIST_SCREEN} … 報告・コンテンツ側に必要な最小セット(ウォーターマークFull時のワーカー内):<br>
* ・group<br>
* ・getMasterData<br>
* ・contentVersion({@code retrieveServerContent})<br>
* 完了後: 同上で operationList / プッシュ(一覧と通知をアプリで揃える)
* </p>
* <p>
* {@link #FULL} … 従来の一括(上記をワーカー内ですべて実行し、完了後は {@code initializeOperations})。
* </p>
*/
public enum ContentRefreshApiProfile {
/** ウォーターマークFull時はグループ〜コンテンツ版まで従来どおり一括。 */
FULL,
/** 作業一覧由来。 */
OPERATION_LIST_SCREEN,
/** 報告・閲覧コンテンツ由来。 */
REPORT_LIST_SCREEN
}
......@@ -8,7 +8,8 @@ public class AcmsDto extends AbstractDto {
public String websocketServerWsUrl;
public String contentVersionLastFetchDate; // 保存のみ、内部で比較しない
public String scheduleListLastFetchDate; // 保存のみ、内部で比較しない
public String shopSyncWatermarkLastFetchDate; // DB同期判定用の最終取得日時
public String shopSyncWatermarkOperationListLastFetchDate;
public String shopSyncWatermarkReportListLastFetchDate;
public AcmsDto() {
}
......@@ -21,7 +22,8 @@ public class AcmsDto extends AbstractDto {
this.websocketServerWsUrl = websocketServerWsUrl;
this.contentVersionLastFetchDate = "";
this.scheduleListLastFetchDate = "";
this.shopSyncWatermarkLastFetchDate = "";
this.shopSyncWatermarkOperationListLastFetchDate = "";
this.shopSyncWatermarkReportListLastFetchDate = "";
}
@Override
......@@ -31,7 +33,7 @@ public class AcmsDto extends AbstractDto {
@Override
public Object[] getInsertValues() {
return new Object[]{urlPath, acmsAddress, downloadServerAddress, websocketServerHttpUrl, websocketServerWsUrl, scheduleListLastFetchDate, contentVersionLastFetchDate, shopSyncWatermarkLastFetchDate};
return new Object[]{urlPath, acmsAddress, downloadServerAddress, websocketServerHttpUrl, websocketServerWsUrl, scheduleListLastFetchDate, contentVersionLastFetchDate, shopSyncWatermarkOperationListLastFetchDate, shopSyncWatermarkReportListLastFetchDate};
}
}
......@@ -91,6 +91,32 @@ public class OperationLogic extends AbstractLogic {
private TaskWorkerGroupDao mTaskWorkerGroupDao = AbstractDao.getDao(TaskWorkerGroupDao.class);
private static final int FINISHED_STATUS = 999;
/** 一覧バッチ同期時、直近同期からこの時間未満の作業は間隔条件により除外できる(ms)。 */
private static final int INTERVAL_LAST_EDIT_TIME_MS = 1800000;
private boolean isEnableTimeForAutoSync(Date lastEditDateTime) {
Date currentDateTime = DateTimeUtil.getCurrentDate();
if (lastEditDateTime == null) {
return true;
}
long diffInMillis = currentDateTime.getTime() - lastEditDateTime.getTime();
return diffInMillis >= INTERVAL_LAST_EDIT_TIME_MS;
}
/**
* operationLastSyncDate に基づき、自動同期の間隔条件を満たす needSync 作業だけを残す。
*/
public List<OperationDto> needSyncCheckArray(List<OperationDto> needSyncOperationInfoArray) {
List<OperationDto> needSyncCheckArray = new ArrayList<>();
for (OperationDto operationDto : needSyncOperationInfoArray) {
if (isEnableTimeForAutoSync(operationDto.operationLastSyncDate)) {
needSyncCheckArray.add(operationDto);
}
}
return needSyncCheckArray;
}
public void initializeOperations() throws AcmsException, NetworkDisconnectedException {
// 作業グループリスト取得
setWorkingGroupList();
......@@ -100,6 +126,20 @@ public class OperationLogic extends AbstractLogic {
}
/**
* workingGroupList API のみ(作業一覧側・FULL 新着のワーカーで operationList より先に実行)。
*/
public void syncWorkingGroupsFromServer() throws NetworkDisconnectedException, AcmsException {
setWorkingGroupList();
}
/**
* operationList API のみ(新着完了後の一覧同期。workingGroupList は別途 {@link #syncWorkingGroupsFromServer})。
*/
public void syncOperationListFromServer() throws AcmsException, NetworkDisconnectedException {
retrieveServerOperation();
}
/**
* プロジェクト一覧取得し、登録・更新・削除する
*
* @throws AcmsException
......
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:key="pref_screen_root" >
<PreferenceCategory android:title="@string/account" android:key="account_set">
<PreferenceScreen
......@@ -68,4 +69,13 @@
android:title="@string/spp_machine" >
</PreferenceScreen>
</PreferenceCategory>
<PreferenceCategory
android:key="operation_sync_category"
android:title="@string/auto_sync" >
<CheckBoxPreference
android:defaultValue="false"
android:key="operationAutoSync"
android:summary="@string/auto_sync_setting_subtitle"
android:title="@string/auto_sync_setting_title" />
</PreferenceCategory>
</PreferenceScreen>
\ No newline at end of file
......@@ -73,6 +73,7 @@ import jp.agentec.abook.abv.bl.data.dao.MemberInfoDao;
import jp.agentec.abook.abv.bl.download.ContentDownloadListener;
import jp.agentec.abook.abv.bl.download.ContentDownloader;
import jp.agentec.abook.abv.bl.download.ContentFileExtractor;
import jp.agentec.abook.abv.bl.download.ContentRefreshApiProfile;
import jp.agentec.abook.abv.bl.download.ContentRefresher;
import jp.agentec.abook.abv.bl.download.ContentZipDownloadNotification;
import jp.agentec.abook.abv.bl.dto.ContentDto;
......@@ -128,6 +129,14 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
protected ContentDownloader contentDownloader = ContentDownloader.getInstance();
protected ContentRefresher contentRefresher = ContentRefresher.getInstance();
/**
* {@link ContentRefreshApiProfile}。デフォルトは従来一括(FULL)。
* @see jp.agentec.abook.abv.bl.download.ContentRefreshApiProfile
*/
protected ContentRefreshApiProfile getContentRefreshApiProfile() {
return ContentRefreshApiProfile.FULL;
}
private ExecutorService initilizeExecutor = Executors.newFixedThreadPool(2); // DL後の初期化専用
protected ImageButton btnDownload;
......
......@@ -50,6 +50,7 @@ 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.TaskReportDao;
import jp.agentec.abook.abv.bl.download.ContentFileExtractor;
import jp.agentec.abook.abv.bl.download.ContentRefreshApiProfile;
import jp.agentec.abook.abv.bl.dto.ContentDto;
import jp.agentec.abook.abv.bl.dto.MydataDto;
import jp.agentec.abook.abv.bl.dto.OperationDto;
......@@ -97,6 +98,12 @@ import static jp.agentec.abook.abv.bl.acms.client.json.OperationDataJSON.TaskRep
public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
private static final String TAG ="ABVContentViewActivity";
/** 報告・閲覧コンテンツ側の新着更新は画面別APIセット(事業者共通)。 */
@Override
protected ContentRefreshApiProfile getContentRefreshApiProfile() {
return ContentRefreshApiProfile.REPORT_LIST_SCREEN;
}
public final static int ABOOK_CHECK_TASK_IMAGE = 103;
public final static int ABOOK_CHECK_TASK_VIDEO = 104;
protected final static int ABOOK_CHECK_SELECT_SCENE = 105;
......
......@@ -168,7 +168,7 @@ public abstract class ABVUIActivity extends ABVAuthenticatedActivity {
// contentDownloadObserverがnullだと更新マークのアニメーションが完了しない TODO 2014/11/12 Jang
// onCreateでrefresh処理をcallしたときに起きる
contentRefresher.refreshContentList(this);
contentRefresher.refreshContentList(this, getContentRefreshApiProfile());
}
} catch (NetworkDisconnectedException e) {
refreshContentException();
......
......@@ -25,6 +25,8 @@ public interface AppDefType {
String CURSOR_ENABLE = "cursorEnable";
String DISPLAY_MARKING = "displayMarking";
String APP_VERSIONUP_PROCESSING = "appVersionProcessingFlag";
/** 作業一覧の自動同期(DefaultSharedPreferences・事業者オプション187がYのときのみ設定に表示) */
String OPERATION_AUTO_SYNC = "operationAutoSync";
}
interface UserPrefKey {
......
......@@ -17,9 +17,9 @@ import android.os.Environment;
import android.os.Handler;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceClickListener;
import android.preference.PreferenceCategory;
import android.preference.PreferenceFragment;
import android.preference.PreferenceGroup;
import android.preference.PreferenceManager;
import android.preference.PreferenceScreen;
import android.view.LayoutInflater;
import android.view.View;
......@@ -83,24 +83,24 @@ public class ABookSettingFragment extends PreferenceFragment {
protected Handler handler = new Handler();
protected AlertDialog alertDialog = null;
private SharedPreferences pref;
// 機器連携(ペアリング)
private static final String SET_CHINO_PAIRING = "setChinoPairing"; // CHINO機器
private static final String SET_SPP_PAIRING = "setSppPairing"; // SPP通信機器
private static final String OPERATION_SYNC_CATEGORY = "operation_sync_category";
private PreferenceCategory operationSyncCategory;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
handler = new Handler();
pref = PreferenceManager.getDefaultSharedPreferences(getActivity());
// 設定XMLから削除した CheckBox(operationAutoSync)の残キーを掃除
if (pref.contains("operationAutoSync")) {
pref.edit().remove("operationAutoSync").apply();
}
addPreferencesFromResource(R.xml.pref);
operationSyncCategory = (PreferenceCategory) findPreference(OPERATION_SYNC_CATEGORY);
applyOperationAutoSyncCategoryVisibility();
// アカウント
setAccountSetting();
// ログ情報
......@@ -121,6 +121,27 @@ public class ABookSettingFragment extends PreferenceFragment {
@Override
public void onResume() {
super.onResume();
applyOperationAutoSyncCategoryVisibility();
}
/**
* 事業者オプション187(自動同期)が CMS で Y のときのみ「自動同期」設定を表示する。
*/
private void applyOperationAutoSyncCategoryVisibility() {
if (operationSyncCategory == null || getPreferenceScreen() == null) {
return;
}
PreferenceScreen root = getPreferenceScreen();
boolean show = ABVDataCache.getInstance().serviceOption.isEnterpriseAutoSyncOptionUsed();
if (show) {
if (operationSyncCategory.getParent() == null) {
root.addPreference(operationSyncCategory);
}
} else {
if (operationSyncCategory.getParent() != null) {
root.removePreference(operationSyncCategory);
}
}
}
@Override
......
......@@ -102,6 +102,9 @@ public class DashboardActivity extends OperationActivity {
public void onClick(View v) {
Logger.d(TAG, "ReloadUrl");
webView.loadUrl(DASHBOARD_URL);
if (ABVEnvironment.getInstance().networkAdapter.isNetworkConnected()) {
dataRefresh(true);
}
}
});
......
......@@ -18,6 +18,7 @@ import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.data.ABVDataCache;
import jp.agentec.abook.abv.bl.dto.PushMessageDto;
import jp.agentec.abook.abv.bl.download.ContentRefreshApiProfile;
import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.PushMessageLogic;
import jp.agentec.abook.abv.launcher.android.R;
......@@ -36,6 +37,12 @@ import jp.agentec.adf.util.DateTimeUtil;
public class OperationActivity extends ABVUIActivity {
@SuppressWarnings("unused")
private static final String TAG = "OperationActivity";
/** 作業一覧ツールバー由来の新着更新は画面別APIセット(事業者共通)。 */
@Override
protected ContentRefreshApiProfile getContentRefreshApiProfile() {
return ContentRefreshApiProfile.OPERATION_LIST_SCREEN;
}
protected ImageButton mOperationHomeButton; // ホームボタン
protected ImageButton mDashboardButton; // ダッシュボード
protected ImageButton mCommonContentButton; // 関連資料
......@@ -103,10 +110,16 @@ public class OperationActivity extends ABVUIActivity {
}
}
/** 作業一覧へ戻る。SO187 で表示される「自動同期」がオンなら新着+一覧同期、オフまたは187無効なら新着のみ。 */
private void backHome() {
Intent intent = new Intent();
intent.setClass(this, OperationListActivity.class);
if (ABVEnvironment.getInstance().networkAdapter.isNetworkConnected()
&& OperationListActivity.isUnscopedAutoSyncAllowed(this)) {
intent.putExtra(OperationListActivity.EXTRA_RESUME_MODE, OperationListActivity.RESUME_REFRESH_AND_BATCH);
} else {
intent.putExtra(OperationListActivity.EXTRA_RESUME_MODE, OperationListActivity.RESUME_NEW_CONTENT_ONLY);
}
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(intent);
}
......
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