Compare commits

..

10 Commits
master ... cnz

Author SHA1 Message Date
cnz 00b9185b28 陈念焯注释
3 months ago
cnz 6c4c4e3359 陈念焯注释
3 months ago
cnz 0043f8dc7c 111
3 months ago
cnz 175b8cc51a 111
3 months ago
cnz 773b096dd3 111
3 months ago
cnz e2f2ffd2a1 111
4 months ago
cnz 625d4a4e60 111
4 months ago
cnz 4f82d7c94b 11
4 months ago
cnz 38db399fdb 111
4 months ago
cnz 03fe62899b 123
4 months ago

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 560 KiB

Binary file not shown.

@ -14,74 +14,86 @@
* limitations under the License.
*/
package net.micode.notes.data;//导入包
import android.content.Context;//导入包WWOERVIJNGIERBN IETKMB NTRHJJN BJEIR
package net.micode.notes.data; //导入包
// 导入所需的Android类和接口
import android.content.Context;
import android.database.Cursor;
import android.provider.ContactsContract.CommonDataKinds.Phone;
import android.provider.ContactsContract.Data;
import android.telephony.PhoneNumberUtils;
import android.util.Log;
import java.util.HashMap;
import java.util.HashMap; // 哈希映射,用于实现缓存
public class Contact {//创建类
private static HashMap<String, String> sContactCache;
private static final String TAG = "Contact";// 日志标签
/**
*
* 1. 使PHONE_NUMBERS_EQUAL
* 2.
* 3. phone_lookup
/**
*
*
*/
public class Contact { //创建类
private static HashMap<String, String> sContactCache; // 静态缓存HashMap使用volatile保证多线程可见性
private static final String TAG = "Contact"; // 日志标签,用于调试
/**
* SQL
*
* 1. PHONE_NUMBERS_EQUAL
* 2. MIMETYPE
* 3. phone_lookup
* '+'
*/
private static final String CALLER_ID_SELECTION = "PHONE_NUMBERS_EQUAL(" + Phone.NUMBER
private static final String CALLER_ID_SELECTION = "PHONE_NUMBERS_EQUAL(" + Phone.NUMBER // 电话号码比较函数
+ ",?) AND " + Data.MIMETYPE + "='" + Phone.CONTENT_ITEM_TYPE + "'"
+ " AND " + Data.RAW_CONTACT_ID + " IN "
+ "(SELECT raw_contact_id "
+ " FROM phone_lookup"
+ " WHERE min_match = '+')";
+ " AND " + Data.RAW_CONTACT_ID + " IN " // 关联raw_contact_id
+ "(SELECT raw_contact_id " // 子查询开始
+ " FROM phone_lookup" // 系统电话索引表
+ " WHERE min_match = '+')"; // 占位符将被替换
/**
*
* @param context
* @param phoneNumber
* @return null
/**
*
* @param context
* @param phoneNumber
* @return null
* @throws IllegalArgumentException null
*/
public static String getContact(Context context, String phoneNumber) {
// 初始化缓存
//初始化缓存
if(sContactCache == null) {
sContactCache = new HashMap<String, String>();
}
// 检查缓存
// 缓存检查:如果命中则直接返回(减少数据库查询)
if(sContactCache.containsKey(phoneNumber)) {
return sContactCache.get(phoneNumber);
return sContactCache.get(phoneNumber);// 返回缓存值
}
// 动态生成查询条件:设置最小匹配长度
String selection = CALLER_ID_SELECTION.replace("+",
PhoneNumberUtils.toCallerIDMinMatch(phoneNumber));
// 查询联系人数据库
Cursor cursor = context.getContentResolver().query(
Data.CONTENT_URI, // 数据URI
new String [] { Phone.DISPLAY_NAME }, // 返回的列(仅需姓名)
selection, // 查询条件
new String[] { phoneNumber },
null);
if (cursor != null && cursor.moveToFirst()) {
// 执行内容提供者查询:
// URI: Data.CONTENT_URI - 系统联系人数据URI
// 投影: 只查询DISPLAY_NAME列节省资源
// 参数: 将phoneNumber作为selectionArgs传入
Cursor cursor = context.getContentResolver().query(
Data.CONTENT_URI,// 联系人数据URI
new String [] { Phone.DISPLAY_NAME },// 只返回姓名列
selection,// 动态生成的查询条件
new String[] { phoneNumber },// 查询参数(实际电话号码)
null);// 不排序
// 处理查询结果
if (cursor != null && cursor.moveToFirst()) {// 检查游标有效性且有数据
try {
String name = cursor.getString(0);
sContactCache.put(phoneNumber, name);
String name = cursor.getString(0);// 获取第一列索引0的数据
sContactCache.put(phoneNumber, name); // 更新缓存
return name;
} catch (IndexOutOfBoundsException e) {
Log.e(TAG, " Cursor get string error " + e.toString());
return null;
} finally {
} finally {// 确保关闭游标(避免内存泄漏)
cursor.close();
}
} else {
} else { // 未找到匹配联系人
Log.d(TAG, "No contact matched with number:" + phoneNumber);
return null;
}

@ -282,4 +282,4 @@ public class Notes {//定义了三种类型常量:普通笔记、文件夹和
public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/call_note");
}
}
}

@ -353,4 +353,4 @@ public class NotesProvider extends ContentProvider {
// TODO: 实现获取URI类型的方法
return null;
}
}
}

@ -1,3 +1,4 @@
/*
* Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
*
@ -14,9 +15,7 @@
* limitations under the License.
*/
//这个类封装了Google任务同步的所有逻辑包括后台执行、进度通知、错误处理和结果反馈为应用提供了完整的同步功能实现。
package net.micode.notes.gtask.remote;//导入包
package net.micode.notes.gtask.remote;
import android.app.Notification;
import android.app.NotificationManager;
@ -29,32 +28,23 @@ import net.micode.notes.R;
import net.micode.notes.ui.NotesListActivity;
import net.micode.notes.ui.NotesPreferenceActivity;
/**
* GoogleAsyncTask
*
*/
public class GTaskASyncTask extends AsyncTask<Void, String, Integer> {
// 同步通知的唯一ID
private static int GTASK_SYNC_NOTIFICATION_ID = 5234235;
/**
*
*/
public interface OnCompleteListener {
void onComplete();
}
private Context mContext; // 上下文对象
private NotificationManager mNotifiManager; // 通知管理器
private GTaskManager mTaskManager; // Google任务管理器
private OnCompleteListener mOnCompleteListener; // 完成监听器
private Context mContext;
private NotificationManager mNotifiManager;
private GTaskManager mTaskManager;
private OnCompleteListener mOnCompleteListener;
/**
*
* @param context
* @param listener
*/
public GTaskASyncTask(Context context, OnCompleteListener listener) {
mContext = context;
mOnCompleteListener = listener;
@ -63,116 +53,71 @@ public class GTaskASyncTask extends AsyncTask<Void, String, Integer> {
mTaskManager = GTaskManager.getInstance();
}
/**
*
*/
public void cancelSync() {
mTaskManager.cancelSync();
}
/**
*
* @param message
*/
public void publishProgess(String message) {
publishProgress(new String[] { message });
publishProgress(new String[] {
message
});
}
/**
*
* @param tickerId ID
* @param content
*/
private void showNotification(int tickerId, String content) {
// 创建通知对象
Notification notification = new Notification(R.drawable.notification,
mContext.getString(tickerId), System.currentTimeMillis());
// 设置通知属性
Notification notification = new Notification(R.drawable.notification, mContext
.getString(tickerId), System.currentTimeMillis());
notification.defaults = Notification.DEFAULT_LIGHTS;
notification.flags = Notification.FLAG_AUTO_CANCEL;
// 根据通知类型设置不同的PendingIntent
PendingIntent pendingIntent;
if (tickerId != R.string.ticker_success) {
// 失败时跳转到设置页面
pendingIntent = PendingIntent.getActivity(mContext, 0,
new Intent(mContext, NotesPreferenceActivity.class), 0);
pendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(mContext,
NotesPreferenceActivity.class), 0);
} else {
// 成功时跳转到笔记列表
pendingIntent = PendingIntent.getActivity(mContext, 0,
new Intent(mContext, NotesListActivity.class), 0);
pendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(mContext,
NotesListActivity.class), 0);
}
// 设置通知内容
notification.setLatestEventInfo(mContext,
mContext.getString(R.string.app_name), content, pendingIntent);
// 显示通知
notification.setLatestEventInfo(mContext, mContext.getString(R.string.app_name), content,
pendingIntent);
mNotifiManager.notify(GTASK_SYNC_NOTIFICATION_ID, notification);
}
/**
*
* @param unused 使
* @return
*/
@Override
protected Integer doInBackground(Void... unused) {
// 发布登录进度
publishProgess(mContext.getString(R.string.sync_progress_login,
NotesPreferenceActivity.getSyncAccountName(mContext)));
// 执行同步并返回结果
publishProgess(mContext.getString(R.string.sync_progress_login, NotesPreferenceActivity
.getSyncAccountName(mContext)));
return mTaskManager.sync(mContext, this);
}
/**
*
* @param progress
*/
@Override
protected void onProgressUpdate(String... progress) {
// 显示同步中的通知
showNotification(R.string.ticker_syncing, progress[0]);
// 如果是服务上下文,发送广播
if (mContext instanceof GTaskSyncService) {
((GTaskSyncService) mContext).sendBroadcast(progress[0]);
}
}
/**
*
* @param result
*/
@Override
protected void onPostExecute(Integer result) {
// 根据不同的结果状态显示不同的通知
if (result == GTaskManager.STATE_SUCCESS) {
// 同步成功
showNotification(R.string.ticker_success, mContext.getString(
R.string.success_sync_account, mTaskManager.getSyncAccount()));
NotesPreferenceActivity.setLastSyncTime(mContext, System.currentTimeMillis());
} else if (result == GTaskManager.STATE_NETWORK_ERROR) {
// 网络错误
showNotification(R.string.ticker_fail, mContext.getString(R.string.error_sync_network));
} else if (result == GTaskManager.STATE_INTERNAL_ERROR) {
// 内部错误
showNotification(R.string.ticker_fail, mContext.getString(R.string.error_sync_internal));
} else if (result == GTaskManager.STATE_SYNC_CANCELLED) {
// 同步取消
showNotification(R.string.ticker_cancel, mContext
.getString(R.string.error_sync_cancelled));
}
// 调用完成监听器
if (mOnCompleteListener != null) {
new Thread(new Runnable() {
public void run() {
mOnCompleteListener.onComplete();
}
}).start();
}
}
}
}

@ -14,9 +14,7 @@
* limitations under the License.
*/
//这个类实现了完整的Google Tasks API客户端功能为上层应用提供了简洁的接口来管理Google任务数据。
package net.micode.notes.gtask.remote;//导入包
package net.micode.notes.gtask.remote;
import android.accounts.Account;
import android.accounts.AccountManager;
@ -62,33 +60,36 @@ import java.util.zip.GZIPInputStream;
import java.util.zip.Inflater;
import java.util.zip.InflaterInputStream;
/**
* GoogleGoogle Tasks API
*/
public class GTaskClient {
private static final String TAG = GTaskClient.class.getSimpleName();
// Google任务相关URL常量
private static final String GTASK_URL = "https://mail.google.com/tasks/";
private static final String GTASK_GET_URL = "https://mail.google.com/tasks/ig";
private static final String GTASK_POST_URL = "https://mail.google.com/tasks/r/ig";
private static GTaskClient mInstance = null; // 单例实例
private static GTaskClient mInstance = null;
// HTTP客户端和相关属性
private DefaultHttpClient mHttpClient;
private String mGetUrl;
private String mPostUrl;
private long mClientVersion; // 客户端版本
private boolean mLoggedin; // 登录状态
private long mLastLoginTime; // 最后登录时间
private int mActionId; // 动作ID计数器
private Account mAccount; // 当前账户
private JSONArray mUpdateArray; // 待更新的动作数组
/**
*
*/
private long mClientVersion;
private boolean mLoggedin;
private long mLastLoginTime;
private int mActionId;
private Account mAccount;
private JSONArray mUpdateArray;
private GTaskClient() {
mHttpClient = null;
mGetUrl = GTASK_GET_URL;
@ -101,9 +102,6 @@ public class GTaskClient {
mUpdateArray = null;
}
/**
*
*/
public static synchronized GTaskClient getInstance() {
if (mInstance == null) {
mInstance = new GTaskClient();
@ -111,21 +109,18 @@ public class GTaskClient {
return mInstance;
}
/**
* Google
* @param activity
* @return
*/
public boolean login(Activity activity) {
// 检查cookie是否过期(5分钟)
// we suppose that the cookie would expire after 5 minutes
// then we need to re-login
final long interval = 1000 * 60 * 5;
if (mLastLoginTime + interval < System.currentTimeMillis()) {
mLoggedin = false;
}
// 检查账户是否变更
if (mLoggedin && !TextUtils.equals(getSyncAccount().name,
NotesPreferenceActivity.getSyncAccountName(activity))) {
// need to re-login after account switch
if (mLoggedin
&& !TextUtils.equals(getSyncAccount().name, NotesPreferenceActivity
.getSyncAccountName(activity))) {
mLoggedin = false;
}
@ -135,16 +130,15 @@ public class GTaskClient {
}
mLastLoginTime = System.currentTimeMillis();
// 获取Google账户认证令牌
String authToken = loginGoogleAccount(activity, false);
if (authToken == null) {
Log.e(TAG, "login google account failed");
return false;
}
// 处理自定义域名账户(非gmail.com/googlemail.com)
if (!(mAccount.name.toLowerCase().endsWith("gmail.com") ||
mAccount.name.toLowerCase().endsWith("googlemail.com"))) {
// login with custom domain if necessary
if (!(mAccount.name.toLowerCase().endsWith("gmail.com") || mAccount.name.toLowerCase()
.endsWith("googlemail.com"))) {
StringBuilder url = new StringBuilder(GTASK_URL).append("a/");
int index = mAccount.name.indexOf('@') + 1;
String suffix = mAccount.name.substring(index);
@ -157,7 +151,7 @@ public class GTaskClient {
}
}
// 尝试使用官方Google URL登录
// try to login with google official url
if (!mLoggedin) {
mGetUrl = GTASK_GET_URL;
mPostUrl = GTASK_POST_URL;
@ -170,9 +164,6 @@ public class GTaskClient {
return true;
}
/**
* Google
*/
private String loginGoogleAccount(Activity activity, boolean invalidateToken) {
String authToken;
AccountManager accountManager = AccountManager.get(activity);
@ -183,7 +174,6 @@ public class GTaskClient {
return null;
}
// 获取设置中配置的同步账户
String accountName = NotesPreferenceActivity.getSyncAccountName(activity);
Account account = null;
for (Account a : accounts) {
@ -199,7 +189,7 @@ public class GTaskClient {
return null;
}
// 获取认证令牌
// get the token now
AccountManagerFuture<Bundle> accountManagerFuture = accountManager.getAuthToken(account,
"goanna_mobile", null, activity, null, null);
try {
@ -217,12 +207,10 @@ public class GTaskClient {
return authToken;
}
/**
* Google
*/
private boolean tryToLoginGtask(Activity activity, String authToken) {
if (!loginGtask(authToken)) {
// 令牌可能过期,尝试重新获取
// maybe the auth token is out of date, now let's invalidate the
// token and try again
authToken = loginGoogleAccount(activity, true);
if (authToken == null) {
Log.e(TAG, "login google account failed");
@ -237,11 +225,7 @@ public class GTaskClient {
return true;
}
/**
* Google
*/
private boolean loginGtask(String authToken) {
// 设置HTTP参数
int timeoutConnection = 10000;
int timeoutSocket = 15000;
HttpParams httpParameters = new BasicHttpParams();
@ -252,13 +236,14 @@ public class GTaskClient {
mHttpClient.setCookieStore(localBasicCookieStore);
HttpProtocolParams.setUseExpectContinue(mHttpClient.getParams(), false);
// 登录Google任务
// login gtask
try {
String loginUrl = mGetUrl + "?auth=" + authToken;
HttpGet httpGet = new HttpGet(loginUrl);
HttpResponse response = mHttpClient.execute(httpGet);
HttpResponse response = null;
response = mHttpClient.execute(httpGet);
// 检查认证cookie
// get the cookie now
List<Cookie> cookies = mHttpClient.getCookieStore().getCookies();
boolean hasAuthCookie = false;
for (Cookie cookie : cookies) {
@ -270,7 +255,7 @@ public class GTaskClient {
Log.w(TAG, "it seems that there is no auth cookie");
}
// 获取客户端版本信息
// get the client version
String resString = getResponseContent(response.getEntity());
String jsBegin = "_setup(";
String jsEnd = ")}</script>";
@ -287,6 +272,7 @@ public class GTaskClient {
e.printStackTrace();
return false;
} catch (Exception e) {
// simply catch all exceptions
Log.e(TAG, "httpget gtask_url failed");
return false;
}
@ -294,16 +280,10 @@ public class GTaskClient {
return true;
}
/**
* ID
*/
private int getActionId() {
return mActionId++;
}
/**
* HTTP POST
*/
private HttpPost createHttpPost() {
HttpPost httpPost = new HttpPost(mPostUrl);
httpPost.setHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
@ -311,9 +291,6 @@ public class GTaskClient {
return httpPost;
}
/**
* HTTP
*/
private String getResponseContent(HttpEntity entity) throws IOException {
String contentEncoding = null;
if (entity.getContentEncoding() != null) {
@ -322,7 +299,6 @@ public class GTaskClient {
}
InputStream input = entity.getContent();
// 处理GZIP和DEFLATE压缩
if (contentEncoding != null && contentEncoding.equalsIgnoreCase("gzip")) {
input = new GZIPInputStream(entity.getContent());
} else if (contentEncoding != null && contentEncoding.equalsIgnoreCase("deflate")) {
@ -347,9 +323,6 @@ public class GTaskClient {
}
}
/**
* POST
*/
private JSONObject postRequest(JSONObject js) throws NetworkFailureException {
if (!mLoggedin) {
Log.e(TAG, "please login first");
@ -363,7 +336,7 @@ public class GTaskClient {
UrlEncodedFormEntity entity = new UrlEncodedFormEntity(list, "UTF-8");
httpPost.setEntity(entity);
// 执行POST请求
// execute the post
HttpResponse response = mHttpClient.execute(httpPost);
String jsString = getResponseContent(response.getEntity());
return new JSONObject(jsString);
@ -387,23 +360,20 @@ public class GTaskClient {
}
}
/**
*
*/
public void createTask(Task task) throws NetworkFailureException {
commitUpdate();
try {
JSONObject jsPost = new JSONObject();
JSONArray actionList = new JSONArray();
// 添加创建动作
// action_list
actionList.put(task.getCreateAction(getActionId()));
jsPost.put(GTaskStringUtils.GTASK_JSON_ACTION_LIST, actionList);
// 设置客户端版本
// client_version
jsPost.put(GTaskStringUtils.GTASK_JSON_CLIENT_VERSION, mClientVersion);
// 发送请求并处理响应
// post
JSONObject jsResponse = postRequest(jsPost);
JSONObject jsResult = (JSONObject) jsResponse.getJSONArray(
GTaskStringUtils.GTASK_JSON_RESULTS).get(0);
@ -416,23 +386,20 @@ public class GTaskClient {
}
}
/**
*
*/
public void createTaskList(TaskList tasklist) throws NetworkFailureException {
commitUpdate();
try {
JSONObject jsPost = new JSONObject();
JSONArray actionList = new JSONArray();
// 添加创建动作
// action_list
actionList.put(tasklist.getCreateAction(getActionId()));
jsPost.put(GTaskStringUtils.GTASK_JSON_ACTION_LIST, actionList);
// 设置客户端版本
// client version
jsPost.put(GTaskStringUtils.GTASK_JSON_CLIENT_VERSION, mClientVersion);
// 发送请求并处理响应
// post
JSONObject jsResponse = postRequest(jsPost);
JSONObject jsResult = (JSONObject) jsResponse.getJSONArray(
GTaskStringUtils.GTASK_JSON_RESULTS).get(0);
@ -445,21 +412,17 @@ public class GTaskClient {
}
}
/**
*
*/
public void commitUpdate() throws NetworkFailureException {
if (mUpdateArray != null) {
try {
JSONObject jsPost = new JSONObject();
// 添加待更新动作列表
// action_list
jsPost.put(GTaskStringUtils.GTASK_JSON_ACTION_LIST, mUpdateArray);
// 设置客户端版本
// client_version
jsPost.put(GTaskStringUtils.GTASK_JSON_CLIENT_VERSION, mClientVersion);
// 发送请求
postRequest(jsPost);
mUpdateArray = null;
} catch (JSONException e) {
@ -470,12 +433,10 @@ public class GTaskClient {
}
}
/**
*
*/
public void addUpdateNode(Node node) throws NetworkFailureException {
if (node != null) {
// 防止更新项过多导致错误限制最多10项
// too many update items may result in an error
// set max to 10 items
if (mUpdateArray != null && mUpdateArray.length() > 10) {
commitUpdate();
}
@ -486,9 +447,6 @@ public class GTaskClient {
}
}
/**
*
*/
public void moveTask(Task task, TaskList preParent, TaskList curParent)
throws NetworkFailureException {
commitUpdate();
@ -497,25 +455,26 @@ public class GTaskClient {
JSONArray actionList = new JSONArray();
JSONObject action = new JSONObject();
// 设置移动动作参数
// action_list
action.put(GTaskStringUtils.GTASK_JSON_ACTION_TYPE,
GTaskStringUtils.GTASK_JSON_ACTION_TYPE_MOVE);
action.put(GTaskStringUtils.GTASK_JSON_ACTION_ID, getActionId());
action.put(GTaskStringUtils.GTASK_JSON_ID, task.getGid());
if (preParent == curParent && task.getPriorSibling() != null) {
// 同一任务列表内移动时设置前一个兄弟节点ID
// put prioring_sibing_id only if moving within the tasklist and
// it is not the first one
action.put(GTaskStringUtils.GTASK_JSON_PRIOR_SIBLING_ID, task.getPriorSibling());
}
action.put(GTaskStringUtils.GTASK_JSON_SOURCE_LIST, preParent.getGid());
action.put(GTaskStringUtils.GTASK_JSON_DEST_PARENT, curParent.getGid());
if (preParent != curParent) {
// 不同任务列表间移动时设置目标列表ID
// put the dest_list only if moving between tasklists
action.put(GTaskStringUtils.GTASK_JSON_DEST_LIST, curParent.getGid());
}
actionList.put(action);
jsPost.put(GTaskStringUtils.GTASK_JSON_ACTION_LIST, actionList);
// 设置客户端版本
// client_version
jsPost.put(GTaskStringUtils.GTASK_JSON_CLIENT_VERSION, mClientVersion);
postRequest(jsPost);
@ -527,21 +486,18 @@ public class GTaskClient {
}
}
/**
*
*/
public void deleteNode(Node node) throws NetworkFailureException {
commitUpdate();
try {
JSONObject jsPost = new JSONObject();
JSONArray actionList = new JSONArray();
// 设置删除动作
// action_list
node.setDeleted(true);
actionList.put(node.getUpdateAction(getActionId()));
jsPost.put(GTaskStringUtils.GTASK_JSON_ACTION_LIST, actionList);
// 设置客户端版本
// client_version
jsPost.put(GTaskStringUtils.GTASK_JSON_CLIENT_VERSION, mClientVersion);
postRequest(jsPost);
@ -553,9 +509,6 @@ public class GTaskClient {
}
}
/**
*
*/
public JSONArray getTaskLists() throws NetworkFailureException {
if (!mLoggedin) {
Log.e(TAG, "please login first");
@ -564,9 +517,10 @@ public class GTaskClient {
try {
HttpGet httpGet = new HttpGet(mGetUrl);
HttpResponse response = mHttpClient.execute(httpGet);
HttpResponse response = null;
response = mHttpClient.execute(httpGet);
// 解析响应获取任务列表
// get the task list
String resString = getResponseContent(response.getEntity());
String jsBegin = "_setup(";
String jsEnd = ")}</script>";
@ -593,9 +547,6 @@ public class GTaskClient {
}
}
/**
*
*/
public JSONArray getTaskList(String listGid) throws NetworkFailureException {
commitUpdate();
try {
@ -603,7 +554,7 @@ public class GTaskClient {
JSONArray actionList = new JSONArray();
JSONObject action = new JSONObject();
// 设置获取全部任务动作
// action_list
action.put(GTaskStringUtils.GTASK_JSON_ACTION_TYPE,
GTaskStringUtils.GTASK_JSON_ACTION_TYPE_GETALL);
action.put(GTaskStringUtils.GTASK_JSON_ACTION_ID, getActionId());
@ -612,7 +563,7 @@ public class GTaskClient {
actionList.put(action);
jsPost.put(GTaskStringUtils.GTASK_JSON_ACTION_LIST, actionList);
// 设置客户端版本
// client_version
jsPost.put(GTaskStringUtils.GTASK_JSON_CLIENT_VERSION, mClientVersion);
JSONObject jsResponse = postRequest(jsPost);
@ -624,17 +575,11 @@ public class GTaskClient {
}
}
/**
*
*/
public Account getSyncAccount() {
return mAccount;
}
/**
*
*/
public void resetUpdateArray() {
mUpdateArray = null;
}
}
}

Loading…
Cancel
Save