diff options
Diffstat (limited to 'tests')
13 files changed, 36 insertions, 20 deletions
diff --git a/tests/Compatibility/src/com/android/compatibilitytest/AppCompatibility.java b/tests/Compatibility/src/com/android/compatibilitytest/AppCompatibility.java index 4d60c83..7ae0fb8 100644 --- a/tests/Compatibility/src/com/android/compatibilitytest/AppCompatibility.java +++ b/tests/Compatibility/src/com/android/compatibilitytest/AppCompatibility.java @@ -127,6 +127,10 @@ public class AppCompatibility extends InstrumentationTestCase { homeIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); Intent intent = mPackageManager.getLaunchIntentForPackage(packageName); + // Skip if the apk does not have a launch intent. + if (intent == null) { + return null; + } // We check for any Crash or ANR dialogs that are already up, and we ignore them. This is // so that we don't report crashes that were caused by prior apps (which those particular diff --git a/tests/ImfTest/src/com/android/imftest/samples/ButtonActivity.java b/tests/ImfTest/src/com/android/imftest/samples/ButtonActivity.java index 854a3f4..dbaedf9 100644 --- a/tests/ImfTest/src/com/android/imftest/samples/ButtonActivity.java +++ b/tests/ImfTest/src/com/android/imftest/samples/ButtonActivity.java @@ -47,7 +47,7 @@ public class ButtonActivity extends Activity { public void onClick (View v) { - InputMethodManager imm = InputMethodManager.getInstance(instance); + InputMethodManager imm = InputMethodManager.getInstance(); if (mKeyboardIsActive) { imm.hideSoftInputFromInputMethod(v.getWindowToken(), 0); diff --git a/tests/ImfTest/tests/src/com/android/imftest/samples/ImfBaseTestCase.java b/tests/ImfTest/tests/src/com/android/imftest/samples/ImfBaseTestCase.java index bc77e04..32f80a3 100644 --- a/tests/ImfTest/tests/src/com/android/imftest/samples/ImfBaseTestCase.java +++ b/tests/ImfTest/tests/src/com/android/imftest/samples/ImfBaseTestCase.java @@ -66,7 +66,7 @@ public abstract class ImfBaseTestCase<T extends Activity> extends Instrumentatio mExpectAutoPop = (keyboardType == Configuration.KEYBOARD_NOKEYS || keyboardType == Configuration.KEYBOARD_UNDEFINED); - mImm = InputMethodManager.getInstance(mTargetActivity); + mImm = InputMethodManager.getInstance(); KeyguardManager keyguardManager = (KeyguardManager) getInstrumentation().getContext().getSystemService( diff --git a/tests/RenderScriptTests/FBOTest/Android.mk b/tests/RenderScriptTests/FBOTest/Android.mk index 434d592..7a578d9 100644 --- a/tests/RenderScriptTests/FBOTest/Android.mk +++ b/tests/RenderScriptTests/FBOTest/Android.mk @@ -23,4 +23,6 @@ LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-fil LOCAL_PACKAGE_NAME := FBOTest +LOCAL_SDK_VERSION := 17 + include $(BUILD_PACKAGE) diff --git a/tests/RenderScriptTests/Fountain/Android.mk b/tests/RenderScriptTests/Fountain/Android.mk index 4a6560b..0517aef 100644 --- a/tests/RenderScriptTests/Fountain/Android.mk +++ b/tests/RenderScriptTests/Fountain/Android.mk @@ -21,8 +21,7 @@ LOCAL_MODULE_TAGS := tests LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src) -# TODO: build fails with this set -# LOCAL_SDK_VERSION := current +LOCAL_SDK_VERSION := 17 LOCAL_PACKAGE_NAME := RsFountain diff --git a/tests/RenderScriptTests/HelloWorld/Android.mk b/tests/RenderScriptTests/HelloWorld/Android.mk index 54824f4..c1c08ec 100644 --- a/tests/RenderScriptTests/HelloWorld/Android.mk +++ b/tests/RenderScriptTests/HelloWorld/Android.mk @@ -23,6 +23,6 @@ LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-fil LOCAL_PACKAGE_NAME := RsHelloWorld -LOCAL_SDK_VERSION := current +LOCAL_SDK_VERSION := 17 include $(BUILD_PACKAGE) diff --git a/tests/RenderScriptTests/MiscSamples/Android.mk b/tests/RenderScriptTests/MiscSamples/Android.mk index bdff46a..ee3567b 100644 --- a/tests/RenderScriptTests/MiscSamples/Android.mk +++ b/tests/RenderScriptTests/MiscSamples/Android.mk @@ -23,6 +23,6 @@ LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-fil LOCAL_PACKAGE_NAME := RsMiscSamples -LOCAL_SDK_VERSION := current +LOCAL_SDK_VERSION := 17 include $(BUILD_PACKAGE) diff --git a/tests/RenderScriptTests/ModelViewer/Android.mk b/tests/RenderScriptTests/ModelViewer/Android.mk index 18ceac5..86724cf 100644 --- a/tests/RenderScriptTests/ModelViewer/Android.mk +++ b/tests/RenderScriptTests/ModelViewer/Android.mk @@ -22,6 +22,8 @@ LOCAL_MODULE_TAGS := tests LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src) #LOCAL_STATIC_JAVA_LIBRARIES := android.renderscript +LOCAL_SDK_VERSION := 17 + LOCAL_PACKAGE_NAME := ModelViewer include $(BUILD_PACKAGE) diff --git a/tests/RenderScriptTests/PerfTest/Android.mk b/tests/RenderScriptTests/PerfTest/Android.mk index 0d1e7d2..e9ee771 100644 --- a/tests/RenderScriptTests/PerfTest/Android.mk +++ b/tests/RenderScriptTests/PerfTest/Android.mk @@ -24,6 +24,8 @@ LOCAL_JAVA_LIBRARIES := android.test.runner LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src) #LOCAL_STATIC_JAVA_LIBRARIES := android.renderscript +LOCAL_SDK_VERSION := 17 + LOCAL_PACKAGE_NAME := PerfTest include $(BUILD_PACKAGE) diff --git a/tests/RenderScriptTests/SceneGraph/Android.mk b/tests/RenderScriptTests/SceneGraph/Android.mk index 163a95d..6047305 100644 --- a/tests/RenderScriptTests/SceneGraph/Android.mk +++ b/tests/RenderScriptTests/SceneGraph/Android.mk @@ -21,6 +21,8 @@ LOCAL_MODULE_TAGS := tests LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src) +LOCAL_SDK_VERSION := 17 + LOCAL_PACKAGE_NAME := SceneGraphTest include $(BUILD_PACKAGE) diff --git a/tests/RenderScriptTests/ShadersTest/Android.mk b/tests/RenderScriptTests/ShadersTest/Android.mk index 0912591..fb6356e 100644 --- a/tests/RenderScriptTests/ShadersTest/Android.mk +++ b/tests/RenderScriptTests/ShadersTest/Android.mk @@ -21,6 +21,8 @@ LOCAL_MODULE_TAGS := tests LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src) +LOCAL_SDK_VERSION := 17 + LOCAL_PACKAGE_NAME := ShadersTest include $(BUILD_PACKAGE) diff --git a/tests/StatusBar/src/com/android/statusbartest/NotificationBuilderTest.java b/tests/StatusBar/src/com/android/statusbartest/NotificationBuilderTest.java index 5d0b155..9862116 100644 --- a/tests/StatusBar/src/com/android/statusbartest/NotificationBuilderTest.java +++ b/tests/StatusBar/src/com/android/statusbartest/NotificationBuilderTest.java @@ -49,6 +49,8 @@ public class NotificationBuilderTest extends Activity { private final static String TAG = "NotificationTestList"; + private final static String NOTIFY_TAG = "foo"; + NotificationManager mNM; Handler mHandler; int mStartDelay; @@ -117,34 +119,34 @@ public class NotificationBuilderTest extends Activity public void onClick(View v) { switch (v.getId()) { case R.id.clear_1: - mNM.cancel(1); + cancelNotification(1); break; case R.id.clear_2: - mNM.cancel(2); + cancelNotification(2); break; case R.id.clear_3: - mNM.cancel(3); + cancelNotification(3); break; case R.id.clear_4: - mNM.cancel(4); + cancelNotification(4); break; case R.id.clear_5: - mNM.cancel(5); + cancelNotification(5); break; case R.id.clear_6: - mNM.cancel(6); + cancelNotification(6); break; case R.id.clear_7: - mNM.cancel(7); + cancelNotification(7); break; case R.id.clear_8: - mNM.cancel(8); + cancelNotification(8); break; case R.id.clear_9: - mNM.cancel(9); + cancelNotification(9); break; case R.id.clear_10: - mNM.cancel(10); + cancelNotification(10); break; case R.id.notify_1: sendNotification(1); @@ -196,11 +198,15 @@ public class NotificationBuilderTest extends Activity final Notification n = buildNotification(id); mHandler.postDelayed(new Runnable() { public void run() { - mNM.notify(id, n); + mNM.notify(NOTIFY_TAG, id, n); } }, mStartDelay); } + private void cancelNotification(final int id) { + mNM.cancel(NOTIFY_TAG, id); + } + private static CharSequence subst(CharSequence in, char ch, CharSequence sub) { int i=0; SpannableStringBuilder edit = new SpannableStringBuilder(in); diff --git a/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java b/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java index 4345098..ba160b1 100644 --- a/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java +++ b/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java @@ -33,13 +33,10 @@ import android.util.Log; import android.net.Uri; import android.os.SystemClock; import android.widget.RemoteViews; -import android.widget.TextView; -import android.widget.ProgressBar; import android.os.PowerManager; // private NM API import android.app.INotificationManager; -import com.android.internal.statusbar.StatusBarNotification; public class NotificationTestList extends TestActivity { |