use of android.net.Uri.Builder in project devbricks by dailystudio.
the class ProviderUriBuilder method attachSerialParamter.
private static Uri attachSerialParamter(Uri uri, String serial) {
if (uri == null || serial == null) {
return uri;
}
Builder builder = uri.buildUpon();
if (builder == null) {
return uri;
}
builder.appendQueryParameter(ProviderQueryUriParser.QUERY_KEY_SERIAL, serial);
return builder.build();
}
use of android.net.Uri.Builder in project devbricks by dailystudio.
the class ProviderUriBuilder method attachCreateTableParamter.
public static Uri attachCreateTableParamter(Uri uri, String createTabelParamter) {
if (uri == null || createTabelParamter == null) {
return uri;
}
Builder builder = uri.buildUpon();
if (builder == null) {
return uri;
}
builder.appendQueryParameter(ProviderQueryUriParser.QUERY_KEY_CREATE_TABLE, createTabelParamter);
return builder.build();
}
use of android.net.Uri.Builder in project Zom-Android by zom.
the class Imps method isUnencrypted.
public static boolean isUnencrypted(Context context) {
try {
Cursor cursor = null;
Uri uri = Imps.Provider.CONTENT_URI_WITH_ACCOUNT;
Builder builder = uri.buildUpon();
builder.appendQueryParameter(ImApp.CACHEWORD_PASSWORD_KEY, "");
builder = builder.appendQueryParameter(ImApp.NO_CREATE_KEY, "1");
uri = builder.build();
cursor = context.getContentResolver().query(uri, null, Imps.Provider.CATEGORY + "=?", /* selection */
new String[] { ImApp.IMPS_CATEGORY }, /* selection args */
null);
if (cursor != null) {
cursor.close();
return true;
} else {
return false;
}
} catch (Exception e) {
// Only complain if we thought this password should succeed
Log.e(ImApp.LOG_TAG, e.getMessage(), e);
// needs to be unlocked
return false;
}
}
use of android.net.Uri.Builder in project Zom-Android by zom.
the class Imps method setEmptyPassphrase.
public static boolean setEmptyPassphrase(Context ctx, boolean noCreate) {
String pkey = "";
Uri uri = Provider.CONTENT_URI_WITH_ACCOUNT;
Builder builder = uri.buildUpon().appendQueryParameter(ImApp.CACHEWORD_PASSWORD_KEY, pkey);
if (noCreate) {
builder.appendQueryParameter(ImApp.NO_CREATE_KEY, "1");
}
uri = builder.build();
Cursor cursor = ctx.getContentResolver().query(uri, null, null, null, null);
if (cursor != null) {
cursor.close();
return true;
}
return false;
}
use of android.net.Uri.Builder in project Zom-Android by zom.
the class ContactListManagerAdapter method removeObsoleteContactsAndLists.
private void removeObsoleteContactsAndLists() {
// remove all contacts for this provider & account which have not been
// added since login, yet still exist in db from a prior login
Exclusion exclusion = new Exclusion(Imps.Contacts.USERNAME, mValidatedContacts);
mResolver.delete(mContactUrl, exclusion.getSelection(), exclusion.getSelectionArgs());
// remove all blocked contacts for this provider & account which have not been
// added since login, yet still exist in db from a prior login
exclusion = new Exclusion(Imps.BlockedList.USERNAME, mValidatedBlockedContacts);
Uri.Builder builder = Imps.BlockedList.CONTENT_URI.buildUpon();
ContentUris.appendId(builder, mConn.getProviderId());
ContentUris.appendId(builder, mConn.getAccountId());
Uri uri = builder.build();
mResolver.delete(uri, exclusion.getSelection(), exclusion.getSelectionArgs());
// remove all contact lists for this provider & account which have not been
// added since login, yet still exist in db from a prior login
exclusion = new Exclusion(Imps.ContactList.NAME, mValidatedContactLists);
builder = Imps.ContactList.CONTENT_URI.buildUpon();
ContentUris.appendId(builder, mConn.getProviderId());
ContentUris.appendId(builder, mConn.getAccountId());
uri = builder.build();
mResolver.delete(uri, exclusion.getSelection(), exclusion.getSelectionArgs());
}
Aggregations