/frameworks/base/packages/MtpDocumentsProvider/tests/src/com/android/mtp/ |
D | MtpDatabaseTest.java | 57 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 …]
|
D | DocumentLoaderTest.java | 36 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()
|
/frameworks/base/core/tests/coretests/src/android/database/ |
D | DatabaseGeneralTest.java | 59 private SQLiteDatabase mDatabase; field in DatabaseGeneralTest 70 mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null); in setUp() 71 assertNotNull(mDatabase); in setUp() 72 mDatabase.setVersion(CURRENT_DATABASE_VERSION); in setUp() 77 mDatabase.close(); in tearDown() 92 mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, data TEXT);"); in populateDefaultTable() 94 mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString1 + "');"); in populateDefaultTable() 95 mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString2 + "');"); in populateDefaultTable() 96 mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString3 + "');"); in populateDefaultTable() 101 assertEquals(CURRENT_DATABASE_VERSION, mDatabase.getVersion()); in testVersion() [all …]
|
D | NewDatabasePerformanceTests.java | 65 protected SQLiteDatabase mDatabase; field in NewDatabasePerformanceTests.PerformanceBase 81 mDatabase = SQLiteDatabase.openDatabase(mDatabaseFile, params.build()); in setUp() 83 assertTrue("Cannot enable WAL", mDatabase.isWriteAheadLoggingEnabled()); in setUp() 85 mDatabase.setVersion(CURRENT_DATABASE_VERSION); in setUp() 86 mDatabase.beginTransactionNonExclusive(); in setUp() 88 mDatabase.setTransactionSuccessful(); in setUp() 89 mDatabase.endTransaction(); in setUp() 102 mDatabase.close(); in tearDown() 166 mDatabase.execSQL("CREATE TABLE " + t + "(a INTEGER, b INTEGER, c VARCHAR(100))"); in testRun() 167 mDatabase.execSQL("INSERT INTO " + t + " VALUES(" + i + "," + i + ",'" in testRun() [all …]
|
D | DatabaseStatementTest.java | 38 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 …]
|
D | DatabaseCursorTest.java | 46 private SQLiteDatabase mDatabase; field in DatabaseCursorTest 58 mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null); in setUp() 59 assertNotNull(mDatabase); in setUp() 60 mDatabase.setVersion(CURRENT_DATABASE_VERSION); in setUp() 65 mDatabase.close(); in tearDown() 80 mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, data TEXT);"); in populateDefaultTable() 82 mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString1 + "');"); in populateDefaultTable() 83 mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString2 + "');"); in populateDefaultTable() 84 mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString3 + "');"); in populateDefaultTable() 90 mDatabase.execSQL( in testBlob() [all …]
|
D | DatabaseLockTest.java | 40 private SQLiteDatabase mDatabase; field in DatabaseLockTest 53 mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null); in setUp() 54 assertNotNull(mDatabase); in setUp() 59 mDatabase.close(); in tearDown() 76 mDatabase.beginTransaction(); in testLockFairness() 87 mDatabase.endTransaction(); in testLockFairness() 103 mDatabase.beginTransaction(); in run() 110 mDatabase.endTransaction(); in run() 128 mDatabase.beginTransaction(); in testLockLatency() 140 mDatabase.endTransaction(); in testLockLatency() [all …]
|
D | DatabaseStressTest.java | 34 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()
|
D | DatabaseLocaleTest.java | 33 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()
|
D | DatabaseErrorHandlerTest.java | 33 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/core/tests/coretests/src/android/database/sqlite/ |
D | SQLiteCursorTest.java | 38 private SQLiteDatabase mDatabase; field in SQLiteCursorTest 50 mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null); in setUp() 51 assertNotNull(mDatabase); in setUp() 53 mDatabase.execSQL("CREATE TABLE " + TABLE_NAME + " (i int, j int);"); in setUp() 58 mDatabase.close(); in tearDown() 69 mDatabase.beginTransaction(); in testFillWindow() 70 mDatabase.execSQL("CREATE TABLE " + testTable + " (col1 int, desc text not null);"); in testFillWindow() 71 mDatabase.setTransactionSuccessful(); in testFillWindow() 72 mDatabase.endTransaction(); in testFillWindow() 89 mDatabase.beginTransaction(); in testFillWindow() [all …]
|
D | SQLiteCompatibilityWalFlagsTest.java | 44 private SQLiteDatabase mDatabase; field in SQLiteCompatibilityWalFlagsTest 49 if (mDatabase != null) { in tearDown() 50 mDatabase.close(); in tearDown() 51 SQLiteDatabase.deleteDatabase(new File(mDatabase.getPath())); in tearDown() 104 mDatabase = SQLiteDatabase in testApplyFlags() 106 String journalMode = DatabaseUtils.stringForQuery(mDatabase, "PRAGMA journal_mode", null); in testApplyFlags() 108 String syncMode = DatabaseUtils.stringForQuery(mDatabase, "PRAGMA synchronous", null); in testApplyFlags() 118 mDatabase = SQLiteDatabase in testApplyFlags_thenDisableWriteAheadLogging() 121 mDatabase.disableWriteAheadLogging(); in testApplyFlags_thenDisableWriteAheadLogging() 122 String journalMode = DatabaseUtils.stringForQuery(mDatabase, "PRAGMA journal_mode", null); in testApplyFlags_thenDisableWriteAheadLogging() [all …]
|
/frameworks/base/apct-tests/perftests/core/src/android/database/ |
D | SQLiteDatabasePerfTest.java | 54 private SQLiteDatabase mDatabase; field in SQLiteDatabasePerfTest 61 mDatabase = mContext.openOrCreateDatabase(DB_NAME, Context.MODE_PRIVATE, null); in setUp() 62 mDatabase.execSQL("CREATE TABLE T1 " in setUp() 64 mDatabase.execSQL("CREATE TABLE T2 (" in setUp() 71 mDatabase.close(); in tearDown() 84 try (Cursor cursor = mDatabase.rawQuery("SELECT _ID, COL_A, COL_B, COL_C FROM T1 " in testSelect() 104 try (Cursor cursor = mDatabase.rawQuery("SELECT _ID, COL_A, COL_B, COL_C FROM T1 " in testSelectMultipleRows() 129 try (Cursor cursor = mDatabase in testCursorIterateForward() 152 try (Cursor cursor = mDatabase in testCursorIterateBackwards() 169 mDatabase.setForeignKeyConstraintsEnabled(true); in testInnerJoin() [all …]
|
D | SQLiteDatabaseIoPerfTest.java | 60 private SQLiteDatabase mDatabase; field in SQLiteDatabaseIoPerfTest 67 mDatabase = mContext.openOrCreateDatabase(DB_NAME, Context.MODE_PRIVATE, null); in setUp() 68 mDatabase.execSQL("CREATE TABLE T1 " in setUp() 74 mDatabase.close(); in tearDown() 88 assertEquals(i, mDatabase.insert("T1", null, cv)); in testDatabaseModifications() 95 assertEquals(1, mDatabase.update("T1", cv, "_ID=?", whereArg)); in testDatabaseModifications() 99 assertEquals(1, mDatabase.delete("T1", "_ID=?", whereArg)); in testDatabaseModifications() 102 mDatabase.close(); in testDatabaseModifications() 114 mDatabase.beginTransaction(); in testInsertsWithTransactions() 117 mDatabase.setTransactionSuccessful(); in testInsertsWithTransactions() [all …]
|
/frameworks/base/core/java/android/database/sqlite/ |
D | SQLiteOpenHelper.java | 64 private SQLiteDatabase mDatabase; field in SQLiteOpenHelper 196 if (mDatabase != null && mDatabase.isOpen() && !mDatabase.isReadOnly()) { in setWriteAheadLoggingEnabled() 198 mDatabase.enableWriteAheadLogging(); in setWriteAheadLoggingEnabled() 200 mDatabase.disableWriteAheadLogging(); in setWriteAheadLoggingEnabled() 231 if (mDatabase != null && mDatabase.isOpen()) { in setLookasideConfig() 250 if (mDatabase != null && mDatabase.isOpen()) { in setOpenParams() 288 if (mDatabase != null && mDatabase.isOpen()) { in setIdleConnectionTimeout() 346 if (mDatabase != null) { in getDatabaseLocked() 347 if (!mDatabase.isOpen()) { in getDatabaseLocked() 349 mDatabase = null; in getDatabaseLocked() [all …]
|
/frameworks/base/packages/MtpDocumentsProvider/src/com/android/mtp/ |
D | MtpDatabase.java | 86 private final SQLiteDatabase mDatabase; field in MtpDatabase 90 return mDatabase; in getSQLiteDatabase() 95 mDatabase = helper.getWritableDatabase(); in MtpDatabase() 100 mDatabase.close(); in close() 119 final Cursor deviceCursor = mDatabase.query( in queryRoots() 139 mDatabase, in queryRoots() 152 mDatabase, in queryRoots() 221 return mDatabase.query( in queryRootDocuments() 238 return mDatabase.query( in queryChildDocuments() 260 try (final Cursor cursor = mDatabase.query( in getStorageDocumentIds() [all …]
|
D | MtpDocumentsProvider.java | 95 private MtpDatabase mDatabase; field in MtpDocumentsProvider 115 mDatabase = new MtpDatabase(getContext(), MtpDatabaseConstants.FLAG_DATABASE_IN_FILE); in onCreate() 116 mRootScanner = new RootScanner(mResolver, mMtpManager, mDatabase); in onCreate() 124 final int lastBootCount = mDatabase.getLastBootCount(); in onCreate() 126 mDatabase.setLastBootCount(bootCount); in onCreate() 133 mDatabase.cleanDatabase(uris); in onCreate() 159 mDatabase = database; in onCreateForTesting() 160 mRootScanner = new RootScanner(mResolver, mMtpManager, mDatabase); in onCreateForTesting() 173 final Cursor cursor = mDatabase.queryRoots(mResources, projection); in queryRoots() 185 final Cursor cursor = mDatabase.queryDocument(documentId, projection); in queryDocument() [all …]
|
D | RootScanner.java | 56 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()
|
D | Mapper.java | 44 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 …]
|
D | DocumentLoader.java | 53 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/base/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/storage/ |
D | CleanupManagerTest.java | 55 @Mock private RecoverableKeyStoreDb mDatabase; field in CleanupManagerTest 64 mManager = new CleanupManager(mContext, mRecoverySnapshotStorage, mDatabase, mUserManager, in setUp() 70 when(mDatabase.getUserSerialNumbers()).thenReturn(new HashMap<>()); in registerRecoveryAgent_unknownUser_storesInDb() 79 verify(mDatabase).setUserSerialNumber(USER_ID, USER_SERIAL_NUMBER); in registerRecoveryAgent_unknownUser_storesInDb() 80 verify(mDatabase).setUserSerialNumber(USER_ID_2, USER_SERIAL_NUMBER_2); in registerRecoveryAgent_unknownUser_storesInDb() 86 when(mDatabase.getUserSerialNumbers()).thenReturn(new HashMap<>()); in registerRecoveryAgent_registersSameUser_doesntChangeDb() 93 verify(mDatabase, times(1)).setUserSerialNumber(USER_ID, USER_SERIAL_NUMBER); in registerRecoveryAgent_registersSameUser_doesntChangeDb() 100 when(mDatabase.getUserSerialNumbers()).thenReturn(knownSerialNumbers); in verifyKnownUsers_newSerialNumber_deletesData() 103 when(mDatabase.getRecoveryAgents(USER_ID)).thenReturn(recoveryAgents); in verifyKnownUsers_newSerialNumber_deletesData() 111 verify(mDatabase).removeUserFromAllTables(USER_ID); in verifyKnownUsers_newSerialNumber_deletesData() [all …]
|
D | RecoverableKeyStoreDbHelperTest.java | 101 private SQLiteDatabase mDatabase; field in RecoverableKeyStoreDbHelperTest 108 mDatabase = SQLiteDatabase.create(null); in setUp() 113 mDatabase.close(); in tearDown() 117 mDatabase.execSQL(SQL_CREATE_V2_TABLE_KEYS); in createV2Tables() 118 mDatabase.execSQL(SQL_CREATE_V2_TABLE_USER_METADATA); in createV2Tables() 119 mDatabase.execSQL(SQL_CREATE_V2_TABLE_RECOVERY_SERVICE_METADATA); in createV2Tables() 124 mDatabaseHelper.onCreate(mDatabase); in onCreate() 130 mDatabaseHelper.onUpgrade(mDatabase, /*oldVersion=*/ 1, in onUpgrade_beforeV2() 138 mDatabaseHelper.onUpgrade(mDatabase, /*oldVersion=*/ 2, in onUpgrade_fromV2() 149 mDatabaseHelper.onUpgrade(mDatabase, /*oldVersion=*/ 2, /*newVersion=*/ 3); in onUpgrade_v2_to_v3_to_v4_to_latest() [all …]
|
/frameworks/base/services/core/java/com/android/server/locksettings/recoverablekeystore/storage/ |
D | CleanupManager.java | 40 private final RecoverableKeyStoreDb mDatabase; field in CleanupManager 73 mDatabase = recoverableKeyStoreDb; in CleanupManager() 106 mSerialNumbers = mDatabase.getUserSerialNumbers(); in verifyKnownUsers() 139 mDatabase.setUserSerialNumber(userId, userSerialNumber); in storeUserSerialNumber() 152 List<Integer> recoveryAgents = mDatabase.getRecoveryAgents(userId); in removeDataForUser() 158 mDatabase.removeUserFromAllTables(userId); in removeDataForUser() 166 int generationId = mDatabase.getPlatformKeyGenerationId(userId); in removeAllKeysForRecoveryAgent() 167 Map<String, WrappedKey> allKeys = mDatabase.getAllKeys(userId, uid, generationId); in removeAllKeysForRecoveryAgent()
|
/frameworks/base/services/core/java/com/android/server/locksettings/recoverablekeystore/ |
D | RecoverableKeyGenerator.java | 68 private final RecoverableKeyStoreDb mDatabase; field in RecoverableKeyGenerator 74 mDatabase = recoverableKeyStoreDb; in RecoverableKeyGenerator() 105 long result = mDatabase.insertKey(userId, uid, alias, wrappedKey); in generateAndStoreKey() 113 long updatedRows = mDatabase.setShouldCreateSnapshot(userId, uid, true); in generateAndStoreKey() 149 long result = mDatabase.insertKey(userId, uid, alias, wrappedKey); in importKey() 157 mDatabase.setShouldCreateSnapshot(userId, uid, true); in importKey()
|
/frameworks/av/media/mtp/ |
D | MtpServer.cpp | 110 : mDatabase(database), in MtpServer() 322 mDatabase->rescanFile((const char *)edit->mPath, edit->mHandle, edit->mFormat); in commitEdit() 463 MtpObjectFormatList* playbackFormats = mDatabase->getSupportedPlaybackFormats(); in doGetDeviceInfo() 464 MtpObjectFormatList* captureFormats = mDatabase->getSupportedCaptureFormats(); in doGetDeviceInfo() 465 MtpDevicePropertyList* deviceProperties = mDatabase->getSupportedDeviceProperties(); in doGetDeviceInfo() 571 MtpObjectPropertyList* properties = mDatabase->getSupportedObjectProperties(format); in doGetObjectPropsSupported() 590 MtpObjectHandleList* handles = mDatabase->getObjectList(storageID, format, parent); in doGetObjectHandles() 610 int count = mDatabase->getNumObjects(storageID, format, parent); in doGetNumObjects() 630 MtpObjectHandleList* handles = mDatabase->getObjectReferences(handle); in doGetObjectReferences() 652 MtpResponseCode result = mDatabase->setObjectReferences(handle, references); in doSetObjectReferences() [all …]
|