本文整理汇总了Java中com.csipsimple.db.DBProvider类的典型用法代码示例。如果您正苦于以下问题:Java DBProvider类的具体用法?Java DBProvider怎么用?Java DBProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DBProvider类属于com.csipsimple.db包,在下文中一共展示了DBProvider类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addAllAccounts
import com.csipsimple.db.DBProvider; //导入依赖的package包/类
/**
* Add accounts from database
*/
private void addAllAccounts() throws SameThreadException {
Log.d(THIS_FILE, "We are adding all accounts right now....");
boolean hasSomeSuccess = false;
Cursor c = getContentResolver().query(SipProfile.ACCOUNT_URI, DBProvider.ACCOUNT_FULL_PROJECTION,
SipProfile.FIELD_ACTIVE + "=?", new String[] {"1"}, null);
if (c != null) {
try {
int index = 0;
if(c.getCount() > 0) {
c.moveToFirst();
do {
SipProfile account = new SipProfile(c);
if (pjService != null && pjService.addAccount(account) ) {
hasSomeSuccess = true;
}
index ++;
} while (c.moveToNext() && index < 10);
}
} catch (Exception e) {
Log.e(THIS_FILE, "Error on looping over sip profiles", e);
} finally {
c.close();
}
}
hasSomeActiveAccount = hasSomeSuccess;
if (hasSomeSuccess) {
acquireResources();
} else {
releaseResources();
if (notificationManager != null) {
notificationManager.cancelRegisters();
}
}
}
示例2: unregisterAllAccounts
import com.csipsimple.db.DBProvider; //导入依赖的package包/类
/**
* Remove accounts from database
*/
private void unregisterAllAccounts(boolean cancelNotification) throws SameThreadException {
releaseResources();
Log.d(THIS_FILE, "Remove all accounts");
Cursor c = getContentResolver().query(SipProfile.ACCOUNT_URI, DBProvider.ACCOUNT_FULL_PROJECTION, null, null, null);
if (c != null) {
try {
c.moveToFirst();
do {
SipProfile account = new SipProfile(c);
setAccountRegistration(account, 0, false);
} while (c.moveToNext() );
} catch (Exception e) {
Log.e(THIS_FILE, "Error on looping over sip profiles", e);
} finally {
c.close();
}
}
if (notificationManager != null && cancelNotification) {
notificationManager.cancelRegisters();
}
}
示例3: getSipProfileColumns
import com.csipsimple.db.DBProvider; //导入依赖的package包/类
private static Columns getSipProfileColumns(boolean only_secure) {
Columns cols = new Columns(DBProvider.ACCOUNT_FULL_PROJECTION,
DBProvider.ACCOUNT_FULL_PROJECTION_TYPES);
if(only_secure) {
// Never backup password
cols.removeColumn(SipProfile.FIELD_DATA);
}
return cols;
}
示例4: getAccount
import com.csipsimple.db.DBProvider; //导入依赖的package包/类
public SipProfile getAccount(long accountId) {
// TODO : create cache at this point to not requery each time as far as it's a service query
return SipProfile.getProfileFromDbId(this, accountId, DBProvider.ACCOUNT_FULL_PROJECTION);
}