@ -47,7 +47,7 @@ import java.util.HashSet;
import java.util.Iterator ;
import java.util.Map ;
// 这是一个管理Google任务同步的类
public class GTaskManager {
private static final String TAG = GTaskManager . class . getSimpleName ( ) ;
@ -87,6 +87,7 @@ public class GTaskManager {
private HashMap < Long , String > mNidToGid ;
// 私有构造函数,防止外部实例化
private GTaskManager ( ) {
mSyncing = false ;
mCancelled = false ;
@ -99,6 +100,7 @@ public class GTaskManager {
mNidToGid = new HashMap < Long , String > ( ) ;
}
// 获取GTaskManager的单例实例
public static synchronized GTaskManager getInstance ( ) {
if ( mInstance = = null ) {
mInstance = new GTaskManager ( ) ;
@ -106,11 +108,12 @@ public class GTaskManager {
return mInstance ;
}
// 设置活动上下文,用于获取认证令牌
public synchronized void setActivityContext ( Activity activity ) {
// used for getting authtoken
mActivity = activity ;
}
// 同步Google任务与本地数据库
public int sync ( Context context , GTaskASyncTask asyncTask ) {
if ( mSyncing ) {
Log . d ( TAG , "Sync is in progress" ) ;
@ -131,18 +134,18 @@ public class GTaskManager {
GTaskClient client = GTaskClient . getInstance ( ) ;
client . resetUpdateArray ( ) ;
// login google task
// 登录Google任务
if ( ! mCancelled ) {
if ( ! client . login ( mActivity ) ) {
throw new NetworkFailureException ( "login google task failed" ) ;
}
}
// get the task list from google
// 从Google获取任务列表
asyncTask . publishProgess ( mContext . getString ( R . string . sync_progress_init_list ) ) ;
initGTaskList ( ) ;
// do content sync work
// 同步内容
asyncTask . publishProgess ( mContext . getString ( R . string . sync_progress_syncing ) ) ;
syncContent ( ) ;
} catch ( NetworkFailureException e ) {
@ -168,6 +171,7 @@ public class GTaskManager {
return mCancelled ? STATE_SYNC_CANCELLED : STATE_SUCCESS ;
}
// 初始化Google任务列表
private void initGTaskList ( ) throws NetworkFailureException {
if ( mCancelled )
return ;
@ -175,19 +179,18 @@ public class GTaskManager {
try {
JSONArray jsTaskLists = client . getTaskLists ( ) ;
// init meta list first
// 初始化元数据列表
mMetaList = null ;
for ( int i = 0 ; i < jsTaskLists . length ( ) ; i + + ) {
JSONObject object = jsTaskLists . getJSONObject ( i ) ;
String gid = object . getString ( GTaskStringUtils . GTASK_JSON_ID ) ;
String name = object . getString ( GTaskStringUtils . GTASK_JSON_NAME ) ;
if ( name
. equals ( GTaskStringUtils . MIUI_FOLDER_PREFFIX + GTaskStringUtils . FOLDER_META ) ) {
if ( name . equals ( GTaskStringUtils . MIUI_FOLDER_PREFFIX + GTaskStringUtils . FOLDER_META ) ) {
mMetaList = new TaskList ( ) ;
mMetaList . setContentByRemoteJSON ( object ) ;
// load meta data
// 加载元数据
JSONArray jsMetas = client . getTaskList ( gid ) ;
for ( int j = 0 ; j < jsMetas . length ( ) ; j + + ) {
object = ( JSONObject ) jsMetas . getJSONObject ( j ) ;
@ -203,29 +206,26 @@ public class GTaskManager {
}
}
// create meta list if not existed
// 如果元数据列表不存在则创建
if ( mMetaList = = null ) {
mMetaList = new TaskList ( ) ;
mMetaList . setName ( GTaskStringUtils . MIUI_FOLDER_PREFFIX
+ GTaskStringUtils . FOLDER_META ) ;
mMetaList . setName ( GTaskStringUtils . MIUI_FOLDER_PREFFIX + GTaskStringUtils . FOLDER_META ) ;
GTaskClient . getInstance ( ) . createTaskList ( mMetaList ) ;
}
// init task list
// 初始化任务列表
for ( int i = 0 ; i < jsTaskLists . length ( ) ; i + + ) {
JSONObject object = jsTaskLists . getJSONObject ( i ) ;
String gid = object . getString ( GTaskStringUtils . GTASK_JSON_ID ) ;
String name = object . getString ( GTaskStringUtils . GTASK_JSON_NAME ) ;
if ( name . startsWith ( GTaskStringUtils . MIUI_FOLDER_PREFFIX )
& & ! name . equals ( GTaskStringUtils . MIUI_FOLDER_PREFFIX
+ GTaskStringUtils . FOLDER_META ) ) {
if ( name . startsWith ( GTaskStringUtils . MIUI_FOLDER_PREFFIX ) & & ! name . equals ( GTaskStringUtils . MIUI_FOLDER_PREFFIX + GTaskStringUtils . FOLDER_META ) ) {
TaskList tasklist = new TaskList ( ) ;
tasklist . setContentByRemoteJSON ( object ) ;
mGTaskListHashMap . put ( gid , tasklist ) ;
mGTaskHashMap . put ( gid , tasklist ) ;
// load tasks
// 加载任务
JSONArray jsTasks = client . getTaskList ( gid ) ;
for ( int j = 0 ; j < jsTasks . length ( ) ; j + + ) {
object = ( JSONObject ) jsTasks . getJSONObject ( j ) ;
@ -247,6 +247,7 @@ public class GTaskManager {
}
}
// 同步内容到Google任务或本地数据库
private void syncContent ( ) throws NetworkFailureException {
int syncType ;
Cursor c = null ;
@ -259,12 +260,9 @@ public class GTaskManager {
return ;
}
// for local deleted note
// 同步本地删除的笔记
try {
c = mContentResolver . query ( Notes . CONTENT_NOTE_URI , SqlNote . PROJECTION_NOTE ,
"(type<>? AND parent_id=?)" , new String [ ] {
String . valueOf ( Notes . TYPE_SYSTEM ) , String . valueOf ( Notes . ID_TRASH_FOLER )
} , null ) ;
c = mContentResolver . query ( Notes . CONTENT_NOTE_URI , SqlNote . PROJECTION_NOTE , "(type<>? AND parent_id=?)" , new String [ ] { String . valueOf ( Notes . TYPE_SYSTEM ) , String . valueOf ( Notes . ID_TRASH_FOLER ) } , null ) ;
if ( c ! = null ) {
while ( c . moveToNext ( ) ) {
gid = c . getString ( SqlNote . GTASK_ID_COLUMN ) ;
@ -286,15 +284,12 @@ public class GTaskManager {
}
}
// sync folder first
// 同步文件夹
syncFolder ( ) ;
// for note existing in database
// 同步本地存在的笔记
try {
c = mContentResolver . query ( Notes . CONTENT_NOTE_URI , SqlNote . PROJECTION_NOTE ,
"(type=? AND parent_id<>?)" , new String [ ] {
String . valueOf ( Notes . TYPE_NOTE ) , String . valueOf ( Notes . ID_TRASH_FOLER )
} , NoteColumns . TYPE + " DESC" ) ;
c = mContentResolver . query ( Notes . CONTENT_NOTE_URI , SqlNote . PROJECTION_NOTE , "(type=? AND parent_id<>?)" , new String [ ] { String . valueOf ( Notes . TYPE_NOTE ) , String . valueOf ( Notes . ID_TRASH_FOLER ) } , NoteColumns . TYPE + " DESC" ) ;
if ( c ! = null ) {
while ( c . moveToNext ( ) ) {
gid = c . getString ( SqlNote . GTASK_ID_COLUMN ) ;
@ -306,10 +301,10 @@ public class GTaskManager {
syncType = node . getSyncAction ( c ) ;
} else {
if ( c . getString ( SqlNote . GTASK_ID_COLUMN ) . trim ( ) . length ( ) = = 0 ) {
// local add
// 本地新增
syncType = Node . SYNC_ACTION_ADD_REMOTE ;
} else {
// remote delete
// 远程删除
syncType = Node . SYNC_ACTION_DEL_LOCAL ;
}
}
@ -326,7 +321,7 @@ public class GTaskManager {
}
}
// go through remaining items
// 同步剩余的Google任务
Iterator < Map . Entry < String , Node > > iter = mGTaskHashMap . entrySet ( ) . iterator ( ) ;
while ( iter . hasNext ( ) ) {
Map . Entry < String , Node > entry = iter . next ( ) ;
@ -334,16 +329,14 @@ public class GTaskManager {
doContentSync ( Node . SYNC_ACTION_ADD_LOCAL , node , null ) ;
}
// mCancelled can be set by another thread, so we neet to check one by
// one
// clear local delete table
// 清除本地删除的条目
if ( ! mCancelled ) {
if ( ! DataUtils . batchDeleteNotes ( mContentResolver , mLocalDeleteIdMap ) ) {
throw new ActionFailureException ( "failed to batch-delete local deleted notes" ) ;
}
}
// refresh local sync id
// 刷新本地同步ID
if ( ! mCancelled ) {
GTaskClient . getInstance ( ) . commitUpdate ( ) ;
refreshLocalSyncId ( ) ;
@ -351,6 +344,7 @@ public class GTaskManager {
}
// 同步文件夹到Google任务或本地数据库
private void syncFolder ( ) throws NetworkFailureException {
Cursor c = null ;
String gid ;
@ -361,10 +355,9 @@ public class GTaskManager {
return ;
}
// for root folder
// 同步根文件夹
try {
c = mContentResolver . query ( ContentUris . withAppendedId ( Notes . CONTENT_NOTE_URI ,
Notes . ID_ROOT_FOLDER ) , SqlNote . PROJECTION_NOTE , null , null , null ) ;
c = mContentResolver . query ( ContentUris . withAppendedId ( Notes . CONTENT_NOTE_URI , Notes . ID_ROOT_FOLDER ) , SqlNote . PROJECTION_NOTE , null , null , null ) ;
if ( c ! = null ) {
c . moveToNext ( ) ;
gid = c . getString ( SqlNote . GTASK_ID_COLUMN ) ;
@ -373,9 +366,8 @@ public class GTaskManager {
mGTaskHashMap . remove ( gid ) ;
mGidToNid . put ( gid , ( long ) Notes . ID_ROOT_FOLDER ) ;
mNidToGid . put ( ( long ) Notes . ID_ROOT_FOLDER , gid ) ;
// for system folder, only update remote name if necessary
if ( ! node . getName ( ) . equals (
GTaskStringUtils . MIUI_FOLDER_PREFFIX + GTaskStringUtils . FOLDER_DEFAULT ) )
// 更新远程名称(如果需要)
if ( ! node . getName ( ) . equals ( GTaskStringUtils . MIUI_FOLDER_PREFFIX + GTaskStringUtils . FOLDER_DEFAULT ) )
doContentSync ( Node . SYNC_ACTION_UPDATE_REMOTE , node , c ) ;
} else {
doContentSync ( Node . SYNC_ACTION_ADD_REMOTE , node , c ) ;
@ -390,12 +382,9 @@ public class GTaskManager {
}
}
// for call-note folder
// 同步通话记录文件夹
try {
c = mContentResolver . query ( Notes . CONTENT_NOTE_URI , SqlNote . PROJECTION_NOTE , "(_id=?)" ,
new String [ ] {
String . valueOf ( Notes . ID_CALL_RECORD_FOLDER )
} , null ) ;
c = mContentResolver . query ( Notes . CONTENT_NOTE_URI , SqlNote . PROJECTION_NOTE , "(_id=?)" , new String [ ] { String . valueOf ( Notes . ID_CALL_RECORD_FOLDER ) } , null ) ;
if ( c ! = null ) {
if ( c . moveToNext ( ) ) {
gid = c . getString ( SqlNote . GTASK_ID_COLUMN ) ;
@ -404,11 +393,8 @@ public class GTaskManager {
mGTaskHashMap . remove ( gid ) ;
mGidToNid . put ( gid , ( long ) Notes . ID_CALL_RECORD_FOLDER ) ;
mNidToGid . put ( ( long ) Notes . ID_CALL_RECORD_FOLDER , gid ) ;
// for system folder, only update remote name if
// necessary
if ( ! node . getName ( ) . equals (
GTaskStringUtils . MIUI_FOLDER_PREFFIX
+ GTaskStringUtils . FOLDER_CALL_NOTE ) )
// 更新远程名称(如果需要)
if ( ! node . getName ( ) . equals ( GTaskStringUtils . MIUI_FOLDER_PREFFIX + GTaskStringUtils . FOLDER_CALL_NOTE ) )
doContentSync ( Node . SYNC_ACTION_UPDATE_REMOTE , node , c ) ;
} else {
doContentSync ( Node . SYNC_ACTION_ADD_REMOTE , node , c ) ;
@ -424,12 +410,9 @@ public class GTaskManager {
}
}
// for local existing folders
// 同步本地存在的文件夹
try {
c = mContentResolver . query ( Notes . CONTENT_NOTE_URI , SqlNote . PROJECTION_NOTE ,
"(type=? AND parent_id<>?)" , new String [ ] {
String . valueOf ( Notes . TYPE_FOLDER ) , String . valueOf ( Notes . ID_TRASH_FOLER )
} , NoteColumns . TYPE + " DESC" ) ;
c = mContentResolver . query ( Notes . CONTENT_NOTE_URI , SqlNote . PROJECTION_NOTE , "(type=? AND parent_id<>?)" , new String [ ] { String . valueOf ( Notes . TYPE_FOLDER ) , String . valueOf ( Notes . ID_TRASH_FOLER ) } , NoteColumns . TYPE + " DESC" ) ;
if ( c ! = null ) {
while ( c . moveToNext ( ) ) {
gid = c . getString ( SqlNote . GTASK_ID_COLUMN ) ;
@ -441,10 +424,10 @@ public class GTaskManager {
syncType = node . getSyncAction ( c ) ;
} else {
if ( c . getString ( SqlNote . GTASK_ID_COLUMN ) . trim ( ) . length ( ) = = 0 ) {
// local add
// 本地新增
syncType = Node . SYNC_ACTION_ADD_REMOTE ;
} else {
// remote delete
// 远程删除
syncType = Node . SYNC_ACTION_DEL_LOCAL ;
}
}
@ -460,7 +443,7 @@ public class GTaskManager {
}
}
// for remote add folders
// 同步远程新增的文件夹
Iterator < Map . Entry < String , TaskList > > iter = mGTaskListHashMap . entrySet ( ) . iterator ( ) ;
while ( iter . hasNext ( ) ) {
Map . Entry < String , TaskList > entry = iter . next ( ) ;
@ -476,6 +459,7 @@ public class GTaskManager {
GTaskClient . getInstance ( ) . commitUpdate ( ) ;
}
// 执行内容同步操作
private void doContentSync ( int syncType , Node node , Cursor c ) throws NetworkFailureException {
if ( mCancelled ) {
return ;
@ -510,8 +494,8 @@ public class GTaskManager {
updateRemoteNode ( node , c ) ;
break ;
case Node . SYNC_ACTION_UPDATE_CONFLICT :
// merging both modifications maybe a good idea
// right now just use local update simply
// 合并修改可能是更好的做法
// 目前我们简单地使用本地更新
updateRemoteNode ( node , c ) ;
break ;
case Node . SYNC_ACTION_NONE :
@ -522,6 +506,7 @@ public class GTaskManager {
}
}
// 在本地添加Google任务节点
private void addLocalNode ( Node node ) throws NetworkFailureException {
if ( mCancelled ) {
return ;
@ -529,11 +514,9 @@ public class GTaskManager {
SqlNote sqlNote ;
if ( node instanceof TaskList ) {
if ( node . getName ( ) . equals (
GTaskStringUtils . MIUI_FOLDER_PREFFIX + GTaskStringUtils . FOLDER_DEFAULT ) ) {
if ( node . getName ( ) . equals ( GTaskStringUtils . MIUI_FOLDER_PREFFIX + GTaskStringUtils . FOLDER_DEFAULT ) ) {
sqlNote = new SqlNote ( mContext , Notes . ID_ROOT_FOLDER ) ;
} else if ( node . getName ( ) . equals (
GTaskStringUtils . MIUI_FOLDER_PREFFIX + GTaskStringUtils . FOLDER_CALL_NOTE ) ) {
} else if ( node . getName ( ) . equals ( GTaskStringUtils . MIUI_FOLDER_PREFFIX + GTaskStringUtils . FOLDER_CALL_NOTE ) ) {
sqlNote = new SqlNote ( mContext , Notes . ID_CALL_RECORD_FOLDER ) ;
} else {
sqlNote = new SqlNote ( mContext ) ;
@ -549,7 +532,7 @@ public class GTaskManager {
if ( note . has ( NoteColumns . ID ) ) {
long id = note . getLong ( NoteColumns . ID ) ;
if ( DataUtils . existInNoteDatabase ( mContentResolver , id ) ) {
// the id is not available, have to create a new one
// ID不可用, 必须创建一个新的
note . remove ( NoteColumns . ID ) ;
}
}
@ -562,8 +545,7 @@ public class GTaskManager {
if ( data . has ( DataColumns . ID ) ) {
long dataId = data . getLong ( DataColumns . ID ) ;
if ( DataUtils . existInDataDatabase ( mContentResolver , dataId ) ) {
// the data id is not available, have to create
// a new one
// Data ID不可用, 必须创建一个新的
data . remove ( DataColumns . ID ) ;
}
}
@ -584,30 +566,30 @@ public class GTaskManager {
sqlNote . setParentId ( parentId . longValue ( ) ) ;
}
// create the local node
// 创建本地节点
sqlNote . setGtaskId ( node . getGid ( ) ) ;
sqlNote . commit ( false ) ;
// update gid-nid mapping
// 更新GID-NID映射
mGidToNid . put ( node . getGid ( ) , sqlNote . getId ( ) ) ;
mNidToGid . put ( sqlNote . getId ( ) , node . getGid ( ) ) ;
// update meta
// 更新元数据
updateRemoteMeta ( node . getGid ( ) , sqlNote ) ;
}
// 更新本地Google任务节点
private void updateLocalNode ( Node node , Cursor c ) throws NetworkFailureException {
if ( mCancelled ) {
return ;
}
SqlNote sqlNote ;
// update the note locally
// 更新本地笔记
sqlNote = new SqlNote ( mContext , c ) ;
sqlNote . setContent ( node . getLocalJSONFromContent ( ) ) ;
Long parentId = ( node instanceof Task ) ? mGidToNid . get ( ( ( Task ) node ) . getParent ( ) . getGid ( ) )
: new Long ( Notes . ID_ROOT_FOLDER ) ;
Long parentId = ( node instanceof Task ) ? mGidToNid . get ( ( ( Task ) node ) . getParent ( ) . getGid ( ) ) : new Long ( Notes . ID_ROOT_FOLDER ) ;
if ( parentId = = null ) {
Log . e ( TAG , "cannot find task's parent id locally" ) ;
throw new ActionFailureException ( "cannot update local node" ) ;
@ -615,10 +597,11 @@ public class GTaskManager {
sqlNote . setParentId ( parentId . longValue ( ) ) ;
sqlNote . commit ( true ) ;
// update meta info
// 更新元数据信息
updateRemoteMeta ( node . getGid ( ) , sqlNote ) ;
}
// 在Google任务中添加新的节点
private void addRemoteNode ( Node node , Cursor c ) throws NetworkFailureException {
if ( mCancelled ) {
return ;
@ -627,7 +610,7 @@ public class GTaskManager {
SqlNote sqlNote = new SqlNote ( mContext , c ) ;
Node n ;
// update remotely
// 远程更新
if ( sqlNote . isNoteType ( ) ) {
Task task = new Task ( ) ;
task . setContentByLocalJSON ( sqlNote . getContent ( ) ) ;
@ -642,12 +625,12 @@ public class GTaskManager {
GTaskClient . getInstance ( ) . createTask ( task ) ;
n = ( Node ) task ;
// add meta
// 添加元数据
updateRemoteMeta ( task . getGid ( ) , sqlNote ) ;
} else {
TaskList tasklist = null ;
// we need to skip folder if it has already existed
// 如果文件夹已经存在则跳过
String folderName = GTaskStringUtils . MIUI_FOLDER_PREFFIX ;
if ( sqlNote . getId ( ) = = Notes . ID_ROOT_FOLDER )
folderName + = GTaskStringUtils . FOLDER_DEFAULT ;
@ -671,7 +654,7 @@ public class GTaskManager {
}
}
// no match we can add now
// 如果没有匹配项则可以添加
if ( tasklist = = null ) {
tasklist = new TaskList ( ) ;
tasklist . setContentByLocalJSON ( sqlNote . getContent ( ) ) ;
@ -681,17 +664,18 @@ public class GTaskManager {
n = ( Node ) tasklist ;
}
// update local note
// 更新本地笔记
sqlNote . setGtaskId ( n . getGid ( ) ) ;
sqlNote . commit ( false ) ;
sqlNote . resetLocalModified ( ) ;
sqlNote . commit ( true ) ;
// gid-id mapping
// GID-ID映射
mGidToNid . put ( n . getGid ( ) , sqlNote . getId ( ) ) ;
mNidToGid . put ( sqlNote . getId ( ) , n . getGid ( ) ) ;
}
// 在Google任务中更新节点
private void updateRemoteNode ( Node node , Cursor c ) throws NetworkFailureException {
if ( mCancelled ) {
return ;
@ -699,14 +683,14 @@ public class GTaskManager {
SqlNote sqlNote = new SqlNote ( mContext , c ) ;
// update remotely
// 远程更新
node . setContentByLocalJSON ( sqlNote . getContent ( ) ) ;
GTaskClient . getInstance ( ) . addUpdateNode ( node ) ;
// update meta
// 更新元数据
updateRemoteMeta ( node . getGid ( ) , sqlNote ) ;
// move task if necessary
// 如果需要移动任务
if ( sqlNote . isNoteType ( ) ) {
Task task = ( Task ) node ;
TaskList preParentList = task . getParent ( ) ;
@ -725,11 +709,12 @@ public class GTaskManager {
}
}
// clear local modified flag
// 清除本地修改标志
sqlNote . resetLocalModified ( ) ;
sqlNote . commit ( true ) ;
}
// 更新Google任务中的元数据
private void updateRemoteMeta ( String gid , SqlNote sqlNote ) throws NetworkFailureException {
if ( sqlNote ! = null & & sqlNote . isNoteType ( ) ) {
MetaData metaData = mMetaHashMap . get ( gid ) ;
@ -746,12 +731,13 @@ public class GTaskManager {
}
}
// 刷新本地同步ID
private void refreshLocalSyncId ( ) throws NetworkFailureException {
if ( mCancelled ) {
return ;
}
// get the latest gtask list
// 获取最新的Google任务列表
mGTaskHashMap . clear ( ) ;
mGTaskListHashMap . clear ( ) ;
mMetaHashMap . clear ( ) ;
@ -759,10 +745,7 @@ public class GTaskManager {
Cursor c = null ;
try {
c = mContentResolver . query ( Notes . CONTENT_NOTE_URI , SqlNote . PROJECTION_NOTE ,
"(type<>? AND parent_id<>?)" , new String [ ] {
String . valueOf ( Notes . TYPE_SYSTEM ) , String . valueOf ( Notes . ID_TRASH_FOLER )
} , NoteColumns . TYPE + " DESC" ) ;
c = mContentResolver . query ( Notes . CONTENT_NOTE_URI , SqlNote . PROJECTION_NOTE , "(type<>? AND parent_id<>?)" , new String [ ] { String . valueOf ( Notes . TYPE_SYSTEM ) , String . valueOf ( Notes . ID_TRASH_FOLER ) } , NoteColumns . TYPE + " DESC" ) ;
if ( c ! = null ) {
while ( c . moveToNext ( ) ) {
String gid = c . getString ( SqlNote . GTASK_ID_COLUMN ) ;
@ -771,12 +754,10 @@ public class GTaskManager {
mGTaskHashMap . remove ( gid ) ;
ContentValues values = new ContentValues ( ) ;
values . put ( NoteColumns . SYNC_ID , node . getLastModified ( ) ) ;
mContentResolver . update ( ContentUris . withAppendedId ( Notes . CONTENT_NOTE_URI ,
c . getLong ( SqlNote . ID_COLUMN ) ) , values , null , null ) ;
mContentResolver . update ( ContentUris . withAppendedId ( Notes . CONTENT_NOTE_URI , c . getLong ( SqlNote . ID_COLUMN ) ) , values , null , null ) ;
} else {
Log . e ( TAG , "something is missed" ) ;
throw new ActionFailureException (
"some local items don't have gid after sync" ) ;
throw new ActionFailureException ( "some local items don't have gid after sync" ) ;
}
}
} else {
@ -790,11 +771,13 @@ public class GTaskManager {
}
}
// 获取同步账户
public String getSyncAccount ( ) {
return GTaskClient . getInstance ( ) . getSyncAccount ( ) . name ;
}
// 取消同步
public void cancelSync ( ) {
mCancelled = true ;
}
}
}