本文整理匯總了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);
}