/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/core/java/android/database/sqlite/ |
D | SQLiteOpenHelper.java | 63 private SQLiteDatabase mDatabase; field in SQLiteOpenHelper 195 if (mDatabase != null && mDatabase.isOpen() && !mDatabase.isReadOnly()) { in setWriteAheadLoggingEnabled() 197 mDatabase.enableWriteAheadLogging(); in setWriteAheadLoggingEnabled() 199 mDatabase.disableWriteAheadLogging(); in setWriteAheadLoggingEnabled() 230 if (mDatabase != null && mDatabase.isOpen()) { in setLookasideConfig() 249 if (mDatabase != null && mDatabase.isOpen()) { in setOpenParams() 287 if (mDatabase != null && mDatabase.isOpen()) { in setIdleConnectionTimeout() 345 if (mDatabase != null) { in getDatabaseLocked() 346 if (!mDatabase.isOpen()) { in getDatabaseLocked() 348 mDatabase = null; in getDatabaseLocked() [all …]
|
D | SQLiteProgram.java | 35 private final SQLiteDatabase mDatabase; field in SQLiteProgram 46 mDatabase = db; in SQLiteProgram() 88 return mDatabase; in getDatabase() 105 return mDatabase.getThreadSession(); in getSession() 110 return mDatabase.getThreadDefaultConnectionFlags(mReadOnly); in getConnectionFlags() 115 mDatabase.onCorruption(); in onCorruption()
|
D | SQLiteDirectCursorDriver.java | 31 private final SQLiteDatabase mDatabase; field in SQLiteDirectCursorDriver 39 mDatabase = db; in SQLiteDirectCursorDriver() 46 final SQLiteQuery query = new SQLiteQuery(mDatabase, mSql, mCancellationSignal); in query() 54 cursor = factory.newCursor(mDatabase, this, mEditTable, query); in query()
|
/frameworks/base/apct-tests/perftests/core/src/android/database/ |
D | SQLiteDatabasePerfTest.java | 52 private SQLiteDatabase mDatabase; field in SQLiteDatabasePerfTest 66 mDatabase.close(); in tearDown() 81 mDatabase = SQLiteDatabase.openDatabase(dbFile, paramsBuilder.build()); in createOrOpenTestDatabase() 82 mDatabase.execSQL("CREATE TABLE T1 " in createOrOpenTestDatabase() 84 mDatabase.execSQL("CREATE TABLE T2 (" in createOrOpenTestDatabase() 98 try (Cursor cursor = mDatabase.rawQuery("SELECT _ID, COL_A, COL_B, COL_C FROM T1 " in testSelect() 118 try (Cursor cursor = mDatabase.rawQuery("SELECT _ID, COL_A, COL_B, COL_C FROM T1 " in testSelectMultipleRows() 143 try (Cursor cursor = mDatabase in testCursorIterateForward() 166 try (Cursor cursor = mDatabase in testCursorIterateBackwards() 183 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/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/packages/BackupEncryption/src/com/android/server/backup/encryption/keys/ |
D | TertiaryKeyStore.java | 53 private final BackupEncryptionDb mDatabase; field in TertiaryKeyStore 67 mDatabase = database; in TertiaryKeyStore() 89 mDatabase in save() 95 mDatabase.close(); in save() 119 mDatabase in load() 123 mDatabase.close(); in load() 147 tertiaries = mDatabase.getTertiaryKeysTable().getAllKeys(mSecondaryKey.getAlias()); in getAll() 149 mDatabase.close(); in getAll() 171 TertiaryKeysTable tertiaryKeysTable = mDatabase.getTertiaryKeysTable(); in putAll() 187 mDatabase.close(); in putAll()
|
/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/av/media/mtp/tests/MtpFuzzer/ |
D | mtp_fuzzer.cpp | 45 std::unique_ptr<MtpMockDatabase> mDatabase; member in android::MtpMockServer 62 mDatabase = std::make_unique<MtpMockDatabase>(); in MtpMockServer() 63 mDatabase->addStorage(mStorage.get()); in MtpMockServer() 65 mMtp = std::make_unique<MtpServer>(mDatabase.get(), controlFd, ptp, manu, model, version, in MtpMockServer() 105 MtpObjectInfo* objectInfo = new MtpObjectInfo(mDatabase->allocateObjectHandle()); in createDatabaseFromSourceDir() 112 mDatabase->addObject(objectInfo); in createDatabaseFromSourceDir() 119 MtpObjectInfo* objectInfo = new MtpObjectInfo(mDatabase->allocateObjectHandle()); in createDatabaseFromSourceDir() 126 mDatabase->addObject(objectInfo); in createDatabaseFromSourceDir()
|
/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()
|
D | RecoverableKeyStoreManager.java | 95 private final RecoverableKeyStoreDb mDatabase; field in RecoverableKeyStoreManager 162 mDatabase = recoverableKeyStoreDb; in RecoverableKeyStoreManager() 174 mRecoverableKeyGenerator = RecoverableKeyGenerator.newInstance(mDatabase); in RecoverableKeyStoreManager() 200 String activeRootAlias = mDatabase.getActiveRootOfTrust(userId, uid); in initRecoveryService() 208 long updatedRows = mDatabase.setActiveRootOfTrust(userId, uid, rootCertificateAlias); in initRecoveryService() 225 Long oldSerial = mDatabase.getRecoveryServiceCertSerial(userId, uid, rootCertificateAlias); in initRecoveryService() 254 long updatedCertPathRows = mDatabase.setRecoveryServiceCertPath(userId, uid, in initRecoveryService() 257 long updatedCertSerialRows = mDatabase.setRecoveryServiceCertSerial(userId, uid, in initRecoveryService() 266 if (mDatabase.getSnapshotVersion(userId, uid) != null) { in initRecoveryService() 267 mDatabase.setShouldCreateSnapshot(userId, uid, true); in initRecoveryService() [all …]
|
/frameworks/av/media/mtp/ |
D | MtpServer.cpp | 112 : mDatabase(database), in MtpServer() 324 mDatabase->rescanFile((const char *)edit->mPath, edit->mHandle, edit->mFormat); in commitEdit() 465 MtpObjectFormatList* playbackFormats = mDatabase->getSupportedPlaybackFormats(); in doGetDeviceInfo() 466 MtpObjectFormatList* captureFormats = mDatabase->getSupportedCaptureFormats(); in doGetDeviceInfo() 467 MtpDevicePropertyList* deviceProperties = mDatabase->getSupportedDeviceProperties(); in doGetDeviceInfo() 573 MtpObjectPropertyList* properties = mDatabase->getSupportedObjectProperties(format); in doGetObjectPropsSupported() 592 MtpObjectHandleList* handles = mDatabase->getObjectList(storageID, format, parent); in doGetObjectHandles() 612 int count = mDatabase->getNumObjects(storageID, format, parent); in doGetNumObjects() 632 MtpObjectHandleList* handles = mDatabase->getObjectReferences(handle); in doGetObjectReferences() 654 MtpResponseCode result = mDatabase->setObjectReferences(handle, references); in doSetObjectReferences() [all …]
|
/frameworks/base/services/usage/java/com/android/server/usage/ |
D | UserUsageStatsService.java | 83 private final UsageStatsDatabase mDatabase; field in UserUsageStatsService 130 mDatabase = new UsageStatsDatabase(usageStatsDir); in UserUsageStatsService() 142 mDatabase.init(currentTimeMillis); in init() 143 if (mDatabase.wasUpgradePerformed()) { in init() 144 mDatabase.prunePackagesDataOnUpgrade(installedPackages); in init() 149 mCurrentStats[i] = mDatabase.getLatestUsageStats(i); in init() 191 if (mDatabase.isNewUpdate()) { in init() 207 return mDatabase.onPackageRemoved(packageName, timeRemoved); in onPackageRemoved() 212 mDatabase.readMappingsLocked(); in readPackageMappingsLocked() 239 for (int i = mDatabase.mPackagesTokenData.packagesToTokensMap.size() - 1; i >= 0; i--) { in updatePackageMappingsLocked() [all …]
|
/frameworks/base/media/jni/ |
D | android_mtp_MtpDatabase.cpp | 154 jobject mDatabase; member in MtpDatabase 263 : mDatabase(env->NewGlobalRef(client)), in MtpDatabase() 289 env->DeleteGlobalRef(mDatabase); in cleanup() 304 MtpObjectHandle result = env->CallIntMethod(mDatabase, method_beginSendObject, in beginSendObject() 315 env->CallVoidMethod(mDatabase, method_endSendObject, (jint)handle, (jboolean)succeeded); in endSendObject() 324 env->CallVoidMethod(mDatabase, method_rescanFile, pathStr, in rescanFile() 336 jintArray array = (jintArray)env->CallObjectMethod(mDatabase, method_getObjectList, in getObjectList() 356 int result = env->CallIntMethod(mDatabase, method_getNumObjects, in getNumObjects() 365 jintArray array = (jintArray)env->CallObjectMethod(mDatabase, in getSupportedPlaybackFormats() 383 jintArray array = (jintArray)env->CallObjectMethod(mDatabase, in getSupportedCaptureFormats() [all …]
|