Merge "Rename CancellationSignal using preferred spelling."
diff --git a/tests/src/android/content/cts/MockContentProvider.java b/tests/src/android/content/cts/MockContentProvider.java
index 70a5e19..4cd870f 100644
--- a/tests/src/android/content/cts/MockContentProvider.java
+++ b/tests/src/android/content/cts/MockContentProvider.java
@@ -18,7 +18,7 @@
import java.util.HashMap;
-import android.content.CancelationSignal;
+import android.content.CancellationSignal;
import android.content.ContentProvider;
import android.content.ContentUris;
import android.content.ContentValues;
@@ -185,7 +185,7 @@
@Override
public Cursor query(Uri uri, String[] projection, String selection,
- String[] selectionArgs, String sortOrder, CancelationSignal cancelationSignal) {
+ String[] selectionArgs, String sortOrder, CancellationSignal cancellationSignal) {
SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
@@ -203,7 +203,7 @@
case TESTTABLE1_CROSS:
// Create a ridiculous cross-product of the test table. This is done
// to create an artificially long-running query to enable us to test
- // remote query cancelation in ContentResolverTest.
+ // remote query cancellation in ContentResolverTest.
qb.setTables("TestTable1 a, TestTable1 b, TestTable1 c, TestTable1 d, TestTable1 e");
break;
@@ -230,7 +230,7 @@
SQLiteDatabase db = mOpenHelper.getReadableDatabase();
Cursor c = qb.query(db, projection, selection, selectionArgs, null, null, orderBy,
- null, cancelationSignal);
+ null, cancellationSignal);
c.setNotificationUri(getContext().getContentResolver(), uri);
return c;
diff --git a/tests/tests/content/src/android/content/cts/ContentProviderTest.java b/tests/tests/content/src/android/content/cts/ContentProviderTest.java
index 15f397c..39b7185 100644
--- a/tests/tests/content/src/android/content/cts/ContentProviderTest.java
+++ b/tests/tests/content/src/android/content/cts/ContentProviderTest.java
@@ -23,7 +23,7 @@
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
-import android.content.ICancelationSignal;
+import android.content.ICancellationSignal;
import android.content.IContentProvider;
import android.content.ContentProviderResult;
import android.content.ContentProviderOperation;
@@ -288,7 +288,7 @@
@Override
public Cursor query(Uri url, String[] projection, String selection,
String[] selectionArgs, String sortOrder,
- ICancelationSignal cancelationSignal) {
+ ICancellationSignal cancellationSignal) {
return null;
}
@@ -320,7 +320,7 @@
}
@Override
- public ICancelationSignal createCancelationSignal() throws RemoteException {
+ public ICancellationSignal createCancellationSignal() throws RemoteException {
return null;
}
};
diff --git a/tests/tests/content/src/android/content/cts/ContentResolverTest.java b/tests/tests/content/src/android/content/cts/ContentResolverTest.java
index fa9a439..7042140 100644
--- a/tests/tests/content/src/android/content/cts/ContentResolverTest.java
+++ b/tests/tests/content/src/android/content/cts/ContentResolverTest.java
@@ -20,7 +20,7 @@
import android.accounts.Account;
-import android.content.CancelationSignal;
+import android.content.CancellationSignal;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
@@ -171,20 +171,20 @@
}
public void testCancelableQuery_WhenNotCanceled_ReturnsResultSet() {
- CancelationSignal cancelationSignal = new CancelationSignal();
+ CancellationSignal cancellationSignal = new CancellationSignal();
Cursor cursor = mContentResolver.query(TABLE1_URI, null, null, null, null,
- cancelationSignal);
+ cancellationSignal);
assertEquals(3, cursor.getCount());
cursor.close();
}
public void testCancelableQuery_WhenCanceledBeforeQuery_ThrowsImmediately() {
- CancelationSignal cancelationSignal = new CancelationSignal();
- cancelationSignal.cancel();
+ CancellationSignal cancellationSignal = new CancellationSignal();
+ cancellationSignal.cancel();
try {
- mContentResolver.query(TABLE1_URI, null, null, null, null, cancelationSignal);
+ mContentResolver.query(TABLE1_URI, null, null, null, null, cancellationSignal);
fail("Expected OperationCanceledException");
} catch (OperationCanceledException ex) {
// expected
@@ -202,28 +202,28 @@
}
for (int i = 0; i < 5; i++) {
- final CancelationSignal cancelationSignal = new CancelationSignal();
- Thread cancelationThread = new Thread() {
+ final CancellationSignal cancellationSignal = new CancellationSignal();
+ Thread cancellationThread = new Thread() {
@Override
public void run() {
try {
Thread.sleep(300);
} catch (InterruptedException ex) {
}
- cancelationSignal.cancel();
+ cancellationSignal.cancel();
}
};
try {
// Build an unsatisfiable 5-way cross-product query over 100 values but
// produces no output. This should force SQLite to loop for a long time
// as it tests 10^10 combinations.
- cancelationThread.start();
+ cancellationThread.start();
final long startTime = System.nanoTime();
try {
mContentResolver.query(TABLE1_CROSS_URI, null,
"a.value + b.value + c.value + d.value + e.value > 1000000",
- null, null, cancelationSignal);
+ null, null, cancellationSignal);
fail("Expected OperationCanceledException");
} catch (OperationCanceledException ex) {
// expected
@@ -237,7 +237,7 @@
}
} finally {
try {
- cancelationThread.join();
+ cancellationThread.join();
} catch (InterruptedException e) {
}
}
diff --git a/tests/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java b/tests/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java
index 0a3142c..8eb089f 100644
--- a/tests/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java
+++ b/tests/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java
@@ -17,7 +17,7 @@
package android.database.sqlite.cts;
-import android.content.CancelationSignal;
+import android.content.CancellationSignal;
import android.content.Context;
import android.content.OperationCanceledException;
import android.database.Cursor;
@@ -274,12 +274,12 @@
public void testCancelableQuery_WhenNotCanceled_ReturnsResultSet() {
createEmployeeTable();
- CancelationSignal cancelationSignal = new CancelationSignal();
+ CancellationSignal cancellationSignal = new CancellationSignal();
SQLiteQueryBuilder sqliteQueryBuilder = new SQLiteQueryBuilder();
sqliteQueryBuilder.setTables("Employee");
Cursor cursor = sqliteQueryBuilder.query(mDatabase,
new String[] { "name", "sum(salary)" }, null, null,
- "name", "sum(salary)>1000", "name", null, cancelationSignal);
+ "name", "sum(salary)>1000", "name", null, cancellationSignal);
assertEquals(3, cursor.getCount());
}
@@ -287,15 +287,15 @@
public void testCancelableQuery_WhenCanceledBeforeQuery_ThrowsImmediately() {
createEmployeeTable();
- CancelationSignal cancelationSignal = new CancelationSignal();
+ CancellationSignal cancellationSignal = new CancellationSignal();
SQLiteQueryBuilder sqliteQueryBuilder = new SQLiteQueryBuilder();
sqliteQueryBuilder.setTables("Employee");
- cancelationSignal.cancel();
+ cancellationSignal.cancel();
try {
sqliteQueryBuilder.query(mDatabase,
new String[] { "name", "sum(salary)" }, null, null,
- "name", "sum(salary)>1000", "name", null, cancelationSignal);
+ "name", "sum(salary)>1000", "name", null, cancellationSignal);
fail("Expected OperationCanceledException");
} catch (OperationCanceledException ex) {
// expected
@@ -305,15 +305,15 @@
public void testCancelableQuery_WhenCanceledAfterQuery_ThrowsWhenExecuted() {
createEmployeeTable();
- CancelationSignal cancelationSignal = new CancelationSignal();
+ CancellationSignal cancellationSignal = new CancellationSignal();
SQLiteQueryBuilder sqliteQueryBuilder = new SQLiteQueryBuilder();
sqliteQueryBuilder.setTables("Employee");
Cursor cursor = sqliteQueryBuilder.query(mDatabase,
new String[] { "name", "sum(salary)" }, null, null,
- "name", "sum(salary)>1000", "name", null, cancelationSignal);
+ "name", "sum(salary)>1000", "name", null, cancellationSignal);
- cancelationSignal.cancel();
+ cancellationSignal.cancel();
try {
cursor.getCount(); // force execution
fail("Expected OperationCanceledException");
@@ -326,7 +326,7 @@
createEmployeeTable();
for (int i = 0; i < 5; i++) {
- final CancelationSignal cancelationSignal = new CancelationSignal();
+ final CancellationSignal cancellationSignal = new CancellationSignal();
final Semaphore barrier1 = new Semaphore(0);
final Semaphore barrier2 = new Semaphore(0);
Thread contentionThread = new Thread() {
@@ -341,14 +341,14 @@
mDatabase.endTransaction(); // release the connection
}
};
- Thread cancelationThread = new Thread() {
+ Thread cancellationThread = new Thread() {
@Override
public void run() {
try {
Thread.sleep(300);
} catch (InterruptedException ex) {
}
- cancelationSignal.cancel();
+ cancellationSignal.cancel();
}
};
try {
@@ -356,7 +356,7 @@
sqliteQueryBuilder.setTables("Employee");
contentionThread.start();
- cancelationThread.start();
+ cancellationThread.start();
try {
barrier1.acquire(); // wait for contention thread to start transaction
@@ -367,7 +367,7 @@
try {
Cursor cursor = sqliteQueryBuilder.query(mDatabase,
new String[] { "name", "sum(salary)" }, null, null,
- "name", "sum(salary)>1000", "name", null, cancelationSignal);
+ "name", "sum(salary)>1000", "name", null, cancellationSignal);
cursor.getCount(); // force execution
fail("Expected OperationCanceledException");
} catch (OperationCanceledException ex) {
@@ -385,7 +385,7 @@
barrier2.release();
try {
contentionThread.join();
- cancelationThread.join();
+ cancellationThread.join();
} catch (InterruptedException e) {
}
}
@@ -405,15 +405,15 @@
}
for (int i = 0; i < 5; i++) {
- final CancelationSignal cancelationSignal = new CancelationSignal();
- Thread cancelationThread = new Thread() {
+ final CancellationSignal cancellationSignal = new CancellationSignal();
+ Thread cancellationThread = new Thread() {
@Override
public void run() {
try {
Thread.sleep(300);
} catch (InterruptedException ex) {
}
- cancelationSignal.cancel();
+ cancellationSignal.cancel();
}
};
try {
@@ -423,13 +423,13 @@
SQLiteQueryBuilder sqliteQueryBuilder = new SQLiteQueryBuilder();
sqliteQueryBuilder.setTables("x AS a, x AS b, x AS c, x AS d, x AS e");
- cancelationThread.start();
+ cancellationThread.start();
final long startTime = System.nanoTime();
try {
Cursor cursor = sqliteQueryBuilder.query(mDatabase, null,
"a.v + b.v + c.v + d.v + e.v > 1000000",
- null, null, null, null, null, cancelationSignal);
+ null, null, null, null, null, cancellationSignal);
cursor.getCount(); // force execution
fail("Expected OperationCanceledException");
} catch (OperationCanceledException ex) {
@@ -444,7 +444,7 @@
}
} finally {
try {
- cancelationThread.join();
+ cancellationThread.join();
} catch (InterruptedException e) {
}
}