Home
last modified time | relevance | path

Searched refs:mDatabase (Results 1 – 25 of 33) sorted by relevance

12

/frameworks/base/core/tests/coretests/src/android/database/
DDatabaseGeneralTest.java52 private SQLiteDatabase mDatabase; field in DatabaseGeneralTest
63 mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null); in setUp()
64 assertNotNull(mDatabase); in setUp()
65 mDatabase.setVersion(CURRENT_DATABASE_VERSION); in setUp()
70 mDatabase.close(); in tearDown()
85 mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, data TEXT);"); in populateDefaultTable()
87 mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString1 + "');"); in populateDefaultTable()
88 mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString2 + "');"); in populateDefaultTable()
89 mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString3 + "');"); in populateDefaultTable()
94 assertEquals(CURRENT_DATABASE_VERSION, mDatabase.getVersion()); in testVersion()
[all …]
DNewDatabasePerformanceTests.java41 protected SQLiteDatabase mDatabase; field in NewDatabasePerformanceTests.PerformanceBase
49 mDatabase = in setUp()
52 assertTrue(mDatabase != null); in setUp()
53 mDatabase.setVersion(CURRENT_DATABASE_VERSION); in setUp()
57 mDatabase.close(); in tearDown()
123 mDatabase in setUp()
129 mDatabase.execSQL(statements[i]); in testRun()
155 mDatabase in setUp()
157 mDatabase.execSQL("CREATE INDEX i1c ON t1(c)"); in setUp()
162 mDatabase.execSQL(statements[i]); in testRun()
[all …]
DDatabasePerformanceTests.java81 protected SQLiteDatabase mDatabase; field in DatabasePerformanceTests.PerformanceBase
91 mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null); in setUp()
92 Assert.assertTrue(mDatabase != null); in setUp()
93 mDatabase.setVersion(CURRENT_DATABASE_VERSION); in setUp()
97 mDatabase.close(); in tearDown()
214 mDatabase in setUp()
221 mDatabase.execSQL(statements[i]); in run()
247 mDatabase in setUp()
249 mDatabase.execSQL("CREATE INDEX i1c ON t1(c)"); in setUp()
255 mDatabase.execSQL(statements[i]); in run()
[all …]
DDatabaseStatementTest.java38 private SQLiteDatabase mDatabase; field in DatabaseStatementTest
50 mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null); in setUp()
51 assertNotNull(mDatabase); in setUp()
52 mDatabase.setVersion(CURRENT_DATABASE_VERSION); in setUp()
57 mDatabase.close(); in tearDown()
72 mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, data TEXT);"); in populateDefaultTable()
74 mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString1 + "');"); in populateDefaultTable()
75 mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString2 + "');"); in populateDefaultTable()
76 mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString3 + "');"); in populateDefaultTable()
82 SQLiteStatement statement = mDatabase.compileStatement("DELETE FROM test"); in testExecuteStatement()
[all …]
DDatabaseCursorTest.java49 private SQLiteDatabase mDatabase; field in DatabaseCursorTest
61 mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null); in setUp()
62 assertNotNull(mDatabase); in setUp()
63 mDatabase.setVersion(CURRENT_DATABASE_VERSION); in setUp()
68 mDatabase.close(); in tearDown()
83 mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, data TEXT);"); in populateDefaultTable()
85 mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString1 + "');"); in populateDefaultTable()
86 mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString2 + "');"); in populateDefaultTable()
87 mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString3 + "');"); in populateDefaultTable()
93 mDatabase.execSQL( in testBlob()
[all …]
DDatabaseLockTest.java38 private SQLiteDatabase mDatabase; field in DatabaseLockTest
51 mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null); in setUp()
52 assertNotNull(mDatabase); in setUp()
57 mDatabase.close(); in tearDown()
74 mDatabase.beginTransaction(); in testLockFairness()
85 mDatabase.endTransaction(); in testLockFairness()
101 mDatabase.beginTransaction(); in run()
108 mDatabase.endTransaction(); in run()
126 mDatabase.beginTransaction(); in testLockLatency()
138 mDatabase.endTransaction(); in testLockLatency()
[all …]
DDatabaseStressTest.java34 private SQLiteDatabase mDatabase; field in DatabaseStressTest
47 mDatabase = c.openOrCreateDatabase("database_test.db", 0, null); in setUp()
49 assertNotNull(mDatabase); in setUp()
50 mDatabase.setVersion(CURRENT_DATABASE_VERSION); in setUp()
52 mDatabase.execSQL("CREATE TABLE IF NOT EXISTS test (_id INTEGER PRIMARY KEY, data TEXT);"); in setUp()
58 mDatabase.close(); in tearDown()
71 mDatabase.execSQL("INSERT INTO test (data) VALUES (?)", strArr); in testSingleThreadInsertDelete()
72 mDatabase.execSQL("delete from test;"); in testSingleThreadInsertDelete()
93 mDatabase.execSQL("INSERT INTO test (data) VALUES (?)", strArr); in testOutOfSpace()
DDatabaseLocaleTest.java33 private SQLiteDatabase mDatabase; field in DatabaseLocaleTest
48 mDatabase = SQLiteDatabase.create(null); in setUp()
49 mDatabase.execSQL( in setUp()
55 mDatabase.execSQL("INSERT INTO test (data) VALUES('" + s + "');"); in insertStrings()
61 mDatabase.close(); in tearDown()
67 Cursor c = mDatabase.rawQuery(sql, null); in query()
91 mDatabase.setLocale(new Locale("en", "US")); in testLocaleenUS()
114 mDatabase.execSQL("INSERT INTO test(id, data) VALUES(1, '" + expectedString + "')"); in testHoge()
115 cursor = mDatabase.rawQuery("SELECT data FROM test WHERE id = 1", null); in testHoge()
DDatabaseErrorHandlerTest.java33 private SQLiteDatabase mDatabase; field in DatabaseErrorHandlerTest
46 mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null, in setUp()
48 assertNotNull(mDatabase); in setUp()
53 mDatabase.close(); in tearDown()
59 new MyDatabaseCorruptionHandler().onCorruption(mDatabase); in testNoCorruptionCase()
66 mDatabase.execSQL("create table t (i int);"); in testDatabaseIsCorrupt()
75 mDatabase.execSQL("select * from t;"); in testDatabaseIsCorrupt()
/frameworks/base/packages/MtpDocumentsProvider/tests/src/com/android/mtp/
DMtpDatabaseTest.java57 MtpDatabase mDatabase; field in MtpDatabaseTest
61 mDatabase = new MtpDatabase(getContext(), MtpDatabaseConstants.FLAG_DATABASE_IN_MEMORY); in setUp()
66 mDatabase.close(); in tearDown()
67 mDatabase = null; in tearDown()
85 mDatabase.getMapper().startAddingDocuments("1"); in testPutSingleStorageDocuments()
86 mDatabase.getMapper().putStorageDocuments("1", OPERATIONS_SUPPORTED, new MtpRoot[] { in testPutSingleStorageDocuments()
89 mDatabase.getMapper().stopAddingDocuments("1"); in testPutSingleStorageDocuments()
92 final Cursor cursor = mDatabase.queryRootDocuments(COLUMN_NAMES); in testPutSingleStorageDocuments()
116 final Cursor cursor = mDatabase.queryRoots(resources, new String [] { in testPutSingleStorageDocuments()
147 mDatabase.getMapper().startAddingDocuments("1"); in testPutStorageDocuments()
[all …]
DDocumentLoaderTest.java36 private MtpDatabase mDatabase; field in DocumentLoaderTest
45 mDatabase = new MtpDatabase(getContext(), MtpDatabaseConstants.FLAG_DATABASE_IN_MEMORY); in setUp()
47 mDatabase.getMapper().startAddingDocuments(null); in setUp()
48 mDatabase.getMapper().putDeviceDocument( in setUp()
50 mDatabase.getMapper().stopAddingDocuments(null); in setUp()
52 mDatabase.getMapper().startAddingDocuments("1"); in setUp()
53 mDatabase.getMapper().putStorageDocuments("1", new int[0], new MtpRoot[] { in setUp()
56 mDatabase.getMapper().stopAddingDocuments("1"); in setUp()
65 mDatabase.close(); in tearDown()
185 mDatabase); in setUpLoader()
DPipeManagerTest.java35 private MtpDatabase mDatabase; field in PipeManagerTest
41 mDatabase = new MtpDatabase(getContext(), MtpDatabaseConstants.FLAG_DATABASE_IN_MEMORY); in setUp()
42 mPipeManager = new PipeManager(mDatabase, mExecutor); in setUp()
48 mDatabase.close(); in tearDown()
/frameworks/base/core/tests/coretests/src/android/database/sqlite/
DSQLiteCursorTest.java30 private SQLiteDatabase mDatabase; field in SQLiteCursorTest
42 mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null); in setUp()
43 assertNotNull(mDatabase); in setUp()
45 mDatabase.execSQL("CREATE TABLE " + TABLE_NAME + " (i int, j int);"); in setUp()
50 mDatabase.close(); in tearDown()
62 mDatabase.beginTransaction(); in testFillWindow()
63 mDatabase.execSQL("CREATE TABLE " + testTable + " (col1 int, desc text not null);"); in testFillWindow()
64 mDatabase.setTransactionSuccessful(); in testFillWindow()
65 mDatabase.endTransaction(); in testFillWindow()
82 mDatabase.beginTransaction(); in testFillWindow()
[all …]
/frameworks/base/core/java/android/database/sqlite/
DSQLiteOpenHelper.java58 private SQLiteDatabase mDatabase; field in SQLiteOpenHelper
130 if (mDatabase != null && mDatabase.isOpen() && !mDatabase.isReadOnly()) { in setWriteAheadLoggingEnabled()
132 mDatabase.enableWriteAheadLogging(); in setWriteAheadLoggingEnabled()
134 mDatabase.disableWriteAheadLogging(); in setWriteAheadLoggingEnabled()
192 if (mDatabase != null) { in getDatabaseLocked()
193 if (!mDatabase.isOpen()) { in getDatabaseLocked()
195 mDatabase = null; in getDatabaseLocked()
196 } else if (!writable || !mDatabase.isReadOnly()) { in getDatabaseLocked()
198 return mDatabase; in getDatabaseLocked()
206 SQLiteDatabase db = mDatabase; in getDatabaseLocked()
[all …]
DSQLiteProgram.java33 private final SQLiteDatabase mDatabase; field in SQLiteProgram
42 mDatabase = db; in SQLiteProgram()
84 return mDatabase; in getDatabase()
101 return mDatabase.getThreadSession(); in getSession()
106 return mDatabase.getThreadDefaultConnectionFlags(mReadOnly); in getConnectionFlags()
111 mDatabase.onCorruption(); in onCorruption()
DSQLiteDirectCursorDriver.java29 private final SQLiteDatabase mDatabase; field in SQLiteDirectCursorDriver
37 mDatabase = db; in SQLiteDirectCursorDriver()
44 final SQLiteQuery query = new SQLiteQuery(mDatabase, mSql, mCancellationSignal); in query()
52 cursor = factory.newCursor(mDatabase, this, mEditTable, query); in query()
/frameworks/base/packages/MtpDocumentsProvider/src/com/android/mtp/
DMtpDatabase.java85 private final SQLiteDatabase mDatabase; field in MtpDatabase
89 return mDatabase; in getSQLiteDatabase()
94 mDatabase = helper.getWritableDatabase(); in MtpDatabase()
99 mDatabase.close(); in close()
118 final Cursor deviceCursor = mDatabase.query( in queryRoots()
138 mDatabase, in queryRoots()
151 mDatabase, in queryRoots()
223 return mDatabase.query( in queryRootDocuments()
240 return mDatabase.query( in queryChildDocuments()
262 try (final Cursor cursor = mDatabase.query( in getStorageDocumentIds()
[all …]
DMtpDocumentsProvider.java88 private MtpDatabase mDatabase; field in MtpDocumentsProvider
108 mDatabase = new MtpDatabase(getContext(), MtpDatabaseConstants.FLAG_DATABASE_IN_FILE); in onCreate()
109 mRootScanner = new RootScanner(mResolver, mMtpManager, mDatabase); in onCreate()
117 final int lastBootCount = mDatabase.getLastBootCount(); in onCreate()
119 mDatabase.setLastBootCount(bootCount); in onCreate()
126 mDatabase.cleanDatabase(uris); in onCreate()
160 mDatabase = database; in onCreateForTesting()
161 mRootScanner = new RootScanner(mResolver, mMtpManager, mDatabase); in onCreateForTesting()
181 final Cursor cursor = mDatabase.queryRoots(mResources, projection); in queryRoots()
193 return mDatabase.queryDocument(documentId, projection); in queryDocument()
[all …]
DRootScanner.java56 final MtpDatabase mDatabase; field in RootScanner
67 mDatabase = database; in RootScanner()
138 mDatabase.getMapper().startAddingDocuments(null /* parentDocumentId */); in run()
140 if (mDatabase.getMapper().putDeviceDocument(device)) { in run()
144 if (mDatabase.getMapper().stopAddingDocuments( in run()
157 final String documentId = mDatabase.getDocumentIdForDevice(device.deviceId); in run()
162 mDatabase.getMapper().startAddingDocuments(documentId); in run()
163 if (mDatabase.getMapper().putStorageDocuments( in run()
167 if (mDatabase.getMapper().stopAddingDocuments(documentId)) { in run()
DMapper.java44 private final MtpDatabase mDatabase; field in Mapper
52 mDatabase = database; in Mapper()
62 final SQLiteDatabase database = mDatabase.getSQLiteDatabase(); in putDeviceDocument()
95 final SQLiteDatabase database = mDatabase.getSQLiteDatabase(); in putStorageDocuments()
163 final SQLiteDatabase database = mDatabase.getSQLiteDatabase(); in clearMapping()
200 final SQLiteDatabase database = mDatabase.getSQLiteDatabase(); in startAddingDocuments()
245 final SQLiteDatabase database = mDatabase.getSQLiteDatabase(); in putDocuments()
271 mDatabase.writeRowSnapshot(String.valueOf(rowId), oldRowSnapshot); in putDocuments()
288 mDatabase.writeRowSnapshot(String.valueOf(rowId), newRowSnapshot); in putDocuments()
329 final SQLiteDatabase database = mDatabase.getSQLiteDatabase(); in stopAddingDocuments()
[all …]
DDocumentLoader.java53 private final MtpDatabase mDatabase; field in DocumentLoader
62 mDatabase = database; in DocumentLoader()
85 task = new LoaderTask(mMtpManager, mDatabase, mDevice.operationsSupported, parent); in queryChildDocuments()
126 final Identifier identifier = mDatabase.getUnmappedDocumentsParent(mDevice.deviceId); in getNextTaskOrReleaseBackgroundThread()
134 mMtpManager, mDatabase, mDevice.operationsSupported, identifier); in getNextTaskOrReleaseBackgroundThread()
246 final MtpDatabase mDatabase; field in DocumentLoader.LoaderTask
260 mDatabase = database; in LoaderTask()
304 mDatabase.queryChildDocuments(columnNames, mIdentifier.mDocumentId); in createCursor()
320 mDatabase.getMapper().startAddingDocuments(mIdentifier.mDocumentId); in loadObjectInfoList()
377 mDatabase.getMapper().putChildDocuments( in loadObjectInfoList()
[all …]
/frameworks/av/media/mtp/
DMtpServer.cpp103 mDatabase(database), in MtpServer()
242 mDatabase->sessionEnded(); in run()
311 mDatabase->endSendObject((const char *)edit->mPath, edit->mHandle, edit->mFormat, true); in commitEdit()
443 MtpObjectFormatList* playbackFormats = mDatabase->getSupportedPlaybackFormats(); in doGetDeviceInfo()
444 MtpObjectFormatList* captureFormats = mDatabase->getSupportedCaptureFormats(); in doGetDeviceInfo()
445 MtpDevicePropertyList* deviceProperties = mDatabase->getSupportedDeviceProperties(); in doGetDeviceInfo()
505 mDatabase->sessionStarted(); in doOpenSession()
515 mDatabase->sessionEnded(); in doCloseSession()
563 MtpObjectPropertyList* properties = mDatabase->getSupportedObjectProperties(format); in doGetObjectPropsSupported()
582 MtpObjectHandleList* handles = mDatabase->getObjectList(storageID, format, parent); in doGetObjectHandles()
[all …]
/frameworks/base/services/usage/java/com/android/server/usage/
DUserUsageStatsService.java60 private final UsageStatsDatabase mDatabase; field in UserUsageStatsService
87 mDatabase = new UsageStatsDatabase(usageStatsDir); in UserUsageStatsService()
95 mDatabase.init(currentTimeMillis); in init()
99 mCurrentStats[i] = mDatabase.getLatestUsageStats(i); in init()
142 if (mDatabase.isNewUpdate()) { in init()
149 mDatabase.onTimeChanged(newTime - oldTime); in onTimeChanged()
236 intervalType = mDatabase.findBestFitBucket(beginTime, endTime); in queryStats()
273 List<T> results = mDatabase.queryUsageStats(intervalType, beginTime, in queryStats()
353 mDatabase.putUsageStats(i, mCurrentStats[i]); in persistActiveStats()
388 mDatabase.prune(currentTimeMillis); in rolloverStats()
[all …]
/frameworks/support/v7/appcompat/tests/src/android/support/v7/app/
DAlertDialogCursorTest.java70 private SQLiteDatabase mDatabase; field in AlertDialogCursorTest
106 mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null); in setUp()
107 assertNotNull(mDatabase); in setUp()
109 mDatabase.execSQL( in setUp()
113 mDatabase.execSQL("INSERT INTO test (" + TEXT_COLUMN_NAME + ", " + in setUp()
132 if (mDatabase != null) { in tearDown()
133 mDatabase.close(); in tearDown()
186 mCursor = mDatabase.query("test", mProjectionWithoutChecked, in testSimpleItemsFromCursor()
285 mCursor = mDatabase.query("test", mProjectionWithChecked, in testMultiChoiceItemsFromCursor()
302 mDatabase.update("test", valuesToUpdate, in testMultiChoiceItemsFromCursor()
[all …]
/frameworks/base/media/java/android/mtp/
DMtpServer.java26 private final MtpDatabase mDatabase; field in MtpServer
33 mDatabase = database; in MtpServer()
47 mDatabase.close(); in run()

12