Home
last modified time | relevance | path

Searched refs:db (Results 1 – 25 of 111) sorted by relevance

12345

/packages/providers/CalendarProvider/src/com/android/providers/calendar/
DCalendarDatabaseHelper.java325 public void onOpen(SQLiteDatabase db) { in onOpen() argument
326 mSyncState.onDatabaseOpened(db); in onOpen()
328 mCalendarsInserter = new DatabaseUtils.InsertHelper(db, Tables.CALENDARS); in onOpen()
329 mColorsInserter = new DatabaseUtils.InsertHelper(db, Tables.COLORS); in onOpen()
330 mEventsInserter = new DatabaseUtils.InsertHelper(db, Tables.EVENTS); in onOpen()
331 mEventsRawTimesInserter = new DatabaseUtils.InsertHelper(db, Tables.EVENTS_RAW_TIMES); in onOpen()
332 mInstancesInserter = new DatabaseUtils.InsertHelper(db, Tables.INSTANCES); in onOpen()
333 mAttendeesInserter = new DatabaseUtils.InsertHelper(db, Tables.ATTENDEES); in onOpen()
334 mRemindersInserter = new DatabaseUtils.InsertHelper(db, Tables.REMINDERS); in onOpen()
335 mCalendarAlertsInserter = new DatabaseUtils.InsertHelper(db, Tables.CALENDAR_ALERTS); in onOpen()
[all …]
DMetaData.java81 SQLiteDatabase db = mOpenHelper.getReadableDatabase(); in getFields() local
82 db.beginTransaction(); in getFields()
87 readLocked(db); in getFields()
92 db.setTransactionSuccessful(); in getFields()
94 db.endTransaction(); in getFields()
115 SQLiteDatabase db = mOpenHelper.getReadableDatabase(); in getFieldsLocked() local
116 readLocked(db); in getFieldsLocked()
130 private void readLocked(SQLiteDatabase db) { in readLocked() argument
136 Cursor cursor = db.query("CalendarMetaData", sCalendarMetaDataProjection, in readLocked()
171 SQLiteDatabase db = mOpenHelper.getReadableDatabase(); in write() local
[all …]
/packages/providers/TelephonyProvider/src/com/android/providers/telephony/
DMmsSmsDatabaseHelper.java244 private static void removeUnferencedCanonicalAddresses(SQLiteDatabase db) { in removeUnferencedCanonicalAddresses() argument
245 Cursor c = db.query(MmsSmsProvider.TABLE_THREADS, new String[] { "recipient_ids" }, in removeUnferencedCanonicalAddresses()
251 int rows = db.delete("canonical_addresses", null, null); in removeUnferencedCanonicalAddresses()
276 int rows = db.delete("canonical_addresses", sb.toString(), null); in removeUnferencedCanonicalAddresses()
285 public static void updateThread(SQLiteDatabase db, long thread_id) { in updateThread() argument
287 updateAllThreads(db, null, null); in updateThread()
291 db.beginTransaction(); in updateThread()
296 int rows = db.delete(MmsSmsProvider.TABLE_THREADS, in updateThread()
303 removeUnferencedCanonicalAddresses(db); in updateThread()
307 db.execSQL( in updateThread()
[all …]
DTelephonyProvider.java128 public void onCreate(SQLiteDatabase db) { in onCreate() argument
130 db.execSQL("CREATE TABLE " + CARRIERS_TABLE + in onCreate()
155 initDatabase(db); in onCreate()
158 private void initDatabase(SQLiteDatabase db) { in initDatabase() argument
166 loadApns(db, parser); in initDatabase()
191 loadApns(db, confparser); in initDatabase()
203 public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { in onUpgrade() argument
217 db.execSQL("ALTER TABLE " + CARRIERS_TABLE + in onUpgrade()
224 db.execSQL("ALTER TABLE " + CARRIERS_TABLE + in onUpgrade()
226 db.execSQL("ALTER TABLE " + CARRIERS_TABLE + in onUpgrade()
[all …]
/packages/providers/ContactsProvider/src/com/android/providers/contacts/
DContactsDatabaseHelper.java814 private void refreshDatabaseCaches(SQLiteDatabase db) { in refreshDatabaseCaches() argument
832 initializeCache(db); in refreshDatabaseCaches()
840 private void initializeCache(SQLiteDatabase db) { in initializeCache() argument
847 mMimeTypeIdEmail = lookupMimeTypeId(Email.CONTENT_ITEM_TYPE, db); in initializeCache()
848 mMimeTypeIdIm = lookupMimeTypeId(Im.CONTENT_ITEM_TYPE, db); in initializeCache()
849 mMimeTypeIdNickname = lookupMimeTypeId(Nickname.CONTENT_ITEM_TYPE, db); in initializeCache()
850 mMimeTypeIdOrganization = lookupMimeTypeId(Organization.CONTENT_ITEM_TYPE, db); in initializeCache()
851 mMimeTypeIdPhone = lookupMimeTypeId(Phone.CONTENT_ITEM_TYPE, db); in initializeCache()
852 mMimeTypeIdSip = lookupMimeTypeId(SipAddress.CONTENT_ITEM_TYPE, db); in initializeCache()
853 mMimeTypeIdStructuredName = lookupMimeTypeId(StructuredName.CONTENT_ITEM_TYPE, db); in initializeCache()
[all …]
DContactsProvider2.java1649 final SQLiteDatabase db = mDbHelper.get().getWritableDatabase(); in performBackgroundTask() local
1650 DeletedContactsTableUtil.deleteOldLogs(db); in performBackgroundTask()
1744 SQLiteDatabase db = mContactsHelper.getWritableDatabase(); in changeLocaleInBackground() local
1746 db.beginTransaction(); in changeLocaleInBackground()
1750 db.setTransactionSuccessful(); in changeLocaleInBackground()
1753 db.endTransaction(); in changeLocaleInBackground()
1795 final SQLiteDatabase db = mDbHelper.get().getWritableDatabase(); in cleanupPhotoStore() local
1801 Cursor c = db.query(Views.DATA, new String[]{Data._ID, Photo.PHOTO_FILE_ID}, in cleanupPhotoStore()
1818 c = db.query(Tables.STREAM_ITEM_PHOTOS + " JOIN " + Tables.STREAM_ITEMS in cleanupPhotoStore()
1850 db.beginTransactionWithListener(inProfileMode() ? mProfileProvider : this); in cleanupPhotoStore()
[all …]
DDataRowHandlerForGroupMembership.java76 public long insert(SQLiteDatabase db, TransactionContext txContext, long rawContactId, in insert() argument
78 resolveGroupSourceIdInValues(txContext, rawContactId, db, values, true); in insert()
79 long dataId = super.insert(db, txContext, rawContactId, values); in insert()
80 if (hasFavoritesGroupMembership(db, rawContactId)) { in insert()
81 updateRawContactsStar(db, rawContactId, true /* starred */); in insert()
88 public boolean update(SQLiteDatabase db, TransactionContext txContext, ContentValues values, in update() argument
91 boolean wasStarred = hasFavoritesGroupMembership(db, rawContactId); in update()
92 resolveGroupSourceIdInValues(txContext, rawContactId, db, values, false); in update()
93 if (!super.update(db, txContext, values, c, callerIsSyncAdapter)) { in update()
96 boolean isStarred = hasFavoritesGroupMembership(db, rawContactId); in update()
[all …]
/packages/providers/MediaProvider/src/com/android/providers/media/
DMediaProvider.java258 SQLiteDatabase db = database.getWritableDatabase();
267 db.update("files", values, where, whereArgs);
270 int numpurged = db.delete("files", where, whereArgs);
271 logToDb(db, "removed " + numpurged +
362 public void onCreate(final SQLiteDatabase db) { in onCreate() argument
363 updateDatabase(mContext, db, mInternal, 0, getDatabaseVersion(mContext)); in onCreate()
371 public void onUpgrade(final SQLiteDatabase db, final int oldV, final int newV) { in onUpgrade() argument
373 updateDatabase(mContext, db, mInternal, oldV, newV); in onUpgrade()
407 public void onOpen(SQLiteDatabase db) { in onOpen() argument
414 db.addCustomFunction("_OBJECT_REMOVED", 1, mObjectRemovedCallback); in onOpen()
[all …]
/packages/apps/Email/src/com/android/email/provider/
DDBHelper.java153 static void createMessageTable(SQLiteDatabase db) { in createMessageTable() argument
193 db.execSQL("create table " + Message.TABLE_NAME + createString); in createMessageTable()
194 db.execSQL("create table " + Message.UPDATED_TABLE_NAME + altCreateString); in createMessageTable()
195 db.execSQL("create table " + Message.DELETED_TABLE_NAME + altCreateString); in createMessageTable()
206 db.execSQL(createIndex(Message.TABLE_NAME, columnName)); in createMessageTable()
212 db.execSQL("create trigger message_delete before delete on " + Message.TABLE_NAME + in createMessageTable()
223 db.execSQL("create trigger unread_message_insert before insert on " + Message.TABLE_NAME + in createMessageTable()
231 db.execSQL("create trigger unread_message_delete before delete on " + Message.TABLE_NAME + in createMessageTable()
239 db.execSQL("create trigger unread_message_move before update of " + in createMessageTable()
251 db.execSQL("create trigger unread_message_read before update of " + in createMessageTable()
[all …]
DEmailProvider.java456 void deleteUnlinked(SQLiteDatabase db, String table, String column, String foreignColumn, in deleteUnlinked() argument
458 int count = db.delete(table, column + " not in (select " + foreignColumn + " from " + in deleteUnlinked()
698 SQLiteDatabase db = getDatabase(context); in delete() local
728 db.beginTransaction(); in delete()
748 db.execSQL(DELETED_MESSAGE_INSERT + id); in delete()
749 db.execSQL(UPDATED_MESSAGE_DELETE + id); in delete()
755 result = db.delete(tableName, whereWithId(id, selection), selectionArgs); in delete()
790 result = db.delete(tableName, in delete()
819 result = db.delete(tableName, selection, selectionArgs); in delete()
837 db.execSQL(DELETE_BODY + id); in delete()
[all …]
/packages/apps/Gallery2/tests/src/com/android/photos/data/
DPhotoDatabaseTest.java59 SQLiteDatabase db = getReadableDB(); in testCreateDatabase() local
60 db.beginTransaction(); in testCreateDatabase()
61 db.endTransaction(); in testCreateDatabase()
72 SQLiteDatabase db = getWritableDB(); in testAlbumsConstraints() local
73 db.beginTransaction(); in testAlbumsConstraints()
77 assertFalse(PhotoDatabaseUtils.insertAlbum(db, null, null, Albums.VISIBILITY_PRIVATE, in testAlbumsConstraints()
81 assertFalse(PhotoDatabaseUtils.insertAlbum(db, null, "hello", null, accountId)); in testAlbumsConstraints()
84 assertFalse(PhotoDatabaseUtils.insertAlbum(db, null, "hello", in testAlbumsConstraints()
88 assertTrue(PhotoDatabaseUtils.insertAlbum(db, PARENT_ID1, "hello", in testAlbumsConstraints()
91 long albumId = PhotoDatabaseUtils.queryAlbumIdFromParentId(db, PARENT_ID1); in testAlbumsConstraints()
[all …]
/packages/providers/ContactsProvider/src/com/android/providers/contacts/aggregation/
DContactAggregator.java273 SQLiteDatabase db = mDbHelper.getReadableDatabase(); in ContactAggregator() local
297 mAggregatedPresenceReplace = db.compileStatement(replaceAggregatePresenceSql); in ContactAggregator()
299 mRawContactCountQuery = db.compileStatement( in ContactAggregator()
305 mAggregatedPresenceDelete = db.compileStatement( in ContactAggregator()
309 mMarkForAggregation = db.compileStatement( in ContactAggregator()
315 mPhotoIdUpdate = db.compileStatement( in ContactAggregator()
320 mDisplayNameUpdate = db.compileStatement( in ContactAggregator()
325 mLookupKeyUpdate = db.compileStatement( in ContactAggregator()
330 mStarredUpdate = db.compileStatement("UPDATE " + Tables.CONTACTS + " SET " in ContactAggregator()
336 mContactIdAndMarkAggregatedUpdate = db.compileStatement( in ContactAggregator()
[all …]
/packages/apps/Launcher2/src/com/android/launcher2/
DLauncherProvider.java118 SQLiteDatabase db = mOpenHelper.getWritableDatabase(); in query() local
119 Cursor result = qb.query(db, projection, args.where, args.args, null, null, sortOrder); in query()
126 SQLiteDatabase db, String table, String nullColumnHack, ContentValues values) { in dbInsertAndCheck() argument
130 return db.insert(table, nullColumnHack, values); in dbInsertAndCheck()
133 private static void deleteId(SQLiteDatabase db, long id) { in deleteId() argument
136 db.delete(args.table, args.where, args.args); in deleteId()
143 SQLiteDatabase db = mOpenHelper.getWritableDatabase(); in insert() local
144 final long rowId = dbInsertAndCheck(mOpenHelper, db, args.table, null, initialValues); in insert()
157 SQLiteDatabase db = mOpenHelper.getWritableDatabase(); in bulkInsert() local
158 db.beginTransaction(); in bulkInsert()
[all …]
/packages/apps/Gallery2/tests/src/com/android/gallery3d/data/
DLocalDataTest.java62 SQLiteDatabase db = SQLiteDatabase.create(null); in run() local
63 prepareData(db); in run()
64 mApp = newGalleryContext(db, Looper.getMainLooper()); in run()
73 abstract void prepareData(SQLiteDatabase db); in prepareData() argument
91 public void prepareData(SQLiteDatabase db) { in prepareData() argument
92 createImageTable(db); in prepareData()
105 public void prepareData(SQLiteDatabase db) { in prepareData() argument
106 createImageTable(db); in prepareData()
107 insertImageData(db); in prepareData()
133 public void prepareData(SQLiteDatabase db) { in prepareData() argument
[all …]
/packages/apps/Browser/src/com/android/browser/provider/
DBrowserProvider2.java401 public void onCreate(SQLiteDatabase db) { in onCreate() argument
402 db.execSQL("CREATE TABLE " + TABLE_BOOKMARKS + "(" + in onCreate()
427 db.execSQL("CREATE TABLE " + TABLE_HISTORY + "(" + in onCreate()
437 db.execSQL("CREATE TABLE " + TABLE_IMAGES + " (" + in onCreate()
443 db.execSQL("CREATE INDEX imagesUrlIndex ON " + TABLE_IMAGES + in onCreate()
446 db.execSQL("CREATE TABLE " + TABLE_SEARCHES + " (" + in onCreate()
452 db.execSQL("CREATE TABLE " + TABLE_SETTINGS + " (" + in onCreate()
457 createAccountsView(db); in onCreate()
458 createThumbnails(db); in onCreate()
460 mSyncHelper.createDatabase(db); in onCreate()
[all …]
/packages/apps/Gallery2/src/com/android/photos/data/
DMediaCacheDatabase.java103 public void onCreate(SQLiteDatabase db) { in onCreate() argument
104 db.execSQL(CREATE_TABLE); in onCreate()
108 public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { in onUpgrade() argument
109 db.execSQL(DROP_TABLE); in onUpgrade()
110 onCreate(db); in onUpgrade()
116 SQLiteDatabase db = getWritableDatabase(); in getCached() local
120 Cursor cursor = db.query(TABLE, PROJECTION_ID, where, whereArgs, null, null, null); in getCached()
132 db.beginTransaction(); in getCached()
134 db.update(TABLE, values, Columns._ID + " = ?", updateArgs); in getCached()
135 db.setTransactionSuccessful(); in getCached()
[all …]
DPhotoDatabase.java87 public void onCreate(SQLiteDatabase db) { in onCreate() argument
88 createTable(db, Accounts.TABLE, getAccountTableDefinition()); in onCreate()
89 createTable(db, Albums.TABLE, getAlbumTableDefinition()); in onCreate()
90 createTable(db, Photos.TABLE, getPhotoTableDefinition()); in onCreate()
91 createTable(db, Metadata.TABLE, getMetadataTableDefinition()); in onCreate()
103 public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { in onUpgrade() argument
104 recreate(db); in onUpgrade()
108 public void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion) { in onDowngrade() argument
109 recreate(db); in onDowngrade()
112 private void recreate(SQLiteDatabase db) { in recreate() argument
[all …]
DSQLiteContentProvider.java121 SQLiteDatabase db = mOpenHelper.getWritableDatabase(); in insert() local
122 db.beginTransaction(); in insert()
125 db.setTransactionSuccessful(); in insert()
127 db.endTransaction(); in insert()
141 SQLiteDatabase db = mOpenHelper.getWritableDatabase(); in bulkInsert() local
142 db.beginTransaction(); in bulkInsert()
147 db.yieldIfContendedSafely(); in bulkInsert()
149 db.setTransactionSuccessful(); in bulkInsert()
151 db.endTransaction(); in bulkInsert()
164 SQLiteDatabase db = mOpenHelper.getWritableDatabase(); in update() local
[all …]
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/dictionarypack/
DMetadataDbHelper.java194 private void createClientTable(final SQLiteDatabase db) { in createClientTable() argument
197 db.execSQL(METADATA_CREATE_CLIENT_TABLE); in createClientTable()
203 db.insert(CLIENT_TABLE_NAME, null, defaultMetadataValues); in createClientTable()
215 public void onCreate(final SQLiteDatabase db) { in onCreate() argument
216 db.execSQL(METADATA_TABLE_CREATE); in onCreate()
217 createClientTable(db); in onCreate()
224 public void onUpgrade(final SQLiteDatabase db, final int oldVersion, final int newVersion) { in onUpgrade() argument
233 createClientTable(db); in onUpgrade()
238 db.execSQL("DROP TABLE IF EXISTS " + METADATA_TABLE_NAME); in onUpgrade()
239 db.execSQL("DROP TABLE IF EXISTS " + CLIENT_TABLE_NAME); in onUpgrade()
[all …]
DActionBatch.java114 final SQLiteDatabase db = MetadataDbHelper.getDb(context, mClientId); in execute() local
115 final ContentValues values = MetadataDbHelper.getContentValuesByWordListId(db, in execute()
128 MetadataDbHelper.markEntryAsAvailable(db, mWordList.mId, mWordList.mVersion); in execute()
179 final long downloadId = UpdateHandler.registerDownloadRequest(manager, request, db, in execute()
217 final SQLiteDatabase db = MetadataDbHelper.getDb(context, mClientId); in execute() local
218 MetadataDbHelper.markEntryAsFinishedDownloadingAndInstalled(db, mWordListValues); in execute()
244 final SQLiteDatabase db = MetadataDbHelper.getDb(context, mClientId); in execute() local
245 final ContentValues values = MetadataDbHelper.getContentValuesByWordListId(db, in execute()
254 MetadataDbHelper.markEntryAsEnabled(db, mWordList.mId, mWordList.mVersion); in execute()
279 final SQLiteDatabase db = MetadataDbHelper.getDb(context, mClientId); in execute() local
[all …]
/packages/providers/CalendarProvider/tests/src/com/android/providers/calendar/
DCalendarDatabaseHelperTest.java49 protected void bootstrapDbVersion50(SQLiteDatabase db) { in bootstrapDbVersion50() argument
53 syncStateHelper.createDatabase(db); in bootstrapDbVersion50()
55 db.execSQL("CREATE TABLE Calendars (" + in bootstrapDbVersion50()
77 db.execSQL("CREATE TRIGGER calendar_cleanup DELETE ON Calendars " + in bootstrapDbVersion50()
84 db.execSQL("CREATE TABLE Events (" + in bootstrapDbVersion50()
121 db.execSQL("CREATE INDEX eventsCalendarIdIndex ON Events (calendar_id);"); in bootstrapDbVersion50()
123 db.execSQL("CREATE TABLE EventsRawTimes (" + in bootstrapDbVersion50()
136 db.execSQL("CREATE TABLE DeletedEvents (" + in bootstrapDbVersion50()
143 db.execSQL("CREATE TABLE Instances (" + in bootstrapDbVersion50()
155 db.execSQL("CREATE INDEX instancesStartDayIndex ON Instances (startDay);"); in bootstrapDbVersion50()
[all …]
/packages/providers/DownloadProvider/src/com/android/providers/downloads/
DDownloadProvider.java232 public void onCreate(final SQLiteDatabase db) { in onCreate() argument
236 onUpgrade(db, 0, DB_VERSION); in onCreate()
247 public void onUpgrade(final SQLiteDatabase db, int oldV, final int newV) { in onUpgrade() argument
266 upgradeTo(db, version); in onUpgrade()
273 private void upgradeTo(SQLiteDatabase db, int version) { in upgradeTo() argument
276 createDownloadsTable(db); in upgradeTo()
280 createHeadersTable(db); in upgradeTo()
284 addColumn(db, DB_TABLE, Downloads.Impl.COLUMN_IS_PUBLIC_API, in upgradeTo()
286 addColumn(db, DB_TABLE, Downloads.Impl.COLUMN_ALLOW_ROAMING, in upgradeTo()
288 addColumn(db, DB_TABLE, Downloads.Impl.COLUMN_ALLOWED_NETWORK_TYPES, in upgradeTo()
[all …]
/packages/apps/QuickSearchBox/src/com/android/quicksearchbox/
DShortcutRepositoryImplLog.java224 protected Boolean performQuery(SQLiteDatabase db) { in hasHistory()
225 return hasHistory(db); in hasHistory()
235 public boolean performTransaction(SQLiteDatabase db) { in removeFromHistory()
236 db.delete(Shortcuts.TABLE_NAME, Shortcuts.intent_key.fullName + " = ?", in removeFromHistory()
246 public boolean performTransaction(SQLiteDatabase db) { in clearHistory()
247 db.delete(ClickLog.TABLE_NAME, null, null); in clearHistory()
248 db.delete(Shortcuts.TABLE_NAME, null, null); in clearHistory()
249 db.delete(SourceStats.TABLE_NAME, null, null); in clearHistory()
288 protected Map<String, Integer> performQuery(SQLiteDatabase db) { in getCorpusScores()
296 private boolean hasHistory(SQLiteDatabase db) { in hasHistory() argument
[all …]
/packages/apps/Gallery2/src/com/android/gallery3d/gadget/
DWidgetDatabaseHelper.java100 public void onCreate(SQLiteDatabase db) { in onCreate() argument
101 db.execSQL("CREATE TABLE " + TABLE_WIDGETS + " (" in onCreate()
110 private void saveData(SQLiteDatabase db, int oldVersion, ArrayList<Entry> data) { in saveData() argument
112 Cursor cursor = db.query("photos", in saveData()
128 Cursor cursor = db.query("photos", in saveData()
147 private void restoreData(SQLiteDatabase db, ArrayList<Entry> data) { in restoreData() argument
148 db.beginTransaction(); in restoreData()
157 db.insert(TABLE_WIDGETS, null, values); in restoreData()
159 db.setTransactionSuccessful(); in restoreData()
161 db.endTransaction(); in restoreData()
[all …]
/packages/providers/PartnerBookmarksProvider/src/com/android/providers/partnerbookmarks/
DPartnerBookmarksProvider.java146 final SQLiteDatabase db = mOpenHelper.getWritableDatabase(); in prepareForConfiguration() local
151 db.delete(TABLE_BOOKMARKS, null, null); in prepareForConfiguration()
152 if (!createDefaultBookmarks(db)) { in prepareForConfiguration()
154 db.delete(TABLE_BOOKMARKS, null, null); in prepareForConfiguration()
165 private void createTable(SQLiteDatabase db) { in createTable() argument
166 db.execSQL("CREATE TABLE " + TABLE_BOOKMARKS + "(" + in createTable()
183 private void dropTable(SQLiteDatabase db) { in dropTable() argument
184 db.execSQL("DROP TABLE IF EXISTS " + TABLE_BOOKMARKS); in dropTable()
188 public void onCreate(SQLiteDatabase db) { in onCreate() argument
190 createTable(db); in onCreate()
[all …]

12345