summaryrefslogtreecommitdiffstats
path: root/core/tests
diff options
context:
space:
mode:
Diffstat (limited to 'core/tests')
-rw-r--r--core/tests/bluetoothtests/AndroidManifest.xml1
-rw-r--r--core/tests/bluetoothtests/src/android/bluetooth/BluetoothTestRunner.java2
-rw-r--r--core/tests/bluetoothtests/src/android/bluetooth/BluetoothTestUtils.java18
-rw-r--r--core/tests/coretests/src/android/pim/RecurrenceSetTest.java18
4 files changed, 26 insertions, 13 deletions
diff --git a/core/tests/bluetoothtests/AndroidManifest.xml b/core/tests/bluetoothtests/AndroidManifest.xml
index 96db035..58f158c 100644
--- a/core/tests/bluetoothtests/AndroidManifest.xml
+++ b/core/tests/bluetoothtests/AndroidManifest.xml
@@ -19,6 +19,7 @@
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
diff --git a/core/tests/bluetoothtests/src/android/bluetooth/BluetoothTestRunner.java b/core/tests/bluetoothtests/src/android/bluetooth/BluetoothTestRunner.java
index 64d2c12..56e691d 100644
--- a/core/tests/bluetoothtests/src/android/bluetooth/BluetoothTestRunner.java
+++ b/core/tests/bluetoothtests/src/android/bluetooth/BluetoothTestRunner.java
@@ -47,7 +47,7 @@ import android.util.Log;
* [-e pan_address <address>] \
* [-e pair_pin <pin>] \
* [-e pair_passkey <passkey>] \
- * -w com.android.frameworks.coretests/android.bluetooth.BluetoothTestRunner
+ * -w com.android.bluetooth.tests/android.bluetooth.BluetoothTestRunner
* }
* </pre>
*/
diff --git a/core/tests/bluetoothtests/src/android/bluetooth/BluetoothTestUtils.java b/core/tests/bluetoothtests/src/android/bluetooth/BluetoothTestUtils.java
index 5f4c226..42e5cd1 100644
--- a/core/tests/bluetoothtests/src/android/bluetooth/BluetoothTestUtils.java
+++ b/core/tests/bluetoothtests/src/android/bluetooth/BluetoothTestUtils.java
@@ -290,7 +290,7 @@ public class BluetoothTestUtils extends Assert {
@Override
public void onReceive(Context context, Intent intent) {
- if (AudioManager.ACTION_SCO_AUDIO_STATE_CHANGED.equals(intent.getAction())) {
+ if (AudioManager.ACTION_SCO_AUDIO_STATE_UPDATED.equals(intent.getAction())) {
int state = intent.getIntExtra(AudioManager.EXTRA_SCO_AUDIO_STATE,
AudioManager.SCO_AUDIO_STATE_ERROR);
assertNotSame(AudioManager.SCO_AUDIO_STATE_ERROR, state);
@@ -936,7 +936,13 @@ public class BluetoothTestUtils extends Assert {
case BluetoothProfile.STATE_DISCONNECTED:
case BluetoothProfile.STATE_DISCONNECTING:
start = System.currentTimeMillis();
- assertTrue(proxy.connect(device));
+ if (profile == BluetoothProfile.A2DP) {
+ assertTrue(((BluetoothA2dp)proxy).connect(device));
+ } else if (profile == BluetoothProfile.HEADSET) {
+ assertTrue(((BluetoothHeadset)proxy).connect(device));
+ } else if (profile == BluetoothProfile.INPUT_DEVICE) {
+ assertTrue(((BluetoothInputDevice)proxy).connect(device));
+ }
break;
default:
removeReceiver(receiver);
@@ -1005,7 +1011,13 @@ public class BluetoothTestUtils extends Assert {
case BluetoothProfile.STATE_CONNECTED:
case BluetoothProfile.STATE_CONNECTING:
start = System.currentTimeMillis();
- assertTrue(proxy.disconnect(device));
+ if (profile == BluetoothProfile.A2DP) {
+ assertTrue(((BluetoothA2dp)proxy).disconnect(device));
+ } else if (profile == BluetoothProfile.HEADSET) {
+ assertTrue(((BluetoothHeadset)proxy).disconnect(device));
+ } else if (profile == BluetoothProfile.INPUT_DEVICE) {
+ assertTrue(((BluetoothInputDevice)proxy).disconnect(device));
+ }
break;
case BluetoothProfile.STATE_DISCONNECTED:
removeReceiver(receiver);
diff --git a/core/tests/coretests/src/android/pim/RecurrenceSetTest.java b/core/tests/coretests/src/android/pim/RecurrenceSetTest.java
index 5d01ba0..e5ab179 100644
--- a/core/tests/coretests/src/android/pim/RecurrenceSetTest.java
+++ b/core/tests/coretests/src/android/pim/RecurrenceSetTest.java
@@ -21,7 +21,7 @@ import android.pim.ICalendar;
import android.pim.RecurrenceSet;
import android.test.suitebuilder.annotation.SmallTest;
import android.util.Log;
-import android.provider.Calendar;
+import android.provider.CalendarContract;
import junit.framework.TestCase;
/**
@@ -69,14 +69,14 @@ public class RecurrenceSetTest extends TestCase {
RecurrenceSet.populateContentValues(recurrenceComponent, values);
Log.d("KS", "values " + values);
- assertEquals(rrule, values.get(android.provider.Calendar.Events.RRULE));
- assertEquals(rdate, values.get(android.provider.Calendar.Events.RDATE));
- assertEquals(exrule, values.get(android.provider.Calendar.Events.EXRULE));
- assertEquals(exdate, values.get(android.provider.Calendar.Events.EXDATE));
- assertEquals(dtstart, (long) values.getAsLong(Calendar.Events.DTSTART));
- assertEquals(tzid, values.get(android.provider.Calendar.Events.EVENT_TIMEZONE));
- assertEquals(duration, values.get(android.provider.Calendar.Events.DURATION));
+ assertEquals(rrule, values.get(android.provider.CalendarContract.Events.RRULE));
+ assertEquals(rdate, values.get(android.provider.CalendarContract.Events.RDATE));
+ assertEquals(exrule, values.get(android.provider.CalendarContract.Events.EXRULE));
+ assertEquals(exdate, values.get(android.provider.CalendarContract.Events.EXDATE));
+ assertEquals(dtstart, (long) values.getAsLong(CalendarContract.Events.DTSTART));
+ assertEquals(tzid, values.get(android.provider.CalendarContract.Events.EVENT_TIMEZONE));
+ assertEquals(duration, values.get(android.provider.CalendarContract.Events.DURATION));
assertEquals(allDay,
- (int) values.getAsInteger(android.provider.Calendar.Events.ALL_DAY));
+ (int) values.getAsInteger(android.provider.CalendarContract.Events.ALL_DAY));
}
}