本文整理匯總了Java中com.csipsimple.models.Filter.FULL_PROJ屬性的典型用法代碼示例。如果您正苦於以下問題:Java Filter.FULL_PROJ屬性的具體用法?Java Filter.FULL_PROJ怎麽用?Java Filter.FULL_PROJ使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.csipsimple.models.Filter
的用法示例。
在下文中一共展示了Filter.FULL_PROJ屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: restoreSipProfile
private static boolean restoreSipProfile(JSONObject jsonObj, ContentResolver cr) {
// Restore accounts
Columns cols;
ContentValues cv;
cols = getSipProfileColumns(false);
cv = cols.jsonToContentValues(jsonObj);
long profileId = cv.getAsLong(SipProfile.FIELD_ID);
if(profileId >= 0) {
Uri insertedUri = cr.insert(SipProfile.ACCOUNT_URI, cv);
profileId = ContentUris.parseId(insertedUri);
}
// TODO : else restore call handler in private db
// Restore filters
cols = new Columns(Filter.FULL_PROJ, Filter.FULL_PROJ_TYPES);
try {
JSONArray filtersObj = jsonObj.getJSONArray(FILTER_KEY);
Log.d(THIS_FILE, "We have filters for " + profileId + " > " + filtersObj.length());
for (int i = 0; i < filtersObj.length(); i++) {
JSONObject filterObj = filtersObj.getJSONObject(i);
// Log.d(THIS_FILE, "restoring "+filterObj.toString(4));
cv = cols.jsonToContentValues(filterObj);
cv.put(Filter.FIELD_ACCOUNT, profileId);
cr.insert(SipManager.FILTER_URI, cv);
}
} catch (JSONException e) {
Log.e(THIS_FILE, "Error while restoring filters", e);
}
return false;
}
示例2: serializeBaseFilter
private static JSONObject serializeBaseFilter(Filter filter) {
ContentValues cv = filter.getDbContentValues();
Columns cols = new Columns(Filter.FULL_PROJ, Filter.FULL_PROJ_TYPES);
return cols.contentValueToJSON(cv);
}