Home
last modified time | relevance | path

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

12

/frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/
DDatabaseHelper.java94 private void createSecureTable(SQLiteDatabase db) { in createSecureTable() argument
95 db.execSQL("CREATE TABLE secure (" + in createSecureTable()
100 db.execSQL("CREATE INDEX secureIndex1 ON secure (name);"); in createSecureTable()
104 public void onCreate(SQLiteDatabase db) { in onCreate() argument
105 db.execSQL("CREATE TABLE system (" + in onCreate()
110 db.execSQL("CREATE INDEX systemIndex1 ON system (name);"); in onCreate()
112 createSecureTable(db); in onCreate()
114 db.execSQL("CREATE TABLE bluetooth_devices (" + in onCreate()
122 db.execSQL("CREATE TABLE bookmarks (" + in onCreate()
131 db.execSQL("CREATE INDEX bookmarksIndex1 ON bookmarks (folder);"); in onCreate()
[all …]
DSettingsProvider.java262 SQLiteDatabase db = mOpenHelper.getWritableDatabase(); in onCreate() local
263 sObserverInstance = new SettingsFileObserver(db.getPath()); in onCreate()
284 SQLiteDatabase db = mOpenHelper.getReadableDatabase(); in fullyPopulateCache() local
285 Cursor c = db.query( in fullyPopulateCache()
375 SQLiteDatabase db = mOpenHelper.getReadableDatabase(); in lookupValue() local
378 cursor = db.query(table, COLUMN_VALUE, "name=?", new String[]{key}, in lookupValue()
397 SQLiteDatabase db = mOpenHelper.getReadableDatabase(); in query() local
408 Cursor cursor = db.rawQuery("PRAGMA table_info(favorites);", null); in query()
421 Cursor ret = qb.query(db, select, args.where, args.args, null, null, sort); in query()
448 SQLiteDatabase db = mOpenHelper.getWritableDatabase(); in bulkInsert() local
[all …]
/frameworks/base/core/java/android/database/sqlite/
DSQLiteOpenHelper.java207 SQLiteDatabase db = mDatabase; in getDatabaseLocked() local
211 if (db != null) { in getDatabaseLocked()
212 if (writable && db.isReadOnly()) { in getDatabaseLocked()
213 db.reopenReadWrite(); in getDatabaseLocked()
216 db = SQLiteDatabase.create(null); in getDatabaseLocked()
221 db = SQLiteDatabase.openDatabase(path, mFactory, in getDatabaseLocked()
224 db = mContext.openOrCreateDatabase(mName, mEnableWriteAheadLogging ? in getDatabaseLocked()
235 db = SQLiteDatabase.openDatabase(path, mFactory, in getDatabaseLocked()
240 onConfigure(db); in getDatabaseLocked()
242 final int version = db.getVersion(); in getDatabaseLocked()
[all …]
DSQLiteQueryBuilder.java291 public Cursor query(SQLiteDatabase db, String[] projectionIn, in query() argument
294 return query(db, projectionIn, selection, selectionArgs, groupBy, having, sortOrder, in query()
330 public Cursor query(SQLiteDatabase db, String[] projectionIn, in query() argument
333 return query(db, projectionIn, selection, selectionArgs, in query()
372 public Cursor query(SQLiteDatabase db, String[] projectionIn, in query() argument
389 validateQuerySql(db, sqlForValidation, in query()
400 return db.rawQueryWithFactory( in query()
410 private void validateQuerySql(SQLiteDatabase db, String sql, in validateQuerySql() argument
412 db.getThreadSession().prepare(sql, in validateQuerySql()
413 db.getThreadDefaultConnectionFlags(true /*readOnly*/), cancellationSignal, null); in validateQuerySql()
DSQLiteProgram.java40 SQLiteProgram(SQLiteDatabase db, String sql, Object[] bindArgs, in SQLiteProgram() argument
42 mDatabase = db; in SQLiteProgram()
58 db.getThreadSession().prepare(mSql, in SQLiteProgram()
59 db.getThreadDefaultConnectionFlags(assumeReadOnly), in SQLiteProgram()
DSQLiteQuery.java36 SQLiteQuery(SQLiteDatabase db, String query, CancellationSignal cancellationSignal) { in SQLiteQuery() argument
37 super(db, query, null, cancellationSignal); in SQLiteQuery()
DSQLiteDirectCursorDriver.java35 public SQLiteDirectCursorDriver(SQLiteDatabase db, String sql, String editTable, in SQLiteDirectCursorDriver() argument
37 mDatabase = db; in SQLiteDirectCursorDriver()
DSQLiteStatement.java30 SQLiteStatement(SQLiteDatabase db, String sql, Object[] bindArgs) { in SQLiteStatement() argument
31 super(db, sql, bindArgs, null); in SQLiteStatement()
/frameworks/ex/common/java/com/android/common/content/
DSyncStateContentProviderHelper.java54 public void createDatabase(SQLiteDatabase db) { in createDatabase() argument
55 db.execSQL("DROP TABLE IF EXISTS " + SYNC_STATE_TABLE); in createDatabase()
56 db.execSQL("CREATE TABLE " + SYNC_STATE_TABLE + " (" in createDatabase()
64 db.execSQL("DROP TABLE IF EXISTS " + SYNC_STATE_META_TABLE); in createDatabase()
65 db.execSQL("CREATE TABLE " + SYNC_STATE_META_TABLE + " (" in createDatabase()
69 db.insert(SYNC_STATE_META_TABLE, SYNC_STATE_META_VERSION_COLUMN, values); in createDatabase()
72 public void onDatabaseOpened(SQLiteDatabase db) { in onDatabaseOpened() argument
73 long version = DatabaseUtils.longForQuery(db, in onDatabaseOpened()
77 createDatabase(db); in onDatabaseOpened()
81 public Cursor query(SQLiteDatabase db, String[] projection, in query() argument
[all …]
/frameworks/base/services/java/com/android/server/
DBootReceiver.java86 final DropBoxManager db = (DropBoxManager) ctx.getSystemService(Context.DROPBOX_SERVICE); in logBootEvents() local
98 if (recovery != null && db != null) { in logBootEvents()
99 db.addText("SYSTEM_RECOVERY_LOG", headers + recovery); in logBootEvents()
105 if (db != null) db.addText("SYSTEM_BOOT", headers); in logBootEvents()
108 addFileToDropBox(db, prefs, headers, "/proc/last_kmsg", in logBootEvents()
110 addFileToDropBox(db, prefs, headers, "/cache/recovery/log", in logBootEvents()
112 addFileToDropBox(db, prefs, headers, "/data/dontpanic/apanic_console", in logBootEvents()
114 addFileToDropBox(db, prefs, headers, "/data/dontpanic/apanic_threads", in logBootEvents()
117 if (db != null) db.addText("SYSTEM_RESTART", headers); in logBootEvents()
123 addFileToDropBox(db, prefs, headers, tombstoneFiles[i].getPath(), in logBootEvents()
[all …]
/frameworks/base/tests/LocationTracker/src/com/android/locationtracker/data/
DTrackerProvider.java56 public void onCreate(SQLiteDatabase db) { in onCreate() argument
62 db.execSQL(queryBuilder.toString()); in onCreate()
63 db.setVersion(DB_VERSION); in onCreate()
67 public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { in onUpgrade() argument
72 db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME); in onUpgrade()
73 onCreate(db); in onUpgrade()
87 SQLiteDatabase db = mOpenHelper.getWritableDatabase(); in delete() local
88 int result = db.delete(TABLE_NAME, selection, selectionArgs); in delete()
100 SQLiteDatabase db = mOpenHelper.getWritableDatabase(); in insert() local
101 long rowId = db.insert(TABLE_NAME, null, values); in insert()
[all …]
/frameworks/base/packages/WAPPushManager/src/com/android/smspush/
DWapPushManager.java73 public void onCreate(SQLiteDatabase db) { in onCreate() argument
88 db.execSQL(sql); in onCreate()
92 public void onUpgrade(SQLiteDatabase db, in onUpgrade() argument
118 protected queryData queryLastApp(SQLiteDatabase db, in queryLastApp() argument
127 Cursor cur = db.rawQuery(sql, null); in queryLastApp()
182 SQLiteDatabase db = dbh.getReadableDatabase(); in processMessage() local
183 WapPushManDBHelper.queryData lastapp = dbh.queryLastApp(db, app_id, content_type); in processMessage()
184 db.close(); in processMessage()
243 SQLiteDatabase db = dbh.getWritableDatabase(); in addPackage() local
244 WapPushManDBHelper.queryData lastapp = dbh.queryLastApp(db, x_app_id, content_type); in addPackage()
[all …]
/frameworks/base/tests/DumpRenderTree2/src/com/android/dumprendertree2/
DSummarizerDBHelper.java53 private static final void createTables(SQLiteDatabase db) { in createTables() argument
60 db.execSQL(cmd); in createTables()
64 private static final void dropTables(SQLiteDatabase db) { in dropTables() argument
66 db.execSQL("DROP TABLE IF EXISTS " + tableName); in dropTables()
76 public void onCreate(SQLiteDatabase db) { in onCreate() argument
77 dropTables(db); in onCreate()
78 createTables(db); in onCreate()
82 public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { in onUpgrade() argument
86 public void reset(SQLiteDatabase db) { in reset() argument
87 dropTables(db); in reset()
[all …]
/frameworks/base/core/jni/
Dandroid_database_SQLiteConnection.cpp79 sqlite3* const db; member
86 SQLiteConnection(sqlite3* db, int openFlags, const String8& path, const String8& label) : in SQLiteConnection()
87 db(db), openFlags(openFlags), path(path), label(label), canceled(false) { } in SQLiteConnection()
130 sqlite3* db; in nativeOpen() local
131 int err = sqlite3_open_v2(path.string(), &db, sqliteFlags, NULL); in nativeOpen()
138 if ((sqliteFlags & SQLITE_OPEN_READWRITE) && sqlite3_db_readonly(db, NULL)) { in nativeOpen()
139 throw_sqlite3_exception(env, db, "Could not open the database in read/write mode."); in nativeOpen()
140 sqlite3_close(db); in nativeOpen()
145 err = sqlite3_busy_timeout(db, BUSY_TIMEOUT_MS); in nativeOpen()
147 throw_sqlite3_exception(env, db, "Could not set busy timeout"); in nativeOpen()
[all …]
/frameworks/base/core/tests/coretests/src/android/app/activity/
DLocalProvider.java53 public void onCreate(SQLiteDatabase db) { in onCreate() argument
54 db.execSQL("CREATE TABLE data (" + in onCreate()
60 db.execSQL("INSERT INTO data (text, integer) VALUES ('first data', 100);"); in onCreate()
64 public void onUpgrade(SQLiteDatabase db, int oldVersion, int currentVersion) { in onUpgrade() argument
68 db.execSQL("DROP TABLE IF EXISTS data"); in onUpgrade()
69 onCreate(db); in onUpgrade()
103 SQLiteDatabase db = mOpenHelper.getReadableDatabase(); in query() local
104 Cursor ret = qb.query(db, projectionIn, selection, selectionArgs, in query()
134 SQLiteDatabase db = mOpenHelper.getWritableDatabase(); in update() local
139 count = db.update("data", values, "_id=" + rowId, null); in update()
/frameworks/base/core/java/com/android/internal/content/
DSelectionBuilder.java99 public Cursor query(SQLiteDatabase db, String table, String[] columns, String orderBy) { in query() argument
100 return query(db, table, columns, null, null, orderBy, null); in query()
106 public Cursor query(SQLiteDatabase db, String table, String[] columns, String groupBy, in query() argument
108 return db.query(table, columns, getSelection(), getSelectionArgs(), groupBy, having, in query()
115 public int update(SQLiteDatabase db, String table, ContentValues values) { in update() argument
116 return db.update(table, values, getSelection(), getSelectionArgs()); in update()
122 public int delete(SQLiteDatabase db, String table) { in delete() argument
123 return db.delete(table, getSelection(), getSelectionArgs()); in delete()
/frameworks/base/core/java/com/android/internal/widget/
DLockSettingsService.java270 SQLiteDatabase db = mOpenHelper.getWritableDatabase(); in removeUser() local
281 db.beginTransaction(); in removeUser()
282 db.delete(TABLE, COLUMN_USERID + "='" + userId + "'", null); in removeUser()
283 db.setTransactionSuccessful(); in removeUser()
285 db.endTransaction(); in removeUser()
311 SQLiteDatabase db = mOpenHelper.getWritableDatabase(); in writeToDb() local
312 db.beginTransaction(); in writeToDb()
314 db.delete(TABLE, COLUMN_KEY + "=? AND " + COLUMN_USERID + "=?", in writeToDb()
316 db.insert(TABLE, null, cv); in writeToDb()
317 db.setTransactionSuccessful(); in writeToDb()
[all …]
/frameworks/base/core/java/android/accounts/
DAccountManagerService.java268 final SQLiteDatabase db = accounts.openHelper.getWritableDatabase(); in purgeOldGrants() local
269 final Cursor cursor = db.query(TABLE_GRANTS, in purgeOldGrants()
281 db.delete(TABLE_GRANTS, GRANTS_GRANTEE_UID + "=?", in purgeOldGrants()
292 final SQLiteDatabase db = accounts.openHelper.getWritableDatabase(); in validateAccountsAndPopulateCache() local
294 Cursor cursor = db.query(TABLE_ACCOUNTS, in validateAccountsAndPopulateCache()
309 db.delete(TABLE_ACCOUNTS, ACCOUNTS_ID + "=" + accountId, null); in validateAccountsAndPopulateCache()
426 final SQLiteDatabase db = accounts.openHelper.getReadableDatabase(); in readPasswordInternal() local
427 Cursor cursor = db.query(TABLE_ACCOUNTS, new String[]{ACCOUNTS_PASSWORD}, in readPasswordInternal()
509 final SQLiteDatabase db = accounts.openHelper.getWritableDatabase(); in addAccountInternal() local
510 db.beginTransaction(); in addAccountInternal()
[all …]
/frameworks/base/core/java/android/content/
DSearchRecentSuggestionsProvider.java137 public void onCreate(SQLiteDatabase db) { in onCreate() argument
148 db.execSQL(builder.toString()); in onCreate()
152 public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { in onUpgrade() argument
155 db.execSQL("DROP TABLE IF EXISTS suggestions"); in onUpgrade()
156 onCreate(db); in onUpgrade()
226 SQLiteDatabase db = mOpenHelper.getWritableDatabase(); in delete() local
236 count = db.delete(sSuggestions, selection, selectionArgs); in delete()
273 SQLiteDatabase db = mOpenHelper.getWritableDatabase(); in insert() local
285 rowID = db.insert(sSuggestions, NULL_COLUMN, values); in insert()
321 SQLiteDatabase db = mOpenHelper.getReadableDatabase(); in query() local
[all …]
/frameworks/base/core/tests/coretests/src/android/content/
DMemoryFileProvider.java71 public void onCreate(SQLiteDatabase db) { in onCreate() argument
72 db.execSQL("CREATE TABLE data (" + in onCreate()
82 db.insert("data", null, values); in onCreate()
86 public void onUpgrade(SQLiteDatabase db, int oldVersion, int currentVersion) { in onUpgrade() argument
90 db.execSQL("DROP TABLE IF EXISTS data"); in onUpgrade()
91 onCreate(db); in onUpgrade()
158 SQLiteDatabase db = mOpenHelper.getReadableDatabase(); in getBlobColumnAsFile() local
159 return DatabaseUtils.blobFileDescriptorForQuery(db, sql, null); in getBlobColumnAsFile()
/frameworks/base/test-runner/src/android/test/
DDatabaseTestUtils.java37 public static void assertSchemaEquals(SQLiteDatabase expectedDb, SQLiteDatabase db) { in assertSchemaEquals() argument
39 Set<String> schema = getSchemaSet(db); in assertSchemaEquals()
43 private static Set<String> getSchemaSet(SQLiteDatabase db) { in getSchemaSet() argument
46 Cursor entityCursor = db.rawQuery("SELECT sql FROM sqlite_master", null); in getSchemaSet()
/frameworks/ml/bordeaux/service/src/android/bordeaux/services/
DBordeauxSessionStorage.java70 public void onCreate(SQLiteDatabase db) { in onCreate() argument
71 db.execSQL(DATABASE_CREATE); in onCreate()
75 public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { in onUpgrade() argument
79 db.execSQL("DROP TABLE IF EXISTS " + SESSION_TABLE); in onUpgrade()
80 onCreate(db); in onUpgrade()
/frameworks/base/core/java/android/database/
DDatabaseUtils.java760 public static long queryNumEntries(SQLiteDatabase db, String table) { in queryNumEntries() argument
761 return queryNumEntries(db, table, null, null); in queryNumEntries()
773 public static long queryNumEntries(SQLiteDatabase db, String table, String selection) { in queryNumEntries() argument
774 return queryNumEntries(db, table, selection, null); in queryNumEntries()
790 public static long queryNumEntries(SQLiteDatabase db, String table, String selection, in queryNumEntries() argument
793 return longForQuery(db, "select count(*) from " + table + s, in queryNumEntries()
801 public static long longForQuery(SQLiteDatabase db, String query, String[] selectionArgs) { in longForQuery() argument
802 SQLiteStatement prog = db.compileStatement(query); in longForQuery()
823 public static String stringForQuery(SQLiteDatabase db, String query, String[] selectionArgs) { in stringForQuery() argument
824 SQLiteStatement prog = db.compileStatement(query); in stringForQuery()
[all …]
/frameworks/base/docs/html/training/search/
Dsearch.jd88 public void onCreate(SQLiteDatabase db) {
89 mDatabase = db;
94 public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
97 db.execSQL("DROP TABLE IF EXISTS " + FTS_VIRTUAL_TABLE);
98 onCreate(db);
161 public void onCreate(SQLiteDatabase db) {
162 mDatabase = db;
205 DatabaseTable db = new DatabaseTable(this);
213 Cursor c = db.getWordMatches(query, null);
/frameworks/base/core/java/android/webkit/
DWebIconDatabaseClassic.java179 File db = new File(path); in open() local
180 if (!db.exists()) { in open()
181 db.mkdirs(); in open()
184 Message.obtain(null, EventHandler.OPEN, db.getAbsolutePath())); in open()

12