summaryrefslogtreecommitdiffstats
path: root/tests/Compatibility
diff options
context:
space:
mode:
authorwsmlby <wsmlby@google.com>2014-09-18 13:33:18 -0700
committerwsmlby <wsmlby@google.com>2014-09-18 14:09:17 -0700
commite87cc9a2f29567747c0ea92756f2b579550016c7 (patch)
tree26291b31e4575223afb2b83b8ae32d9036592880 /tests/Compatibility
parentb5dc5f6b555dd747bb4bc51bf5fe64e8a4aa4093 (diff)
downloadframeworks_base-e87cc9a2f29567747c0ea92756f2b579550016c7.zip
frameworks_base-e87cc9a2f29567747c0ea92756f2b579550016c7.tar.gz
frameworks_base-e87cc9a2f29567747c0ea92756f2b579550016c7.tar.bz2
Add leanback support to AppCompatiblityTest
Change-Id: Ia9da14b8551c4ec5834a047f0792a5a213a3ac04
Diffstat (limited to 'tests/Compatibility')
-rw-r--r--tests/Compatibility/Android.mk2
-rw-r--r--tests/Compatibility/AndroidManifest.xml2
-rw-r--r--tests/Compatibility/src/com/android/compatibilitytest/AppCompatibility.java12
3 files changed, 11 insertions, 5 deletions
diff --git a/tests/Compatibility/Android.mk b/tests/Compatibility/Android.mk
index 5385413..0ec4d9d 100644
--- a/tests/Compatibility/Android.mk
+++ b/tests/Compatibility/Android.mk
@@ -18,12 +18,12 @@ include $(CLEAR_VARS)
# We only want this apk build for tests.
LOCAL_MODULE_TAGS := tests
+LOCAL_JAVA_LIBRARIES := android.test.runner
# Include all test java files.
LOCAL_SRC_FILES := \
$(call all-java-files-under, src)
-LOCAL_SDK_VERSION := 8
LOCAL_PACKAGE_NAME := AppCompatibilityTest
include $(BUILD_PACKAGE)
diff --git a/tests/Compatibility/AndroidManifest.xml b/tests/Compatibility/AndroidManifest.xml
index 103ef4c..2884532 100644
--- a/tests/Compatibility/AndroidManifest.xml
+++ b/tests/Compatibility/AndroidManifest.xml
@@ -24,6 +24,4 @@
android:name=".AppCompatibilityRunner"
android:targetPackage="com.android.compatibilitytest"
android:label="App Compability Test Runner" />
-
- <uses-sdk android:minSdkVersion="8"></uses-sdk>
</manifest>
diff --git a/tests/Compatibility/src/com/android/compatibilitytest/AppCompatibility.java b/tests/Compatibility/src/com/android/compatibilitytest/AppCompatibility.java
index a2e9117..5794b2b 100644
--- a/tests/Compatibility/src/com/android/compatibilitytest/AppCompatibility.java
+++ b/tests/Compatibility/src/com/android/compatibilitytest/AppCompatibility.java
@@ -147,11 +147,19 @@ public class AppCompatibility extends InstrumentationTestCase {
* during the app launch.
*/
private ProcessErrorStateInfo launchActivity(String packageName) {
+ // the recommended way to see if this is a tv or not.
+ boolean isleanback = !mPackageManager.hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN)
+ && !mPackageManager.hasSystemFeature(PackageManager.FEATURE_TELEPHONY);
Intent homeIntent = new Intent(Intent.ACTION_MAIN);
homeIntent.addCategory(Intent.CATEGORY_HOME);
homeIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
-
- Intent intent = mPackageManager.getLaunchIntentForPackage(packageName);
+ Intent intent;
+ if (isleanback) {
+ Log.d(TAG, "Leanback and relax!");
+ intent = mPackageManager.getLeanbackLaunchIntentForPackage(packageName);
+ } else {
+ intent = mPackageManager.getLaunchIntentForPackage(packageName);
+ }
// Skip if the apk does not have a launch intent.
if (intent == null) {
Log.d(TAG, "Skipping " + packageName + "; missing launch intent");