am ce3b35a7: Merge "bug:3398527 return List insttead of ArrayList from public API" into honeycomb
* commit 'ce3b35a7b0b80061692d9fa1977cee68b365728c': bug:3398527 return List insttead of ArrayList from public API
This commit is contained in:
@@ -70101,7 +70101,7 @@
|
|||||||
</parameter>
|
</parameter>
|
||||||
</method>
|
</method>
|
||||||
<method name="getAttachedDbs"
|
<method name="getAttachedDbs"
|
||||||
return="java.util.ArrayList<android.util.Pair<java.lang.String, java.lang.String>>"
|
return="java.util.List<android.util.Pair<java.lang.String, java.lang.String>>"
|
||||||
abstract="false"
|
abstract="false"
|
||||||
native="false"
|
native="false"
|
||||||
synchronized="false"
|
synchronized="false"
|
||||||
|
|||||||
@@ -70123,7 +70123,7 @@
|
|||||||
</parameter>
|
</parameter>
|
||||||
</method>
|
</method>
|
||||||
<method name="getAttachedDbs"
|
<method name="getAttachedDbs"
|
||||||
return="java.util.ArrayList<android.util.Pair<java.lang.String, java.lang.String>>"
|
return="java.util.List<android.util.Pair<java.lang.String, java.lang.String>>"
|
||||||
abstract="false"
|
abstract="false"
|
||||||
native="false"
|
native="false"
|
||||||
synchronized="false"
|
synchronized="false"
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
package android.database;
|
package android.database;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.List;
|
||||||
|
|
||||||
import android.database.sqlite.SQLiteDatabase;
|
import android.database.sqlite.SQLiteDatabase;
|
||||||
import android.database.sqlite.SQLiteException;
|
import android.database.sqlite.SQLiteException;
|
||||||
@@ -65,7 +65,7 @@ public final class DefaultDatabaseErrorHandler implements DatabaseErrorHandler {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ArrayList<Pair<String, String>> attachedDbs = null;
|
List<Pair<String, String>> attachedDbs = null;
|
||||||
try {
|
try {
|
||||||
// Close the database, which will cause subsequent operations to fail.
|
// Close the database, which will cause subsequent operations to fail.
|
||||||
// before that, get the attached database list first.
|
// before that, get the attached database list first.
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ import dalvik.system.BlockGuard;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
@@ -2504,7 +2505,7 @@ public class SQLiteDatabase extends SQLiteClosable {
|
|||||||
String lastnode = path.substring((indx != -1) ? ++indx : 0);
|
String lastnode = path.substring((indx != -1) ? ++indx : 0);
|
||||||
|
|
||||||
// get list of attached dbs and for each db, get its size and pagesize
|
// get list of attached dbs and for each db, get its size and pagesize
|
||||||
ArrayList<Pair<String, String>> attachedDbs = db.getAttachedDbs();
|
List<Pair<String, String>> attachedDbs = db.getAttachedDbs();
|
||||||
if (attachedDbs == null) {
|
if (attachedDbs == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -2560,7 +2561,7 @@ public class SQLiteDatabase extends SQLiteClosable {
|
|||||||
* @return ArrayList of pairs of (database name, database file path) or null if the database
|
* @return ArrayList of pairs of (database name, database file path) or null if the database
|
||||||
* is not open.
|
* is not open.
|
||||||
*/
|
*/
|
||||||
public ArrayList<Pair<String, String>> getAttachedDbs() {
|
public List<Pair<String, String>> getAttachedDbs() {
|
||||||
if (!isOpen()) {
|
if (!isOpen()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -2613,7 +2614,7 @@ public class SQLiteDatabase extends SQLiteClosable {
|
|||||||
*/
|
*/
|
||||||
public boolean isDatabaseIntegrityOk() {
|
public boolean isDatabaseIntegrityOk() {
|
||||||
verifyDbIsOpen();
|
verifyDbIsOpen();
|
||||||
ArrayList<Pair<String, String>> attachedDbs = null;
|
List<Pair<String, String>> attachedDbs = null;
|
||||||
try {
|
try {
|
||||||
attachedDbs = getAttachedDbs();
|
attachedDbs = getAttachedDbs();
|
||||||
if (attachedDbs == null) {
|
if (attachedDbs == null) {
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ import junit.framework.Assert;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
public class DatabaseGeneralTest extends AndroidTestCase implements PerformanceTestCase {
|
public class DatabaseGeneralTest extends AndroidTestCase implements PerformanceTestCase {
|
||||||
@@ -1130,7 +1131,7 @@ public class DatabaseGeneralTest extends AndroidTestCase implements PerformanceT
|
|||||||
assertTrue(new File(attachedDb1File).exists());
|
assertTrue(new File(attachedDb1File).exists());
|
||||||
assertNotNull(dbObj);
|
assertNotNull(dbObj);
|
||||||
assertTrue(dbObj.isOpen());
|
assertTrue(dbObj.isOpen());
|
||||||
ArrayList<Pair<String, String>> attachedDbs = dbObj.getAttachedDbs();
|
List<Pair<String, String>> attachedDbs = dbObj.getAttachedDbs();
|
||||||
try {
|
try {
|
||||||
errorHandler.onCorruption(dbObj);
|
errorHandler.onCorruption(dbObj);
|
||||||
assertFalse(dbfile.exists());
|
assertFalse(dbfile.exists());
|
||||||
|
|||||||
Reference in New Issue
Block a user